Package org.jscience.mathematics.vector
Class Float64Matrix
- java.lang.Object
-
- org.jscience.mathematics.vector.Matrix<Float64>
-
- org.jscience.mathematics.vector.Float64Matrix
-
- All Implemented Interfaces:
javolution.lang.Immutable,javolution.lang.Realtime,javolution.lang.ValueType,GroupAdditive<Matrix<Float64>>,Ring<Matrix<Float64>>,Structure<Matrix<Float64>>,VectorSpace<Matrix<Float64>,Float64>
public final class Float64Matrix extends Matrix<Float64>
This class represents an optimized
matriximplementation for64 bits floating-pointnumbers.Instances of this class can be created from
Float64Vector, either as rows or columns if the matrix is transposed. For example:[code] Float64Vectorcolumn0 = Float64Vector.valueOf(...); Float64Vector column1 = Float64Vector.valueOf(...); Float64Matrix M = Float64Matrix.valueOf(column0, column1).transpose(); [/code] - Version:
- 3.3, January 2, 2007
- Author:
- Jean-Marie Dautelle
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Float64Matrixadjoint()Returns the adjoint of this matrix.Float64cofactor(int i, int j)Returns the cofactor of an element in this matrix.Float64Matrixcopy()Returns a copy of this matrixallocatedby the calling thread (possibly on the stack).Float64determinant()Returns the determinant of this matrix.Float64get(int i, int j)Returns a single element from this matrix.Float64VectorgetColumn(int j)Returns the column identified by the specified index in this matrix.Float64VectorgetDiagonal()Returns the diagonal vector.intgetNumberOfColumns()Returns the number of columnsnfor this matrix.intgetNumberOfRows()Returns the number of rowsmfor this matrix.Float64VectorgetRow(int i)Returns the row identified by the specified index in this matrix.Float64Matrixinverse()Returns the inverse of this matrix (must be square).Float64Matrixminus(Matrix<Float64> that)Returns the difference between this matrix and the one specified.Float64Matrixopposite()Returns the negation of this matrix.Float64Matrixplus(Matrix<Float64> that)Returns the sum of this matrix with the one specified.Float64Matrixtensor(Matrix<Float64> that)Returns the linear algebraic matrix tensor product of this matrix and another (Kronecker product).Float64Matrixtimes(Float64 k)Returns the product of this matrix by the specified factor.Float64Matrixtimes(Matrix<Float64> that)Returns the product of this matrix with the one specified.Float64Vectortimes(Vector<Float64> v)Returns the product of this matrix by the specified vector.Float64Matrixtranspose()Returns the transpose of this matrix.static Float64MatrixvalueOf(double[][] values)Returns a dense matrix from a 2-dimensional array ofdoublevalues.static Float64MatrixvalueOf(java.util.List<Float64Vector> rows)Returns a complex matrix holding the row vectors from the specified collection (column vectors iftransposed).static Float64MatrixvalueOf(Float64Vector... rows)Returns a complex matrix holding the specified row vectors (column vectors iftransposed).static Float64MatrixvalueOf(Matrix<Float64> that)Returns a complex matrix equivalent to the specified matrix.Float64Vectorvectorization()Returns the vectorization of this matrix.
-
-
-
Method Detail
-
valueOf
public static Float64Matrix valueOf(double[][] values)
Returns a dense matrix from a 2-dimensional array ofdoublevalues. The first dimension being the row and the second being the column.- Parameters:
values- the array ofdoublevalues.- Returns:
- the matrix having the specified elements.
- Throws:
DimensionException- if rows have different length.- See Also:
Float64Vector
-
valueOf
public static Float64Matrix valueOf(Float64Vector... rows)
Returns a complex matrix holding the specified row vectors (column vectors iftransposed).- Parameters:
rows- the row vectors.- Returns:
- the matrix having the specified rows.
- Throws:
DimensionException- if the rows do not have the same dimension.
-
valueOf
public static Float64Matrix valueOf(java.util.List<Float64Vector> rows)
Returns a complex matrix holding the row vectors from the specified collection (column vectors iftransposed).- Parameters:
rows- the list of row vectors.- Returns:
- the matrix having the specified rows.
- Throws:
DimensionException- if the rows do not have the same dimension.
-
valueOf
public static Float64Matrix valueOf(Matrix<Float64> that)
Returns a complex matrix equivalent to the specified matrix.- Parameters:
that- the matrix to convert.- Returns:
thator a complex matrix holding the same elements as the specified matrix.
-
getNumberOfRows
public int getNumberOfRows()
Description copied from class:MatrixReturns the number of rowsmfor this matrix.- Specified by:
getNumberOfRowsin classMatrix<Float64>- Returns:
- m, the number of rows.
-
getNumberOfColumns
public int getNumberOfColumns()
Description copied from class:MatrixReturns the number of columnsnfor this matrix.- Specified by:
getNumberOfColumnsin classMatrix<Float64>- Returns:
- n, the number of columns.
-
get
public Float64 get(int i, int j)
Description copied from class:MatrixReturns a single element from this matrix.
-
getRow
public Float64Vector getRow(int i)
Description copied from class:MatrixReturns the row identified by the specified index in this matrix.
-
getColumn
public Float64Vector getColumn(int j)
Description copied from class:MatrixReturns the column identified by the specified index in this matrix.
-
getDiagonal
public Float64Vector getDiagonal()
Description copied from class:MatrixReturns the diagonal vector.- Specified by:
getDiagonalin classMatrix<Float64>- Returns:
- the vector holding the diagonal elements.
-
opposite
public Float64Matrix opposite()
Description copied from class:MatrixReturns the negation of this matrix.
-
plus
public Float64Matrix plus(Matrix<Float64> that)
Description copied from class:MatrixReturns the sum of this matrix with the one specified.
-
minus
public Float64Matrix minus(Matrix<Float64> that)
Description copied from class:MatrixReturns the difference between this matrix and the one specified.
-
times
public Float64Matrix times(Float64 k)
Description copied from class:MatrixReturns the product of this matrix by the specified factor.
-
times
public Float64Vector times(Vector<Float64> v)
Description copied from class:MatrixReturns the product of this matrix by the specified vector.
-
times
public Float64Matrix times(Matrix<Float64> that)
Description copied from class:MatrixReturns the product of this matrix with the one specified.
-
inverse
public Float64Matrix inverse()
Description copied from class:MatrixReturns the inverse of this matrix (must be square).
-
determinant
public Float64 determinant()
Description copied from class:MatrixReturns the determinant of this matrix.- Specified by:
determinantin classMatrix<Float64>- Returns:
- this matrix determinant.
-
transpose
public Float64Matrix transpose()
Description copied from class:MatrixReturns the transpose of this matrix.
-
cofactor
public Float64 cofactor(int i, int j)
Description copied from class:MatrixReturns the cofactor of an element in this matrix. It is the value obtained by evaluating the determinant formed by the elements not in that particular row or column.
-
adjoint
public Float64Matrix adjoint()
Description copied from class:MatrixReturns the adjoint of this matrix. It is obtained by replacing each element in this matrix with its cofactor and applying a + or - sign according (-1)**(i+j), and then finding the transpose of the resulting matrix.
-
tensor
public Float64Matrix tensor(Matrix<Float64> that)
Description copied from class:MatrixReturns the linear algebraic matrix tensor product of this matrix and another (Kronecker product). The default implementation returns aDenseMatrix.- Specified by:
tensorin classMatrix<Float64>- Parameters:
that- the second matrix.- Returns:
this ⊗ that- See Also:
- Wikipedia: Kronecker Product
-
vectorization
public Float64Vector vectorization()
Description copied from class:MatrixReturns the vectorization of this matrix. The vectorization of a matrix is the column vector obtain by stacking the columns of the matrix on top of one another. The default implementation returns aDenseVector.- Specified by:
vectorizationin classMatrix<Float64>- Returns:
- the vectorization of this matrix.
- See Also:
- Wikipedia: Vectorization.
-
copy
public Float64Matrix copy()
Description copied from class:MatrixReturns a copy of this matrixallocatedby the calling thread (possibly on the stack).
-
-