|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.javasoft.jsmat.variable.MatVariable
ch.javasoft.jsmat.variable.MatAllocated
ch.javasoft.jsmat.variable.MatMatrix<A>
A - the matrix type, typically an array of a java primitive typepublic abstract class MatMatrix<A>
A MatMatrix is a matrix with data. The data must be allocated when
instantiating the matrix, that is, it is kept in memory. They are simple to
use, but MatReservedMatrix might be an option for large matrices
which allow writing the data piecewise without preallocating it in memory.
| Nested Class Summary | |
|---|---|
protected static class |
MatMatrix.MatGenericMatrix<A>
Generic class for internal use in static create... |
| Field Summary | |
|---|---|
protected MatType |
mMatType
|
| Fields inherited from class ch.javasoft.jsmat.variable.MatVariable |
|---|
DEFAULT_NAME, mDims, mMatClass |
| Constructor Summary | |
|---|---|
MatMatrix(MatClass matClass,
MatType matType,
int[] dims)
|
|
| Method Summary | |
|---|---|
static MatMatrix<double[]> |
createDoubleMatrix(double[] values,
int[] dims)
Creates a double matrix |
static MatMatrix<double[]> |
createDoubleMatrix(double[] values,
int rows,
int cols)
Creates a double matrix |
static MatMatrix<int[]> |
createIntMatrix(int[] values,
int[] dims)
Creates a integer matrix |
static MatMatrix<int[]> |
createIntMatrix(int[] values,
int rows,
int cols)
Creates a integer matrix |
MatMatrix<char[]> |
createUtf8Matrix(byte[] values)
Creates a utf8 encoded character matrix with 1 row |
MatMatrix<char[]> |
createUtf8Matrix(byte[] values,
int[] dims)
Creates a utf8 encoded character matrix |
protected abstract int |
getMatrixSize()
Returns the matrix size, typically the overall array length of the underlying data |
protected int |
getRawDataSize()
|
abstract void |
writeRawData(DataOutput out)
Write the raw data to the given output, excluding type, size, name etc. |
| Methods inherited from class ch.javasoft.jsmat.variable.MatAllocated |
|---|
write |
| Methods inherited from class ch.javasoft.jsmat.variable.MatVariable |
|---|
checkRawDataSizeOverflow, checkValueLength, getDimLength, getFlags, getSize, writeStart |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final MatType mMatType
| Constructor Detail |
|---|
public MatMatrix(MatClass matClass,
MatType matType,
int[] dims)
| Method Detail |
|---|
protected int getRawDataSize()
getRawDataSize in class MatVariableprotected abstract int getMatrixSize()
public abstract void writeRawData(DataOutput out)
throws IOException
writeRawData in class MatAllocatedout - the data output to write to
IOException - if any io exception occurs
public static MatMatrix<double[]> createDoubleMatrix(double[] values,
int rows,
int cols)
values - the data values, column packed (FORTRAN like)rows - number of rowscols - number of columns
public static MatMatrix<double[]> createDoubleMatrix(double[] values,
int[] dims)
values - the data values, column packed (FORTRAN like)dims - the dimensions
public static MatMatrix<int[]> createIntMatrix(int[] values,
int rows,
int cols)
values - the data values, column packed (FORTRAN like)rows - number of rowscols - number of columns
public static MatMatrix<int[]> createIntMatrix(int[] values,
int[] dims)
values - the data values, column packed (FORTRAN like)dims - the dimensions
public MatMatrix<char[]> createUtf8Matrix(byte[] values)
values - the data values, column packed (FORTRAN like)
public MatMatrix<char[]> createUtf8Matrix(byte[] values,
int[] dims)
values - the data values, column packed (FORTRAN like)dims - the dimensions
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||