Documentation of 'smile.math.matrix.DenseMatrix' Java class
DenseMatrix
smile.math.matrix

Class DenseMatrix

    • Constructor Detail

      • DenseMatrix

        public DenseMatrix()
    • Method Detail

      • data

        public abstract double[] data()
        Returns the array of storing the matrix.
      • ld

        public abstract int ld()
        The LDA (and LDB, LDC, etc.) parameter in BLAS is effectively the stride of the matrix as it is laid out in linear memory. It is perfectly valid to have an LDA value which is larger than the leading dimension of the matrix which is being operated on. Typical cases where it is either useful or necessary to use a larger LDA value are when you are operating on a sub matrix from a larger dense matrix, and when hardware or algorithms offer performance advantages when storage is padded to round multiples of some optimal size (cache lines or GPU memory transaction size, or load balance in multiprocessor implementations, for example).
        Returns:
        the leading dimension
      • set

        public abstract double set(int i,
                                   int j,
                                   double x)
        Set the entry value at row i and column j.
      • update

        public double update(int i,
                             int j,
                             double x)
        Set the entry value at row i and column j. For Scala users.
      • lu

        public abstract LU lu()
        Returns the LU decomposition. This input matrix will be overwritten with the decomposition.
      • lu

        public LU lu(boolean inPlace)
        Returns the LU decomposition.
        Parameters:
        inPlace - if true, this matrix will be used for matrix decomposition.
      • cholesky

        public abstract Cholesky cholesky()
        Returns the Cholesky decomposition. This input matrix will be overwritten with the decomposition.
        Throws:
        java.lang.IllegalArgumentException - if the matrix is not positive definite.
      • cholesky

        public Cholesky cholesky(boolean inPlace)
        Returns the Cholesky decomposition.
        Parameters:
        inPlace - if true, this matrix will be used for matrix decomposition.
        Throws:
        java.lang.IllegalArgumentException - if the matrix is not positive definite.
      • qr

        public abstract QR qr()
        Returns the QR decomposition. This input matrix will be overwritten with the decomposition.
      • qr

        public QR qr(boolean inPlace)
        Returns the QR decomposition.
        Parameters:
        inPlace - if true, this matrix will be used for matrix decomposition.
      • svd

        public abstract SVD svd()
        Returns the singular value decomposition. Note that the input matrix will hold U on output.
      • svd

        public SVD svd(boolean inPlace)
        Returns the singular value decomposition.
        Parameters:
        inPlace - if true, this matrix will hold U on output.
      • eigen

        public abstract EVD eigen()
        Returns the eigen value decomposition. Note that the input matrix will be overwritten on output.
      • eigen

        public EVD eigen(boolean inPlace)
        Returns the eigen value decomposition.
        Parameters:
        inPlace - if true, this matrix will be overwritten U on output.
      • eig

        public abstract double[] eig()
        Returns the eigen values in an array of size 2N. The first half and second half of returned array contain the real and imaginary parts, respectively, of the computed eigenvalues.
      • eig

        public double[] eig(boolean inPlace)
        Returns the eigen values in an array of size 2N. The first half and second half of returned array contain the real and imaginary parts, respectively, of the computed eigenvalues.
        Parameters:
        inPlace - if true, this matrix will be overwritten U on output.
      • inverse

        public DenseMatrix inverse()
        Returns the inverse matrix.
      • inverse

        public DenseMatrix inverse(boolean inPlace)
        Returns the inverse matrix.
        Parameters:
        inPlace - if true, this matrix will be used for matrix decomposition.
      • norm1

        public double norm1()
        L1 matrix norm. Maximum column sum.
      • norm2

        public double norm2()
        L2 matrix norm. Maximum singular value.
      • norm

        public double norm()
        L2 matrix norm. Maximum singular value.
      • normInf

        public double normInf()
        Infinity matrix norm. Maximum row sum.
      • normFro

        public double normFro()
        Frobenius matrix norm. Sqrt of sum of squares of all elements.
      • xax

        public double xax(double[] x)
        Returns x' * A * x. The left upper submatrix of A is used in the computation based on the size of x.
      • rowSums

        public double[] rowSums()
        Returns the sum of each row for a matrix.
      • rowMeans

        public double[] rowMeans()
        Returns the mean of each row for a matrix.
      • colSums

        public double[] colSums()
        Returns the sum of each column for a matrix.
      • colMeans

        public double[] colMeans()
        Returns the mean of each column for a matrix.
      • copy

        public abstract DenseMatrix copy()
        Returns a copy of this matrix.
      • ata

        public abstract DenseMatrix ata()
        Description copied from class: Matrix
        Returns A' * A
        Specified by:
        ata in class Matrix
      • aat

        public abstract DenseMatrix aat()
        Description copied from class: Matrix
        Returns A * A'
        Specified by:
        aat in class Matrix
      • add

        public abstract double add(int i,
                                   int j,
                                   double x)
        A[i][j] += x
      • sub

        public abstract double sub(int i,
                                   int j,
                                   double x)
        A[i][j] -= x
      • mul

        public abstract double mul(int i,
                                   int j,
                                   double x)
        A[i][j] *= x
      • div

        public abstract double div(int i,
                                   int j,
                                   double x)
        A[i][j] /= x
      • mul

        public DenseMatrix mul(DenseMatrix b)
        In place element-wise multiplication A = A * B
        Returns:
        this matrix
      • div

        public DenseMatrix div(DenseMatrix b)
        In place element-wise division A = A / B A = A - B
        Returns:
        this matrix
      • add

        public DenseMatrix add(double x)
        In place element-wise addition A = A + x
      • sub

        public DenseMatrix sub(double x)
        In place element-wise subtraction A = A - x
      • mul

        public DenseMatrix mul(double x)
        In place element-wise multiplication A = A * x
      • div

        public DenseMatrix div(double x)
        In place element-wise division A = A / x
      • replaceNaN

        public DenseMatrix replaceNaN(double x)
        Replaces NaN's with given value.
      • sum

        public double sum()
        Returns the sum of all elements in the matrix.
        Returns:
        the sum of all elements.
      • array

        public double[][] array()
        Return the two-dimensional array of matrix.
        Returns:
        the two-dimensional array of matrix.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.