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 matrix implementation for 64 bits floating-point numbers.

Instances of this class can be created from Float64Vector, either as rows or columns if the matrix is transposed. For example:[code] Float64Vector column0 = Float64Vector.valueOf(...); Float64Vector column1 = Float64Vector.valueOf(...); Float64Matrix M = Float64Matrix.valueOf(column0, column1).transpose(); [/code]

  • Method Details

    • valueOf

      public static Float64Matrix valueOf(double[][] values)
      Returns a dense matrix from a 2-dimensional array of double values. The first dimension being the row and the second being the column.
      Parameters:
      values - the array of double values.
      Returns:
      the matrix having the specified elements.
      Throws:
      DimensionException - if rows have different length.
      See Also:
    • valueOf

      public static Float64Matrix valueOf(Float64Vector... rows)
      Returns a complex matrix holding the specified row vectors (column vectors if transposed).
      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(List<Float64Vector> rows)
      Returns a complex matrix holding the row vectors from the specified collection (column vectors if transposed).
      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:
      that or a complex matrix holding the same elements as the specified matrix.
    • getNumberOfRows

      public int getNumberOfRows()
      Description copied from class: Matrix
      Returns the number of rows m for this matrix.
      Specified by:
      getNumberOfRows in class Matrix<Float64>
      Returns:
      m, the number of rows.
    • getNumberOfColumns

      public int getNumberOfColumns()
      Description copied from class: Matrix
      Returns the number of columns n for this matrix.
      Specified by:
      getNumberOfColumns in class Matrix<Float64>
      Returns:
      n, the number of columns.
    • get

      public Float64 get(int i, int j)
      Description copied from class: Matrix
      Returns a single element from this matrix.
      Specified by:
      get in class Matrix<Float64>
      Parameters:
      i - the row index (range [0..m[).
      j - the column index (range [0..n[).
      Returns:
      the element read at [i,j].
    • getRow

      public Float64Vector getRow(int i)
      Description copied from class: Matrix
      Returns the row identified by the specified index in this matrix.
      Specified by:
      getRow in class Matrix<Float64>
      Parameters:
      i - the row index (range [0..m[).
      Returns:
      the vector holding the specified row.
    • getColumn

      public Float64Vector getColumn(int j)
      Description copied from class: Matrix
      Returns the column identified by the specified index in this matrix.
      Specified by:
      getColumn in class Matrix<Float64>
      Parameters:
      j - the column index (range [0..n[).
      Returns:
      the vector holding the specified column.
    • getDiagonal

      public Float64Vector getDiagonal()
      Description copied from class: Matrix
      Returns the diagonal vector.
      Specified by:
      getDiagonal in class Matrix<Float64>
      Returns:
      the vector holding the diagonal elements.
    • opposite

      public Float64Matrix opposite()
      Description copied from class: Matrix
      Returns the negation of this matrix.
      Specified by:
      opposite in interface GroupAdditive<Matrix<Float64>>
      Specified by:
      opposite in class Matrix<Float64>
      Returns:
      -this.
    • plus

      public Float64Matrix plus(Matrix<Float64> that)
      Description copied from class: Matrix
      Returns the sum of this matrix with the one specified.
      Specified by:
      plus in interface GroupAdditive<Matrix<Float64>>
      Specified by:
      plus in class Matrix<Float64>
      Parameters:
      that - the matrix to be added.
      Returns:
      this + that.
    • minus

      public Float64Matrix minus(Matrix<Float64> that)
      Description copied from class: Matrix
      Returns the difference between this matrix and the one specified.
      Overrides:
      minus in class Matrix<Float64>
      Parameters:
      that - the matrix to be subtracted.
      Returns:
      this - that.
    • times

      public Float64Matrix times(Float64 k)
      Description copied from class: Matrix
      Returns the product of this matrix by the specified factor.
      Specified by:
      times in interface VectorSpace<Matrix<Float64>,Float64>
      Specified by:
      times in class Matrix<Float64>
      Parameters:
      k - the coefficient multiplier.
      Returns:
      this · k
    • times

      public Float64Vector times(Vector<Float64> v)
      Description copied from class: Matrix
      Returns the product of this matrix by the specified vector.
      Specified by:
      times in class Matrix<Float64>
      Parameters:
      v - the vector.
      Returns:
      this · v
    • times

      public Float64Matrix times(Matrix<Float64> that)
      Description copied from class: Matrix
      Returns the product of this matrix with the one specified.
      Specified by:
      times in interface Ring<Matrix<Float64>>
      Specified by:
      times in class Matrix<Float64>
      Parameters:
      that - the matrix multiplier.
      Returns:
      this · that.
    • inverse

      public Float64Matrix inverse()
      Description copied from class: Matrix
      Returns the inverse of this matrix (must be square).
      Specified by:
      inverse in class Matrix<Float64>
      Returns:
      1 / this
    • determinant

      public Float64 determinant()
      Description copied from class: Matrix
      Returns the determinant of this matrix.
      Specified by:
      determinant in class Matrix<Float64>
      Returns:
      this matrix determinant.
    • transpose

      public Float64Matrix transpose()
      Description copied from class: Matrix
      Returns the transpose of this matrix.
      Specified by:
      transpose in class Matrix<Float64>
      Returns:
      A'.
    • cofactor

      public Float64 cofactor(int i, int j)
      Description copied from class: Matrix
      Returns 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.
      Specified by:
      cofactor in class Matrix<Float64>
      Parameters:
      i - the row index.
      j - the column index.
      Returns:
      the cofactor of THIS[i,j].
    • adjoint

      public Float64Matrix adjoint()
      Description copied from class: Matrix
      Returns 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.
      Specified by:
      adjoint in class Matrix<Float64>
      Returns:
      the adjoint of this matrix.
    • tensor

      public Float64Matrix tensor(Matrix<Float64> that)
      Description copied from class: Matrix
      Returns the linear algebraic matrix tensor product of this matrix and another (Kronecker product). The default implementation returns a DenseMatrix.
      Specified by:
      tensor in class Matrix<Float64>
      Parameters:
      that - the second matrix.
      Returns:
      this ⊗ that
      See Also:
    • vectorization

      public Float64Vector vectorization()
      Description copied from class: Matrix
      Returns 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 a DenseVector.
      Specified by:
      vectorization in class Matrix<Float64>
      Returns:
      the vectorization of this matrix.
      See Also:
    • copy

      public Float64Matrix copy()
      Description copied from class: Matrix
      Returns a copy of this matrix allocated by the calling thread (possibly on the stack).
      Specified by:
      copy in interface javolution.lang.ValueType
      Specified by:
      copy in class Matrix<Float64>
      Returns:
      an identical and independant copy of this matrix.