Caveat
This implementation assumes that, for any x,
the equality x * 0d == 0d holds. But it is is not true for
NaN. Moreover, zero entries will lose their sign.
Some operations (that involve NaN and/or infinities) may
thus give incorrect results.
| Modifier and Type | Field and Description |
|---|---|
| private final int | columns
Column dimension. |
| private final OpenIntToFieldHashMap | entries
Storage for (sparse) matrix elements. |
| private final int | rows
Row dimension. |
| Access | Constructor and Description |
|---|---|
| public | SparseFieldMatrix(final Field<T>
Field to which the elements belong. field)Create a matrix with no data. |
| public | SparseFieldMatrix(final Field<T>
Field to which the elements belong. field, final int Number of rows in the new matrix. rowDimension, final int Number of columns in the new matrix. columnDimension)Create a new SparseFieldMatrix<t> with the supplied row and column dimensions. |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addToEntry(int
Row location of entry to be set. row, int Column location of entry to be set. column, T Value to add to the current matrix entry in
increment)(row, column).Implements abstract org. Implements org. Change an entry in the specified row and column. |
| private int | Returns: the key within the map to access the matrix element.Row index of the matrix element. row, int Column index of the matrix element. column)Compute the key to access a matrix element. |
| public FieldMatrix | copy()
Implements abstract org. Implements org. Make a (deep) copy of this. |
| public FieldMatrix | createMatrix(int
the number of rows in the new matrix rowDimension, int the number of columns in the new matrix columnDimension)Implements abstract org. Implements org. Create a new FieldMatrix<t> of the same type as the instance with the supplied row and column dimensions. |
| public int | getColumnDimension()
Implements abstract org. Implements org. Returns the number of columns in the matrix. |
| public T | getEntry(int
row location of entry to be fetched row, int column location of entry to be fetched column)Implements abstract org. Implements org. Returns the entry in the specified row and column. |
| public int | getRowDimension()
Implements abstract org. Implements org. Returns the number of rows in the matrix. |
| public void | multiplyEntry(int
Row location of entry to be set. row, int Column location of entry to be set. column, T Multiplication factor for the current matrix entry
in factor)(row,column)Implements abstract org. Implements org. Change an entry in the specified row and column. |
| public void | setEntry(int
row location of entry to be set row, int column location of entry to be set column, T matrix entry to be set in row,column value)Implements abstract org. Implements org. Set the entry in the specified row and column. |
| columns | back to summary |
|---|---|
| private final int columns Column dimension. | |
| entries | back to summary |
|---|---|
| private final OpenIntToFieldHashMap<T> entries Storage for (sparse) matrix elements. | |
| rows | back to summary |
|---|---|
| private final int rows Row dimension. | |
| SparseFieldMatrix | back to summary |
|---|---|
| public SparseFieldMatrix(final Field<T> field) Create a matrix with no data.
| |
| SparseFieldMatrix | back to summary |
|---|---|
| public SparseFieldMatrix(final Field<T> field, final int rowDimension, final int columnDimension) Create a new SparseFieldMatrix Field to which the elements belong.
Number of rows in the new matrix.
Number of columns in the new matrix.
| |
| SparseFieldMatrix | back to summary |
|---|---|
| public SparseFieldMatrix(SparseFieldMatrix<T> other) Copy constructor.
| |
| SparseFieldMatrix | back to summary |
|---|---|
| public SparseFieldMatrix(FieldMatrix<T> other) Generic copy constructor.
| |
| addToEntry | back to summary |
|---|---|
| public void addToEntry(int row, int column, T increment) Implements abstract org. Implements org. Doc from org. Change an entry in the specified row and column.
| |
| computeKey | back to summary |
|---|---|
| private int computeKey(int row, int column) Compute the key to access a matrix element.
| |
| copy | back to summary |
|---|---|
| public FieldMatrix Implements abstract org. Implements org. Doc from org. Make a (deep) copy of this.
| |
| createMatrix | back to summary |
|---|---|
| public FieldMatrix Implements abstract org. Implements org. Doc from org. Create a new FieldMatrix Doc from org. the number of rows in the new matrix
Doc from org. the number of columns in the new matrix
Doc from org. a new matrix of the same type as the instance
| |
| getColumnDimension | back to summary |
|---|---|
| public int getColumnDimension() Implements abstract org. Implements org. Doc from org. Returns the number of columns in the matrix.
| |
| getEntry | back to summary |
|---|---|
| public T getEntry(int row, int column) Implements abstract org. Implements org. Doc from org. Returns the entry in the specified row and column.
| |
| getRowDimension | back to summary |
|---|---|
| public int getRowDimension() Implements abstract org. Implements org. Doc from org. Returns the number of rows in the matrix.
| |
| multiplyEntry | back to summary |
|---|---|
| public void multiplyEntry(int row, int column, T factor) Implements abstract org. Implements org. Doc from org. Change an entry in the specified row and column.
| |
| setEntry | back to summary |
|---|---|
| public void setEntry(int row, int column, T value) Implements abstract org. Implements org. Doc from org. Set the entry in the specified row and column.
| |