Class MatrixUtils


  • public final class MatrixUtils
    extends Object
    • Method Detail

      • zeros

        public static <R extends Num,​C extends NumMatrix<R,​C> zeros​(Nat<R> rows,
                                                                                  Nat<C> cols)
        Creates a new matrix of zeros.
        Type Parameters:
        R - The number of rows in the matrix as a generic.
        C - The number of columns in the matrix as a generic.
        Parameters:
        rows - The number of rows in the matrix.
        cols - The number of columns in the matrix.
        Returns:
        An RxC matrix filled with zeros.
      • zeros

        public static <N extends NumMatrix<N,​N1> zeros​(Nat<N> nums)
        Creates a new vector of zeros.
        Type Parameters:
        N - The size of the desired vector as a generic.
        Parameters:
        nums - The size of the desired vector.
        Returns:
        A vector of size N filled with zeros.
      • eye

        public static <D extends NumMatrix<D,​D> eye​(Nat<D> dim)
        Creates the identity matrix of the given dimension.
        Type Parameters:
        D - The dimension of the desired matrix as a generic.
        Parameters:
        dim - The dimension of the desired matrix.
        Returns:
        The DxD identity matrix.
      • mat

        public static <R extends Num,​C extends NumMatBuilder<R,​C> mat​(Nat<R> rows,
                                                                                    Nat<C> cols)
        Entrypoint to the MatBuilder class for creation of custom matrices with the given dimensions and contents.
        Type Parameters:
        R - The number of rows of the desired matrix as a generic.
        C - The number of columns of the desired matrix as a generic.
        Parameters:
        rows - The number of rows of the desired matrix.
        cols - The number of columns of the desired matrix.
        Returns:
        A builder to construct the matrix.
      • vec

        public static <D extends NumVecBuilder<D> vec​(Nat<D> dim)
        Entrypoint to the VecBuilder class for creation of custom vectors with the given size and contents.
        Type Parameters:
        D - The dimension of the vector as a generic.
        Parameters:
        dim - The dimension of the vector.
        Returns:
        A builder to construct the vector.