public class MatrixUtil extends Object
Constructor and Description |
---|
MatrixUtil() |
Modifier and Type | Method and Description |
---|---|
static DenseMatrix |
asDense(SparseMatrix m,
int acsMode) |
static Matrix |
copy(Matrix matrix)
Create the copy of matrix with read-only matrices support.
|
static Matrix |
elementWiseMinus(Matrix mtx1,
Matrix mtx2)
Performs in-place matrix subtraction.
|
static Matrix |
elementWiseTimes(Matrix mtx1,
Matrix mtx2)
Performs in-place matrix multiplication.
|
static double[] |
flatten(double[][] arr,
int stoMode) |
static DenseMatrix |
fromList(List<Vector> vecs,
boolean entriesAreRows) |
static Matrix |
identityLike(Matrix matrix,
int n)
Create the identity matrix like a given matrix.
|
static Matrix |
like(Matrix matrix)
Create the like matrix with read-only matrices support.
|
static Matrix |
like(Matrix matrix,
int rows,
int cols)
Create the like matrix with specified size with read-only matrices support.
|
static Vector |
likeVector(Matrix matrix)
Create the like vector with read-only matrices support.
|
static Vector |
likeVector(Matrix matrix,
int crd)
Create the like vector with read-only matrices support.
|
static DenseVector |
localCopyOf(Vector vec)
TODO: IGNITE-5723, rewrite in a more optimal way.
|
static double[][] |
unflatten(double[] fArr,
int colsCnt,
int stoMode) |
static void |
unflatten(double[] fArr,
Matrix mtx) |
static Vector |
zipFoldByColumns(Matrix mtx1,
Matrix mtx2,
IgniteBiFunction<Vector,Vector,Double> fun)
Zips two matrices by column-by-column with specified function.
|
static Vector |
zipFoldByRows(Matrix mtx1,
Matrix mtx2,
IgniteBiFunction<Vector,Vector,Double> fun)
Zips two matrices by row-by-row with specified function.
|
static Vector |
zipWith(Vector v1,
Vector v2,
IgniteTriFunction<Double,Double,Integer,Double> f)
Zip two vectors with given tri-function taking as third argument position in vector
(i.e. apply binary function to both vector elementwise and construct vector from results).
|
public static Matrix like(Matrix matrix)
matrix
- Matrix for like.public static Matrix identityLike(Matrix matrix, int n)
matrix
- Matrix for like.public static Matrix like(Matrix matrix, int rows, int cols)
matrix
- Matrix for like.public static Vector likeVector(Matrix matrix, int crd)
matrix
- Matrix for like.crd
- Cardinality of the vector.public static Vector likeVector(Matrix matrix)
matrix
- Matrix for like.public static Matrix copy(Matrix matrix)
matrix
- Matrix for copy.public static DenseMatrix asDense(SparseMatrix m, int acsMode)
public static DenseMatrix fromList(List<Vector> vecs, boolean entriesAreRows)
public static DenseVector localCopyOf(Vector vec)
public static double[][] unflatten(double[] fArr, int colsCnt, int stoMode)
public static void unflatten(double[] fArr, Matrix mtx)
public static Vector zipWith(Vector v1, Vector v2, IgniteTriFunction<Double,Double,Integer,Double> f)
v1
- First vector.v2
- Second vector.f
- Function to zip with.public static Vector zipFoldByColumns(Matrix mtx1, Matrix mtx2, IgniteBiFunction<Vector,Vector,Double> fun)
mtx1
- First matrix.mtx2
- Second matrix.fun
- Function to zip with.public static Vector zipFoldByRows(Matrix mtx1, Matrix mtx2, IgniteBiFunction<Vector,Vector,Double> fun)
mtx1
- First matrix.mtx2
- Second matrix.fun
- Function to zip with.public static double[] flatten(double[][] arr, int stoMode)
public static Matrix elementWiseMinus(Matrix mtx1, Matrix mtx2)
mtx1
- Operand to be changed and subtracted from.mtx2
- Operand to subtract.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019