org.ejml.data
Class Matrix64F

java.lang.Object
  extended by org.ejml.data.Matrix64F
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
D1Matrix64F

public abstract class Matrix64F
extends Object
implements Serializable

An abstract class for all 64 bit floating point rectangular matrices.

Author:
Peter Abeles
See Also:
Serialized Form

Field Summary
 int numCols
          Number of columns in the matrix.
 int numRows
          Number of rows in the matrix.
 
Constructor Summary
Matrix64F()
           
 
Method Summary
abstract
<T extends Matrix64F>
T
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()
           
abstract  void reshape(int numRows, int numCols, boolean saveValues)
          Changes the number of rows and columns in a matrix and if possible does not declare new memory.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numRows

public int numRows
Number of rows in the matrix.


numCols

public int numCols
Number of columns in the matrix.

Constructor Detail

Matrix64F

public Matrix64F()
Method Detail

reshape

public abstract void reshape(int numRows,
                             int numCols,
                             boolean saveValues)
Changes the number of rows and columns in a matrix and if possible does not declare new memory. If saveValues is true and new memory needs to be declared, the value of the old internal data will be copied over into the new internal data.

Parameters:
numRows - The new number of rows the matrix will have.
numCols - The new number of columns the matrix will have.
saveValues - If new memory is declared should it copy the old values over?

get

public abstract double get(int row,
                           int col)
Returns the value of value of the specified matrix element.

Parameters:
row - Matrix element's row index..
col - Matrix element's column index.
Returns:
The specified element's value.

unsafe_get

public abstract double unsafe_get(int row,
                                  int col)
Same as 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.

Parameters:
row - Matrix element's row index..
col - Matrix element's column index.
Returns:
The specified element's value.

set

public abstract void set(int row,
                         int col,
                         double val)
Sets the value of the specified matrix element.

Parameters:
row - Matrix element's row index..
col - Matrix element's column index.
val - The element's new value.

unsafe_set

public 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. 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.

Parameters:
row - Matrix element's row index..
col - Matrix element's column index.
val - The element's new value.

iterator

public MatrixIterator iterator(boolean rowMajor,
                               int minRow,
                               int minCol,
                               int maxRow,
                               int maxCol)
Creates a new iterator for traversing through a submatrix inside this matrix. It can be traversed by row or by column. Range of elements is inclusive, e.g. minRow = 0 and maxRow = 1 will include rows 0 and 1. The iteration starts at (minRow,minCol) and ends at (maxRow,maxCol)

Parameters:
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.
Returns:
A new MatrixIterator

getNumRows

public int getNumRows()
Returns the number of rows in this matrix.

Returns:
Number of rows.

getNumCols

public int getNumCols()
Returns the number of columns in this matrix.

Returns:
Number of columns.

getNumElements

public abstract int getNumElements()
Returns the number of elements in this matrix, which is the number of rows times the number of columns.

Returns:
Number of elements in this matrix.

set

public void set(Matrix64F A)
Assigns the value of 'this' matrix to be the same as 'A'. The shape of both matrices must be the same.

Parameters:
A - The matrix whose value is to be copied into 'this'.

copy

public abstract <T extends Matrix64F> T copy()

print

public abstract void print()


Copyright © 2011. All Rights Reserved.