Creates a column-major dense matrix.
Creates a column-major dense matrix.
number of rows
number of columns
matrix entries in column major
Generate a diagonal matrix in Matrix
format from the supplied values.
Generate a diagonal matrix in Matrix
format from the supplied values.
a Vector
that will form the values on the diagonal of the matrix
Square Matrix
with size values.length
x values.length
and values
on the diagonal
Generate a dense Identity Matrix in Matrix
format.
Generate a dense Identity Matrix in Matrix
format.
number of rows and columns of the matrix
Matrix
with size n
x n
and values of ones on the diagonal
Horizontally concatenate a sequence of matrices.
Horizontally concatenate a sequence of matrices. The returned matrix will be in the format
the matrices are supplied in. Supplying a mix of dense and sparse matrices will result in
a sparse matrix. If the Array is empty, an empty DenseMatrix
will be returned.
array of matrices
a single Matrix
composed of the matrices that were horizontally concatenated
Generate a DenseMatrix
consisting of ones.
Generate a DenseMatrix
consisting of ones.
number of rows of the matrix
number of columns of the matrix
Matrix
with size numRows
x numCols
and values of ones
Generate a DenseMatrix
consisting of i.i.d.
uniform random numbers.
Generate a DenseMatrix
consisting of i.i.d.
uniform random numbers.
number of rows of the matrix
number of columns of the matrix
a random number generator
Matrix
with size numRows
x numCols
and values in U(0, 1)
Generate a DenseMatrix
consisting of i.i.d.
gaussian random numbers.
Generate a DenseMatrix
consisting of i.i.d.
gaussian random numbers.
number of rows of the matrix
number of columns of the matrix
a random number generator
Matrix
with size numRows
x numCols
and values in N(0, 1)
Creates a column-major sparse matrix in Compressed Sparse Column (CSC) format.
Creates a column-major sparse matrix in Compressed Sparse Column (CSC) format.
number of rows
number of columns
the index corresponding to the start of a new column
the row index of the entry
non-zero matrix entries in column major
Generate a sparse Identity Matrix in Matrix
format.
Generate a sparse Identity Matrix in Matrix
format.
number of rows and columns of the matrix
Matrix
with size n
x n
and values of ones on the diagonal
Generate a SparseMatrix
consisting of i.i.d.
gaussian random numbers.
Generate a SparseMatrix
consisting of i.i.d.
gaussian random numbers.
number of rows of the matrix
number of columns of the matrix
the desired density for the matrix
a random number generator
Matrix
with size numRows
x numCols
and values in U(0, 1)
Generate a SparseMatrix
consisting of i.i.d.
gaussian random numbers.
Generate a SparseMatrix
consisting of i.i.d.
gaussian random numbers.
number of rows of the matrix
number of columns of the matrix
the desired density for the matrix
a random number generator
Matrix
with size numRows
x numCols
and values in N(0, 1)
Vertically concatenate a sequence of matrices.
Vertically concatenate a sequence of matrices. The returned matrix will be in the format
the matrices are supplied in. Supplying a mix of dense and sparse matrices will result in
a sparse matrix. If the Array is empty, an empty DenseMatrix
will be returned.
array of matrices
a single Matrix
composed of the matrices that were vertically concatenated
Generate a Matrix
consisting of zeros.
Generate a Matrix
consisting of zeros.
number of rows of the matrix
number of columns of the matrix
Matrix
with size numRows
x numCols
and values of zeros
Factory methods for org.apache.spark.ml.linalg.Matrix.