Class RealDoubleMatrix
java.lang.Object
org.episteme.core.mathematics.linearalgebra.matrices.GenericMatrix<Real>
org.episteme.core.mathematics.linearalgebra.matrices.RealDoubleMatrix
- All Implemented Interfaces:
AutoCloseable, Matrix<Real>, AbelianGroup<Matrix<Real>>, AbelianMonoid<Matrix<Real>>, Group<Matrix<Real>>, Magma<Matrix<Real>>, Monoid<Matrix<Real>>, Ring<Matrix<Real>>, Semiring<Matrix<Real>>, Set<Matrix<Real>>, Module<Matrix<Real>, Real>
A specialized Matrix implementation for Doubles with SIMD and Native
optimization.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Field Summary
Fields inherited from class GenericMatrix
provider, ring, storage -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRealDoubleMatrix(RealDoubleMatrixStorage storage) Internal constructor.RealDoubleMatrix(RealDoubleMatrixStorage storage, LinearAlgebraProvider<Real> provider) Public constructor for Providers and internal use. -
Method Summary
Modifier and TypeMethodDescriptionReturns the sum of this matrix and another.cholesky()Computes the Cholesky decomposition of this matrix.voidclose()static RealDoubleMatrixdiagonal(double[] data) Creates a diagonal RealDoubleMatrix from a double array.static RealDoubleMatrixdirect(int rows, int cols) Creates a RealDoubleMatrix intended for direct/native usage.eigen()Computes the eigenvalue decomposition of this matrix.getField()inverse()Returns the multiplicative inverse of this matrix.booleanisDirect()lu()Computes the LU decomposition of this matrix.multiply(RealDoubleMatrix other) Optimized matrix multiplication (GEMM).Returns the product of this matrix and another.Multiplies this matrix by a vector.static RealDoubleMatrixof(double[][] values) Creates a RealDoubleMatrix from a 2D double array (Heap Storage).static RealDoubleMatrixof(double[] data, int rows, int cols) Creates a RealDoubleMatrix from a flattened double array.static RealDoubleMatrixof(double[] data, int rows, int cols, LinearAlgebraProvider<Real> provider) static RealDoubleMatrixof(RealDoubleMatrixStorage storage) Creates a RealDoubleMatrix from a specialized storage.qr()Computes the QR decomposition of this matrix.Convenience scalar multiplication (scalar × this).voidset(int row, int col, double value) subtract(RealDoubleMatrix other) svd()Computes the Singular Value Decomposition (SVD) of this matrix.double[][]Returns the elements of this matrix as a 2D double array.double[]Returns the elements of this matrix as a flattened double array.Returns the transpose of this matrix.Methods inherited from class GenericMatrix
cols, contains, description, determinant, get, getColumn, getProvider, getRow, getScalarRing, getStorage, getSubMatrix, negate, one, rows, scale, set, trace, withProvider, zeroMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AbelianGroup
negate, subtractMethods inherited from interface Matrix
add, identity, inverse, isCommutative, isEmpty, isMultiplicationCommutative, map, multiply, operate, subtract, toTensorMethods inherited from interface Monoid
isAssociative
-
Constructor Details
-
RealDoubleMatrix
Internal constructor.NOTE: This constructor eagerly looks up the "best system provider" for internal element-wise and BLAS operations (like add, subtract). This is separate from the provider selected by higher-level algorithms like Benchmarks.
-
RealDoubleMatrix
Public constructor for Providers and internal use.
-
-
Method Details
-
of
Creates a RealDoubleMatrix from a 2D double array (Heap Storage).- Parameters:
values- the values- Returns:
- the matrix
-
of
Creates a RealDoubleMatrix from a flattened double array. NOTE: Assumes data is already row-major. -
of
public static RealDoubleMatrix of(double[] data, int rows, int cols, LinearAlgebraProvider<Real> provider) -
direct
Creates a RealDoubleMatrix intended for direct/native usage. -
of
Creates a RealDoubleMatrix from a specialized storage. -
diagonal
Creates a diagonal RealDoubleMatrix from a double array. -
getField
- Overrides:
getFieldin classGenericMatrix<Real>
-
isDirect
public boolean isDirect() -
getDoubleStorage
-
set
public void set(int row, int col, double value) -
getBuffer
-
toDoubleArray
public double[] toDoubleArray()Returns the elements of this matrix as a flattened double array. -
to2DDoubleArray
public double[][] to2DDoubleArray()Returns the elements of this matrix as a 2D double array. -
multiply
-
multiply
Optimized matrix multiplication (GEMM). -
add
-
subtract
-
scale
-
solve
-
transpose
Description copied from interface:MatrixReturns the transpose of this matrix. -
inverse
Description copied from interface:MatrixReturns the multiplicative inverse of this matrix. -
multiply
Description copied from interface:MatrixMultiplies this matrix by a vector. -
lu
-
qr
-
svd
-
cholesky
Description copied from interface:MatrixComputes the Cholesky decomposition of this matrix. -
eigen
Description copied from interface:MatrixComputes the eigenvalue decomposition of this matrix. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-