com.jmatio.types
Class MLSparse

java.lang.Object
  extended by com.jmatio.types.MLArray
      extended by com.jmatio.types.MLNumericArray<Double>
          extended by com.jmatio.types.MLSparse
All Implemented Interfaces:
ByteStorageSupport<Double>, GenericArrayCreator<Double>

public class MLSparse
extends MLNumericArray<Double>


Field Summary
 
Fields inherited from class com.jmatio.types.MLArray
attributes, dims, mtFLAG_COMPLEX, mtFLAG_GLOBAL, mtFLAG_LOGICAL, mtFLAG_TYPE, mxCELL_CLASS, mxCHAR_CLASS, mxDOUBLE_CLASS, mxFUNCTION_CLASS, mxINT16_CLASS, mxINT32_CLASS, mxINT64_CLASS, mxINT8_CLASS, mxOBJECT_CLASS, mxOPAQUE_CLASS, mxSINGLE_CLASS, mxSPARSE_CLASS, mxSTRUCT_CLASS, mxUINT16_CLASS, mxUINT32_CLASS, mxUINT64_CLASS, mxUINT8_CLASS, mxUNKNOWN_CLASS, name, type
 
Constructor Summary
MLSparse(String name, int[] dims, int attributes, int nzmax)
           
 
Method Summary
protected  void allocate()
           
 Double buldFromBytes(byte[] bytes)
           
 String contentToString()
           
 Double[] createArray(int m, int n)
           
 Double[] exportImaginary()
          Returns the imaginary part (PI) array.
 Double[] exportReal()
          Returns the real part (PR) array.
 byte[] getByteArray(Double value)
           
 int getBytesAllocated()
           
 Double getImaginary(int index)
           
 Double getImaginary(int m, int n)
          Gets single imaginary array element of A(m,n).
 int[] getIR()
          Gets row indices ir points to an integer array of length nzmax containing the row indices of the corresponding elements in pr and pi.
 int[] getJC()
          Gets column indices.
 int getMaxNZ()
          Gets maximum number of non-zero values
 Double getReal(int index)
           
 Double getReal(int m, int n)
          Gets single real array element of A(m,n).
 Class<Double> getStorageClazz()
           
 void setImaginary(Double value, int index)
          Sets single real array element.
 void setImaginary(Double value, int m, int n)
          Sets single imaginary array element.
 void setReal(Double value, int index)
          Sets single real array element.
 void setReal(Double value, int m, int n)
          Sets single real array element.
 
Methods inherited from class com.jmatio.types.MLNumericArray
_get, _set, dispose, equals, get, get, getImaginaryByteBuffer, getRealByteBuffer, putImaginaryByteBuffer, putRealByteBuffer, set, set, set, setReal
 
Methods inherited from class com.jmatio.types.MLArray
getDimensions, getFlags, getIndex, getM, getN, getName, getNameToByteArray, getNDimensions, getSize, getType, isCell, isChar, isComplex, isDouble, isEmpty, isFunctionObject, isInt16, isInt32, isInt64, isInt8, isLogical, isObject, isOpaque, isSingle, isSparse, isStruct, isUint16, isUint32, isUint64, isUint8, isUnknown, toString, typeToString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MLSparse

public MLSparse(String name,
                int[] dims,
                int attributes,
                int nzmax)
Parameters:
name -
dims -
attributes -
nzmax -
Method Detail

allocate

protected void allocate()
Overrides:
allocate in class MLNumericArray<Double>

getMaxNZ

public int getMaxNZ()
Gets maximum number of non-zero values

Returns:

getIR

public int[] getIR()
Gets row indices ir points to an integer array of length nzmax containing the row indices of the corresponding elements in pr and pi.


getJC

public int[] getJC()
Gets column indices. jc points to an integer array of length N+1 that contains column index information. For j, in the range 0<=j<=N–1, jc[j] is the index in ir and pr (and pi if it exists) of the first nonzero entry in the jth column and jc[j+1]–1 index of the last nonzero entry. As a result, jc[N] is also equal to nnz, the number of nonzero entries in the matrix. If nnz is less than nzmax, then more nonzero entries can be inserted in the array without allocating additional storage

Returns:

createArray

public Double[] createArray(int m,
                            int n)

getReal

public Double getReal(int m,
                      int n)
Description copied from class: MLNumericArray
Gets single real array element of A(m,n).

Overrides:
getReal in class MLNumericArray<Double>
Parameters:
m - - row index
n - - column index
Returns:
- array element

getReal

public Double getReal(int index)
Overrides:
getReal in class MLNumericArray<Double>
Returns:

setReal

public void setReal(Double value,
                    int m,
                    int n)
Description copied from class: MLNumericArray
Sets single real array element.

Overrides:
setReal in class MLNumericArray<Double>
Parameters:
value -
m -
n -

setReal

public void setReal(Double value,
                    int index)
Description copied from class: MLNumericArray
Sets single real array element.

Overrides:
setReal in class MLNumericArray<Double>
Parameters:
value -
index -

setImaginary

public void setImaginary(Double value,
                         int m,
                         int n)
Description copied from class: MLNumericArray
Sets single imaginary array element.

Overrides:
setImaginary in class MLNumericArray<Double>
Parameters:
value -
m -
n -

setImaginary

public void setImaginary(Double value,
                         int index)
Description copied from class: MLNumericArray
Sets single real array element.

Overrides:
setImaginary in class MLNumericArray<Double>
Parameters:
value -
index -

getImaginary

public Double getImaginary(int m,
                           int n)
Description copied from class: MLNumericArray
Gets single imaginary array element of A(m,n).

Overrides:
getImaginary in class MLNumericArray<Double>
Parameters:
m - - row index
n - - column index
Returns:
- array element

getImaginary

public Double getImaginary(int index)
Overrides:
getImaginary in class MLNumericArray<Double>
Returns:

exportReal

public Double[] exportReal()
Returns the real part (PR) array. PR has length number-of-nonzero-values.

Returns:
real part

exportImaginary

public Double[] exportImaginary()
Returns the imaginary part (PI) array. PI has length number-of-nonzero-values.

Returns:

contentToString

public String contentToString()
Overrides:
contentToString in class MLNumericArray<Double>

getBytesAllocated

public int getBytesAllocated()

buldFromBytes

public Double buldFromBytes(byte[] bytes)

getByteArray

public byte[] getByteArray(Double value)

getStorageClazz

public Class<Double> getStorageClazz()


Copyright © 2006–2013 GeoSolutions. All rights reserved.