Documentation of 'jsat.linear.TransposeView' Java class
TransposeView
jsat.linear

Class TransposeView

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable


    public class TransposeView
    extends GenericMatrix
    This class provides a free view of the transpose of a matrix. This is done by accessing the matrix elements in swapped order. This has a serious performance impact. If the base matrix storage is row major order, then accessing the TransposeView in column major order will provide the best performance.
    See Also:
    Serialized Form
    • Constructor Detail

      • TransposeView

        public TransposeView(Matrix base)
    • Method Detail

      • getColumnView

        public Vec getColumnView(int j)
        Description copied from class: Matrix
        Obtains a vector that is backed by this, at very little memory cost. Mutations to this vector will alter the values stored in the matrix, and vice versa.
        Overrides:
        getColumnView in class Matrix
        Parameters:
        j - the column to obtain a view of
        Returns:
        a vector backed by the specified row of the matrix
      • getRowView

        public Vec getRowView(int r)
        Description copied from class: Matrix
        Obtains a vector that is backed by this, at very little memory cost. Mutations to this vector will alter the values stored in the matrix, and vice versa.
        Overrides:
        getRowView in class Matrix
        Parameters:
        r - the row to obtain a view of
        Returns:
        a vector backed by the specified row of the matrix
      • get

        public double get(int i,
                          int j)
        Description copied from class: Matrix
        Returns the value stored at at the matrix position Ai,j
        Specified by:
        get in class Matrix
        Parameters:
        i - the row, starting from 0
        j - the column, starting from 0
        Returns:
        the value at Ai,j
      • set

        public void set(int i,
                        int j,
                        double value)
        Description copied from class: Matrix
        Sets the value stored at at the matrix position Ai,j
        Specified by:
        set in class Matrix
        Parameters:
        i - the row, starting from 0
        j - the column, starting from 0
        value - the value to place at Ai,j
      • rows

        public int rows()
        Description copied from class: Matrix
        Returns the number of rows stored in this matrix
        Specified by:
        rows in class Matrix
        Returns:
        the number of rows stored in this matrix
      • cols

        public int cols()
        Description copied from class: Matrix
        Returns the number of columns stored in this matrix
        Specified by:
        cols in class Matrix
        Returns:
        the number of columns stored in this matrix
      • isSparce

        public boolean isSparce()
        Description copied from class: Matrix
        Returns true if the matrix is sparse, false otherwise
        Specified by:
        isSparce in class Matrix
        Returns:
        true if the matrix is sparse, false otherwise
      • changeSize

        public void changeSize(int newRows,
                               int newCols)
        Description copied from class: Matrix
        This method alters the size of a matrix, either adding or subtracting rows from the internal structure of the matrix. Every resize call may cause a new allocation internally, and should not be called for excessive changing of a matrix. All added rows/ columns will have values of zero. If a row / column is removed, it is always the bottom/right most row / column removed. Values of the removed rows / columns will be lost.
        Specified by:
        changeSize in class Matrix
        Parameters:
        newRows - the new number of rows, must be positive
        newCols - the new number of columns, must be positive.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.