| org.jscience.mathematics.vector.DenseMatrix
DenseMatrix | final public class DenseMatrix extends Matrix (Code) | | This class represents a matrix made of
DenseVector densevectors (as rows). To create a dense matrix made of column vectors the
DenseMatrix.transpose method can be used.
For example:[code]
DenseVector column0 = DenseVector.valueOf(...);
DenseVector column1 = DenseVector.valueOf(...);
DenseMatrix M = DenseMatrix.valueOf(column0, column1).transpose();
[/code]
As for any concrete
org.jscience.mathematics.structure.Structurestructure , this class is declared final (otherwise most
operations would have to be overridden to return the appropriate type).
Specialized dense matrix should sub-class
Matrix directly.
For example:[code]
// Extension through composition.
final class TriangularMatrix > extends Matrix {
private DenseMatrix _value; // Possible implementation.
...
public TriangularMatrix opposite() { // Returns the right type.
return TriangularMatrix.valueOf(_value.opposite());
}
...
}[/code]
author: Jean-Marie Dautelle version: 3.3, January 2, 2007 |
Field Summary | |
int | _n Holds the number of columns n. | final FastTable<DenseVector<F>> | _rows Holds this matrix rows (or columns when transposed). | boolean | _transposed Indicates if this matrix is transposed (the rows are then the columns). |
_n | int _n(Code) | | Holds the number of columns n.
|
_rows | final FastTable<DenseVector<F>> _rows(Code) | | Holds this matrix rows (or columns when transposed).
|
_transposed | boolean _transposed(Code) | | Indicates if this matrix is transposed (the rows are then the columns).
|
cofactor | public F cofactor(int i, int j)(Code) | | |
determinant | public F determinant()(Code) | | |
get | public F get(int i, int j)(Code) | | |
getNumberOfColumns | public int getNumberOfColumns()(Code) | | |
getNumberOfRows | public int getNumberOfRows()(Code) | | |
set | void set(int i, int j, F e)(Code) | | |
valueOf | public static DenseMatrix<F> valueOf(F[][] elements)(Code) | | Returns a dense matrix from the specified 2-dimensional array.
The first dimension being the row and the second being the column.
Parameters: elements - this matrix elements. the matrix having the specified elements. throws: DimensionException - if rows have different length. See Also: DenseMatrix See Also: |
valueOf | public static DenseMatrix<F> valueOf(List<DenseVector<F>> rows)(Code) | | Returns a dense matrix holding the row vectors from the specified
collection (column vectors if
DenseMatrix.transpose transposed ).
Parameters: rows - the list of row vectors. the matrix having the specified rows. throws: DimensionException - if the rows do not have the same dimension. |
valueOf | public static DenseMatrix<F> valueOf(Matrix<F> that)(Code) | | Returns a dense matrix equivalent to the specified matrix.
Parameters: that - the matrix to convert. that or a dense matrix holding the same elementsas the specified matrix. |
|
|