public abstract class Matrix64F extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
int |
numCols
Number of columns in the matrix.
|
int |
numRows
Number of rows in the matrix.
|
| Constructor and Description |
|---|
Matrix64F() |
| Modifier and Type | Method and Description |
|---|---|
abstract <T extends Matrix64F> |
copy() |
abstract double |
get(int row,
int col)
Returns the value of value of the specified matrix element.
|
int |
getNumCols()
Returns the number of columns in this matrix.
|
abstract int |
getNumElements()
Returns the number of elements in this matrix, which is the number of rows
times the number of columns.
|
int |
getNumRows()
Returns the number of rows in this matrix.
|
MatrixIterator |
iterator(boolean rowMajor,
int minRow,
int minCol,
int maxRow,
int maxCol)
Creates a new iterator for traversing through a submatrix inside this matrix.
|
abstract void |
print() |
void |
reshape(int numRows,
int numCols)
Equivalent to invoking reshape(numRows,numCols,false);
|
abstract void |
reshape(int numRows,
int numCols,
boolean saveValues)
Changes the number of rows and columns in the matrix, allowing its size to grow or shrink.
|
abstract void |
set(int row,
int col,
double val)
Sets the value of the specified matrix element.
|
void |
set(Matrix64F A)
Assigns the value of 'this' matrix to be the same as 'A'.
|
abstract double |
unsafe_get(int row,
int col)
Same as
get(int, int) but does not perform bounds check on input parameters. |
abstract void |
unsafe_set(int row,
int col,
double val)
Same as
set(int, int, double) but does not perform bounds check on input parameters. |
public int numRows
public int numCols
public abstract void reshape(int numRows,
int numCols,
boolean saveValues)
Changes the number of rows and columns in the matrix, allowing its size to grow or shrink. If the saveValues flag is set to true, then the previous values will be maintained, but reassigned to new elements in a row-major ordering. If saveValues is false values will only be maintained when the requested size is less than or equal to the internal array size. The primary use for this function is to encourage data reuse and avoid unnecessarily declaring and initialization of new memory.
Examples:
[ 1 2 ; 3 4 ] -> reshape( 2 , 3 , true ) = [ 1 2 3 ; 4 0 0 ]
[ 1 2 ; 3 4 ] -> reshape( 1 , 2 , true ) = [ 1 2 ]
[ 1 2 ; 3 4 ] -> reshape( 1 , 2 , false ) = [ 1 2 ]
[ 1 2 ; 3 4 ] -> reshape( 2 , 3 , false ) = [ 0 0 0 ; 0 0 0 ]
numRows - The new number of rows in the matrix.numCols - The new number of columns in the matrix.saveValues - If true then the value of each element will be save using a row-major reordering. Typically this should be false.public void reshape(int numRows,
int numCols)
numRows - The new number of rows in the matrix.numCols - The new number of columns in the matrix.public abstract double get(int row,
int col)
row - Matrix element's row index..col - Matrix element's column index.public abstract double unsafe_get(int row,
int col)
get(int, int) but does not perform bounds check on input parameters. This results in about a 25%
speed increase but potentially sacrifices stability and makes it more difficult to track down simple errors.
It is not recommended that this function be used, except in highly optimized code where the bounds are
implicitly being checked.row - Matrix element's row index..col - Matrix element's column index.public abstract void set(int row,
int col,
double val)
row - Matrix element's row index..col - Matrix element's column index.val - The element's new value.public abstract void unsafe_set(int row,
int col,
double val)
set(int, int, double) but does not perform bounds check on input parameters. This results in about a 25%
speed increase but potentially sacrifices stability and makes it more difficult to track down simple errors.
It is not recommended that this function be used, except in highly optimized code where the bounds are
implicitly being checked.row - Matrix element's row index..col - Matrix element's column index.val - The element's new value.public MatrixIterator iterator(boolean rowMajor, int minRow, int minCol, int maxRow, int maxCol)
rowMajor - true means it will traverse through the submatrix by row first, false by columns.minRow - first row it will start at.minCol - first column it will start at.maxRow - last row it will stop at.maxCol - last column it will stop at.public int getNumRows()
public int getNumCols()
public abstract int getNumElements()
public void set(Matrix64F A)
A - The matrix whose value is to be copied into 'this'.public abstract <T extends Matrix64F> T copy()
public abstract void print()
Copyright © 2013. All Rights Reserved.