|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.javasoft.jsmat.variable.MatVariable
public abstract class MatVariable
MatVariable is the superclass of all (non primitive) matlab data types.
Most subclasses are matrices of different primitive type, such as
MatDoubleMatrix or MatCharMatrix. However, some special cases
exist, such as MatCell, MatStructure etc.
Note that for matrices, the data is column packed (FORTRAN like), that is, the first column is written, then the second etc (column by column, not row by row as in java or c). For m dimensions, the first dimension is iterated first (i.e. the rows), then the second (columns), third etc. (again, opposite iteration order than java or c).
| Field Summary | |
|---|---|
protected static String |
DEFAULT_NAME
|
protected int[] |
mDims
|
protected MatClass |
mMatClass
|
| Constructor Summary | |
|---|---|
MatVariable(MatClass matClass,
int[] dims)
Constructor with matrix class constant and dimensions |
|
| Method Summary | |
|---|---|
protected void |
checkRawDataSizeOverflow(int typeSize)
Throws an exception if the raw data size is larger than Integer.MAX_VALUE. |
protected void |
checkValueLength(int len)
Check whether the given len is equal to the expected length, computed from the dimensions (see getDimLength()). |
int |
getDimLength()
|
int |
getFlags()
|
protected abstract int |
getRawDataSize()
|
int |
getSize(String name)
|
protected void |
writeStart(String name,
DataOutput out)
Writes the start of the data block to the given data output. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String DEFAULT_NAME
protected MatClass mMatClass
protected int[] mDims
| Constructor Detail |
|---|
public MatVariable(MatClass matClass,
int[] dims)
matClass - matrix class constantdims - dimensions| Method Detail |
|---|
public int getDimLength()
protected void checkValueLength(int len)
throws IllegalArgumentException
getDimLength()).
If the check fails, an IllegalArgumentException is thrown.
len - the actual value count, to be compared with the reserved
size computed from the dimensions
IllegalArgumentException - if the check failspublic int getFlags()
protected abstract int getRawDataSize()
protected void checkRawDataSizeOverflow(int typeSize)
throws ArithmeticException
typeSize - the size of a single value
ArithmeticException - if the computed size is out of integer rangepublic int getSize(String name)
protected void writeStart(String name,
DataOutput out)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||