Class RealMatrix

    • Constructor Detail

      • RealMatrix

        public RealMatrix​(int nRows,
                          int nCols)
        Construct a Real matrix.
        Parameters:
        nRows - the number of rows
        nCols - the number of columns
      • RealMatrix

        public RealMatrix​(Real[][] data)
        Construct a Real matrix.
        Parameters:
        data - a matrix data of Real numbers in a 2D array
      • RealMatrix

        public RealMatrix​(double[][] data)
        Construct a Real matrix.
        Parameters:
        data - a matrix data of doubles in a 2D array
    • Method Detail

      • nRows

        public int nRows()
        Description copied from interface: Table
        Gets the number of rows. Rows count from 1.
        Specified by:
        nRows in interface Table
        Returns:
        the number of rows
      • nCols

        public int nCols()
        Description copied from interface: Table
        Gets the number of columns. Columns count from 1.
        Specified by:
        nCols in interface Table
        Returns:
        the number of columns
      • set

        public void set​(int row,
                        int col,
                        Real value)
        Description copied from interface: GenericMatrixAccess
        Set the matrix entry at [i,j] to a value. This is the only method that may change a matrix.
        Specified by:
        set in interface GenericMatrixAccess<Real>
        Parameters:
        row - the row index
        col - the column index
        value - the value to set A[i,j] to
      • get

        public Real get​(int row,
                        int col)
        Description copied from interface: GenericMatrixAccess
        Get the matrix entry at [i,j].
        Specified by:
        get in interface GenericMatrixAccess<Real>
        Parameters:
        row - the row index
        col - the column index
        Returns:
        A[i,j]
      • minus

        public RealMatrix minus​(RealMatrix that)
        Description copied from interface: AbelianGroup
        - : G × G → G

        The operation "-" is not in the definition of of an additive group but can be deduced. This function is provided for convenience purpose. It is equivalent to

        this.add(that.opposite())
        .
        Specified by:
        minus in interface AbelianGroup<RealMatrix>
        Parameters:
        that - the object to be subtracted (subtrahend)
        Returns:
        this - that
      • ZERO

        public RealMatrix ZERO()
        Description copied from interface: AbelianGroup
        The additive element 0 in the group, such that for all elements a in the group, the equation 0 + a = a + 0 = a holds.
        Specified by:
        ZERO in interface AbelianGroup<RealMatrix>
        Returns:
        0, the additive identity
      • ONE

        public RealMatrix ONE()
        Description copied from interface: Monoid
        The multiplicative element 1 in the group such that for any elements a in the group, the equation 1 × a = a × 1 = a holds.
        Specified by:
        ONE in interface Monoid<RealMatrix>
        Returns:
        1
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object