public class Matrixx extends Object
| Constructor and Description |
|---|
Matrixx() |
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
create(AMatrix m)
Creates a mutable deep copy of a matrix
|
static Matrix |
create(double[][] data)
Creates a matrix using the given double[][] data
|
static AMatrix |
create(IMatrix m)
Creates a mutable copy of a matrix
|
static Matrix |
create(List<Object> rows)
Create a matrix from a list of rows
|
static AMatrix |
create(Object... vs)
Creates a matrix using the given objects to generate individual rows
|
static Matrix22 |
create2DRotationMatrix(double angle) |
static DiagonalMatrix |
createDiagonalMatrix(AVector diagonalValues)
Creates a diagonal matrix using the given vector of values on the main diagonal.
|
static DiagonalMatrix |
createDiagonalMatrix(double... diagonalValues)
Creates a diagonal matrix, using the given diagonal values.
|
static Matrix |
createFromVector(AVector source,
int rows,
int columns)
Creates a new matrix using the elements in the specified vector.
|
static AMatrix |
createFromVectors(INDArray... data)
Create a matrix using as array of vectors which represent the data for each row
|
static AMatrix |
createFromVectors(List<INDArray> data)
Create a matrix using a list of vectors as the data for each row
|
static AMatrix |
createIdentityMatrix(int dimensions)
Creates an identity matrix
|
static IdentityMatrix |
createImmutableIdentityMatrix(int dimensions)
Creates a sparse, immutable identity matrix.
|
static ZeroMatrix |
createImmutableZeroMatrix(int rows,
int columns)
Creates an immutable zero-filled matrix
|
AMatrix |
createInverse(AMatrix m)
Computes the inverse of a matrix.
|
static AMatrix |
createMutableIdentityMatrix(int dimensions)
Creates a fully mutable identity matrix
|
static AMatrix |
createRandomMatrix(int rows,
int columns)
Creates a mutable matrix containing random double values in the range [0.0 , 1.0)
|
static AMatrix |
createRandomMatrix(int rows,
int columns,
Random rand)
Creates a mutable matrix containing random double values in the range [0.0 , 1.0)
|
static Matrix |
createRandomSquareMatrix(int dimensions) |
static Matrix |
createRandomSquareMatrix(int dimensions,
Random rand) |
static Matrix33 |
createRotationMatrix(AVector v,
double angle)
Create a 3x3 rotation matrix using the given rotation axis and angle in radians
|
static Matrix33 |
createRotationMatrix(double x,
double y,
double z,
double angle)
Create a 3x3 rotation matrix using the given rotation axis and angle in radians
|
static Matrix33 |
createRotationMatrix(Vector3 axis,
double angle)
Creates a 3D rotation matrix for a given angle or rotation in radians around an axis vector.
|
static ADiagonalMatrix |
createScalarMatrix(int dimensions,
double factor)
Creates a scalar matrix with the given scale factor.
|
static DiagonalMatrix |
createScaleMatrix(double... scalingFactors)
Creates a diagonal scaling matrix with the given scale factors for each dimension
|
static ADiagonalMatrix |
createScaleMatrix(int dimensions,
double factor)
Creates a diagonal scaling matrix (same factor on every element of main diagonal, 0.0 elsewhere)
Mutable only on main diagonal.
|
static AMatrix |
createSparse(AMatrix m)
Creates a sparse matrix from the given matrix, ignoring zeros
|
static AMatrix |
createSparse(int columnCount,
Index[] indexes,
AVector[] weights)
Create a sparse array, given an Index of column positions and AVector of corresponding values for each row in the sparse array
Performs a defensive copy of underlying data.
|
static SparseRowMatrix |
createSparse(int rowCount,
int columnCount)
Creates a sparse matrix of the given size, initially zero-filled.
|
static AMatrix |
createSparse(Iterable<INDArray> slices)
Creates a sparse matrix using the given arrays as slices
|
static AMatrix |
createSparse(Object... slices)
Creates a sparse matrix using the given objects as slices
|
static ArrayList<AVector> |
createSparseArray(Iterator<AVector> vecIterator)
Creates a sparse matrix from the given iterator.
|
static SparseColumnMatrix |
createSparseColumns(AMatrix m)
Creates a SparseColumnMatrix from the given matrix, ignoring zeros
|
static SparseColumnMatrix |
createSparseColumns(Iterator<AVector> colIterator) |
static AMatrix |
createSparseRows(AMatrix m)
Creates a SparseRowMatrix matrix from the given matrix, ignoring zeros
|
static SparseRowMatrix |
createSparseRows(INDArray a)
Creates a SparseRowMatrix matrix from the given INDArray, ignoring zeros
|
static SparseRowMatrix |
createSparseRows(Iterable<AVector> rows)
Creates a sparse matrix from the given matrix, ignoring zeros.
|
static SparseRowMatrix |
createSparseRows(Iterator<AVector> rowIterator) |
static Matrix33 |
createXAxisRotationMatrix(double angle)
Create a 3x3 rotation matrix using the given rotation angle in radians around the x-axis
|
static Matrix33 |
createYAxisRotationMatrix(double angle)
Create a 3x3 rotation matrix using the given rotation angle in radians around the y-axis
|
static Matrix33 |
createZAxisRotationMatrix(double angle)
Create a 3x3 rotation matrix using the given rotation angle in radians around the z-axis
|
static AMatrix |
extractLowerTriangular(AMatrix a)
Extracts a lower triangular matrix from a matrix
|
static AMatrix |
extractUpperTriangular(AMatrix a)
Extracts an upper triangular matrix from a matrix
|
static void |
fillRandomValues(AMatrix m)
Fills a matrix with uniform random numbers
|
static void |
fillRandomValues(AMatrix m,
Random rand)
Fills a matrix with uniform random numbers, using the specified Random instance
|
static AMatrix |
newMatrix(int rows,
int columns)
Creates an empty (zero-filled) mutable matrix of the specified size.
|
static AMatrix |
parse(String ednString)
Parse a matrix in edn format
|
static AMatrix |
toMatrix(Object o)
Coerce an object to a matrix format, on a best effort basis.
|
static AStridedMatrix |
wrapStrided(double[] data,
int rows,
int cols,
int offset,
int rowStride,
int colStride)
Wraps double[] data in a strided matrix of the most efficient available type.
|
public static AMatrix createIdentityMatrix(int dimensions)
public static IdentityMatrix createImmutableIdentityMatrix(int dimensions)
public static AMatrix createMutableIdentityMatrix(int dimensions)
public static AMatrix toMatrix(Object o)
public static AMatrix createSparse(AMatrix m)
public static SparseRowMatrix createSparse(int rowCount, int columnCount)
public static SparseRowMatrix createSparseRows(Iterable<AVector> rows)
public static ArrayList<AVector> createSparseArray(Iterator<AVector> vecIterator)
public static SparseRowMatrix createSparseRows(Iterator<AVector> rowIterator)
public static SparseColumnMatrix createSparseColumns(Iterator<AVector> colIterator)
public static AMatrix createSparse(int columnCount, Index[] indexes, AVector[] weights)
public static SparseColumnMatrix createSparseColumns(AMatrix m)
public static AMatrix createSparseRows(AMatrix m)
public static SparseRowMatrix createSparseRows(INDArray a)
public static ZeroMatrix createImmutableZeroMatrix(int rows, int columns)
public static ADiagonalMatrix createScaleMatrix(int dimensions, double factor)
dimensions - factor - public static ADiagonalMatrix createScalarMatrix(int dimensions, double factor)
public static DiagonalMatrix createScaleMatrix(double... scalingFactors)
public static DiagonalMatrix createDiagonalMatrix(double... diagonalValues)
public static DiagonalMatrix createDiagonalMatrix(AVector diagonalValues)
public static Matrix33 createRotationMatrix(Vector3 axis, double angle)
public static Matrix33 createRotationMatrix(double x, double y, double z, double angle)
angle - Rotation angle in radiansx - x-element of rotation vectory - y-element of rotation vectorz - z-element of rotation vectorpublic static Matrix33 createRotationMatrix(AVector v, double angle)
angle - Rotation angle in radiansv - Rotation axis vectorpublic static Matrix33 createXAxisRotationMatrix(double angle)
angle - Rotation angle in radianspublic static Matrix33 createYAxisRotationMatrix(double angle)
angle - Rotation angle in radianspublic static Matrix33 createZAxisRotationMatrix(double angle)
angle - Rotation angle in radianspublic static Matrix22 create2DRotationMatrix(double angle)
public static Matrix createRandomSquareMatrix(int dimensions)
public static AMatrix createRandomMatrix(int rows, int columns)
rows - columns - public static AMatrix createRandomMatrix(int rows, int columns, Random rand)
rows - columns - rand - A random number generator to use as the seedpublic static AMatrix newMatrix(int rows, int columns)
rows - columns - public static Matrix createFromVector(AVector source, int rows, int columns)
data - rows - columns - public AMatrix createInverse(AMatrix m)
m - public static AMatrix extractLowerTriangular(AMatrix a)
public static AMatrix extractUpperTriangular(AMatrix a)
public static Matrix create(List<Object> rows)
rows - public static void fillRandomValues(AMatrix m)
m - public static void fillRandomValues(AMatrix m, Random rand)
m - public static AMatrix createFromVectors(INDArray... data)
data - public static AMatrix createFromVectors(List<INDArray> data)
data - public static AMatrix parse(String ednString)
ednString - public static AMatrix create(Object... vs)
vs - public static Matrix create(double[][] data)
data - public static AStridedMatrix wrapStrided(double[] data, int rows, int cols, int offset, int rowStride, int colStride)
array - arrayOffset - reverse - reverse2 - public static AMatrix createSparse(Iterable<INDArray> slices)
slices - An iterable object containing n length m vectors to use as matrix rowsCopyright © 2016. All rights reserved.