Modifier and Type | Method and Description |
---|---|
static <T extends DoubleVector> |
asMatrix(List<T> vectors)
Returns a
Matrix from a list of DoubleVector s. |
static <T extends SparseDoubleVector> |
asSparseMatrix(List<T> vectors)
Returns a
SparseMatrix from a list of SparseDoubleVector s. |
static <T extends SparseDoubleVector> |
asSparseMatrix(List<T> vectors,
int columns)
Returns a
SparseMatrix from a list of SparseDoubleVector s. |
static Matrix |
copy(Matrix matrix)
Returns a copied version of a given matrix.
|
static Matrix |
copyTo(Matrix matrix,
Matrix output)
Copies values from
matrix to output and returns output . |
static Matrix |
create(int rows,
int cols,
boolean isDense)
Creates a matrix of the given dimensions and selects the matrix
implementation by considering the size and density of the new matrix with
respect to the available memory for the JVM.
|
static Matrix |
create(int rows,
int cols,
Matrix.Type matrixType)
Creates a new
Matrix based on the provided type, with the
provided dimensions |
static MatrixBuilder |
getMatrixBuilderForSVD()
Returns a
MatrixBuilder in the default format of the fastest
available SVD algorithm . |
static MatrixBuilder |
getMatrixBuilderForSVD(boolean transpose)
Deprecated.
|
static Matrix |
multiply(Matrix m1,
Matrix m2) |
static Matrix |
resize(Matrix matrix,
int rows,
int columns)
Returns a new
Matrix that has been resized from the original,
truncating values if smaller, or adding zero elements if larger. |
static AtomicMatrix |
synchronizedMatrix(Matrix m)
Returns a synchronized (thread-safe) matrix backed by the provided
Matrix . |
static AtomicMatrix |
synchronizedSparseMatrix(SparseMatrix m)
Returns a synchronized (thread-safe) matrix backed by the provided
SparseMatrix . |
static Matrix |
transpose(Matrix matrix)
Returns the transpose of the input matrix, i.e.
|
public static <T extends DoubleVector> Matrix asMatrix(List<T> vectors)
Matrix
from a list of DoubleVector
s. The
resulting matrix will be modifiable. Any modifications will affect the
vectors stored in the passed in list.public static <T extends SparseDoubleVector> SparseMatrix asSparseMatrix(List<T> vectors)
SparseMatrix
from a list of SparseDoubleVector
s. The resulting matrix will be modifiable. Any
modifications will affect the vectors stored in the passed in list.public static <T extends SparseDoubleVector> SparseMatrix asSparseMatrix(List<T> vectors, int columns)
SparseMatrix
from a list of SparseDoubleVector
s. The resulting matrix will be modifiable. Any
modifications will affect the vectors stored in the passed in list.public static Matrix create(int rows, int cols, boolean isDense)
rows
- the number of rows in the matrixcols
- the number of columns in the matrixisDense
- whether the returned matrix will contain mostly non-zero
elementspublic static Matrix copy(Matrix matrix)
matrix
- the matrix to be copiedIllegalArgumentException
- when the dimensionality of matrix and
output do not matchpublic static Matrix copyTo(Matrix matrix, Matrix output)
matrix
to output
and returns output
. output
is assumed to be empty. This method is useful
for uses who wish to specify the type of matrix used during a copy
operation.matrix
- the matrix to be copiedoutput
- the matrix storing the copied values.output
IllegalArgumentException
- when the dimensionality of matrix and
output do not matchpublic static Matrix create(int rows, int cols, Matrix.Type matrixType)
Matrix
based on the provided type, with the
provided dimensionsmatrixType
- the type of matrix to createrows
- the number of rows in the matrixcols
- the number of columns in the matrixpublic static MatrixBuilder getMatrixBuilderForSVD()
MatrixBuilder
in the default format of the fastest
available SVD algorithm
.SVD
class@Deprecated public static MatrixBuilder getMatrixBuilderForSVD(boolean transpose)
MatrixBuilder
in the default format of the fastest
available SVD algorithm
that will optionally
transpose the matrix data on inputtranspose
- true
if the input columns to the MatrixBuilder
should be transposed (i.e. become rows) in the
final matrixSVD
classpublic static Matrix resize(Matrix matrix, int rows, int columns)
Matrix
that has been resized from the original,
truncating values if smaller, or adding zero elements if larger.public static AtomicMatrix synchronizedMatrix(Matrix m)
Matrix
.m
- the matrix to be made thread-safepublic static AtomicMatrix synchronizedSparseMatrix(SparseMatrix m)
SparseMatrix
.m
- the matrix to be made thread-safeSparseMatrix
Copyright © 2012. All Rights Reserved.