Class AbstractRealMatrix

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractRealMatrix()
      Creates a matrix with no data
      protected AbstractRealMatrix​(int rowDimension, int columnDimension)
      Create a new RealMatrix with the supplied row and column dimensions.
    • Method Summary

      Modifier and Type Method Description
      RealMatrix add​(RealMatrix m)
      Returns the sum of this and m.
      void addToEntry​(int row, int column, double increment)
      Adds (in place) the specified value to the specified entry of this matrix.
      abstract RealMatrix copy()
      Returns a (deep) copy of this.
      void copySubMatrix​(int[] selectedRows, int[] selectedColumns, double[][] destination)
      Copy a submatrix.
      void copySubMatrix​(int startRow, int endRow, int startColumn, int endColumn, double[][] destination)
      Copy a submatrix.
      abstract RealMatrix createMatrix​(int rowDimension, int columnDimension)
      Create a new RealMatrix of the same type as the instance with the supplied row and column dimensions.
      boolean equals​(java.lang.Object object)
      Returns true iff object is a RealMatrix instance with the same dimensions as this and all corresponding matrix entries are equal.
      double[] getColumn​(int column)
      Get the entries at the given column index as an array.
      abstract int getColumnDimension()
      Returns the number of columns of this matrix.
      RealMatrix getColumnMatrix​(int column)
      Get the entries at the given column index as a column matrix.
      RealVector getColumnVector​(int column)
      Get the entries at the given column index as a vector.
      double[][] getData()
      Returns matrix entries as a two-dimensional array.
      abstract double getEntry​(int row, int column)
      Get the entry in the specified row and column.
      double getFrobeniusNorm()
      Returns the Frobenius norm of the matrix.
      double getNorm()
      Returns the maximum absolute row sum norm of the matrix.
      double[] getRow​(int row)
      Get the entries at the given row index.
      abstract int getRowDimension()
      Returns the number of rows of this matrix.
      RealMatrix getRowMatrix​(int row)
      Get the entries at the given row index as a row matrix.
      RealVector getRowVector​(int row)
      Returns the entries in row number row as a vector.
      RealMatrix getSubMatrix​(int[] selectedRows, int[] selectedColumns)
      Gets a submatrix.
      RealMatrix getSubMatrix​(int startRow, int endRow, int startColumn, int endColumn)
      Gets a submatrix.
      double getTrace()
      Returns the trace of the matrix (the sum of the elements on the main diagonal).
      int hashCode()
      Computes a hashcode for the matrix.
      boolean isSquare()
      Is this a square matrix?
      RealMatrix multiply​(RealMatrix m)
      Returns the result of postmultiplying this by m.
      void multiplyEntry​(int row, int column, double factor)
      Multiplies (in place) the specified entry of this matrix by the specified value.
      double[] operate​(double[] v)
      Returns the result of multiplying this by the vector v.
      RealVector operate​(RealVector v)
      Returns the result of multiplying this by the vector x.
      RealMatrix power​(int p)
      Returns the result of multiplying this with itself p times.
      double[] preMultiply​(double[] v)
      Returns the (row) vector result of premultiplying this by the vector v.
      RealMatrix preMultiply​(RealMatrix m)
      Returns the result of premultiplying this by m.
      RealVector preMultiply​(RealVector v)
      Returns the (row) vector result of premultiplying this by the vector v.
      RealMatrix scalarAdd​(double d)
      Returns the result of adding d to each entry of this.
      RealMatrix scalarMultiply​(double d)
      Returns the result of multiplying each entry of this by d.
      void setColumn​(int column, double[] array)
      Sets the specified column of this matrix to the entries of the specified array.
      void setColumnMatrix​(int column, RealMatrix matrix)
      Sets the specified column of this matrix to the entries of the specified column matrix.
      void setColumnVector​(int column, RealVector vector)
      Sets the specified column of this matrix to the entries of the specified vector.
      abstract void setEntry​(int row, int column, double value)
      Set the entry in the specified row and column.
      void setRow​(int row, double[] array)
      Sets the specified row of this matrix to the entries of the specified array.
      void setRowMatrix​(int row, RealMatrix matrix)
      Sets the specified row of this matrix to the entries of the specified row matrix.
      void setRowVector​(int row, RealVector vector)
      Sets the specified row of this matrix to the entries of the specified vector.
      void setSubMatrix​(double[][] subMatrix, int row, int column)
      Replace the submatrix starting at row, column using data in the input subMatrix array.
      RealMatrix subtract​(RealMatrix m)
      Returns this minus m.
      java.lang.String toString()
      Get a string representation for this matrix.
      RealMatrix transpose()
      Returns the transpose of this matrix.
      double walkInColumnOrder​(RealMatrixChangingVisitor visitor)
      Visit (and possibly change) all matrix entries in column order.
      double walkInColumnOrder​(RealMatrixChangingVisitor visitor, int startRow, int endRow, int startColumn, int endColumn)
      Visit (and possibly change) some matrix entries in column order.
      double walkInColumnOrder​(RealMatrixPreservingVisitor visitor)
      Visit (but don't change) all matrix entries in column order.
      double walkInColumnOrder​(RealMatrixPreservingVisitor visitor, int startRow, int endRow, int startColumn, int endColumn)
      Visit (but don't change) some matrix entries in column order.
      double walkInOptimizedOrder​(RealMatrixChangingVisitor visitor)
      Visit (and possibly change) all matrix entries using the fastest possible order.
      double walkInOptimizedOrder​(RealMatrixChangingVisitor visitor, int startRow, int endRow, int startColumn, int endColumn)
      Visit (and possibly change) some matrix entries using the fastest possible order.
      double walkInOptimizedOrder​(RealMatrixPreservingVisitor visitor)
      Visit (but don't change) all matrix entries using the fastest possible order.
      double walkInOptimizedOrder​(RealMatrixPreservingVisitor visitor, int startRow, int endRow, int startColumn, int endColumn)
      Visit (but don't change) some matrix entries using the fastest possible order.
      double walkInRowOrder​(RealMatrixChangingVisitor visitor)
      Visit (and possibly change) all matrix entries in row order.
      double walkInRowOrder​(RealMatrixChangingVisitor visitor, int startRow, int endRow, int startColumn, int endColumn)
      Visit (and possibly change) some matrix entries in row order.
      double walkInRowOrder​(RealMatrixPreservingVisitor visitor)
      Visit (but don't change) all matrix entries in row order.
      double walkInRowOrder​(RealMatrixPreservingVisitor visitor, int startRow, int endRow, int startColumn, int endColumn)
      Visit (but don't change) some matrix entries in row order.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait