Interface LinearAlgebraProvider<E>
- Type Parameters:
E- the element type (typicallyRealfor public API orDoublefor native)
- All Superinterfaces:
AlgorithmProvider, AutoCloseable
- All Known Subinterfaces:
LinearAlgebraBackend<E>, SparseLinearAlgebraProvider<E>
- All Known Implementing Classes:
AbstractNativeCPULinearAlgebraBackend, AbstractNativeFFMBLASBackend, AbstractNativeSIMDLinearAlgebraBackend, CARMALinearAlgebraProvider, ColtBackend, CommonsMathBackend, CPUDenseLinearAlgebraProvider, CPUSparseLinearAlgebraProvider, DistributedLinearAlgebraProvider, EJMLBackend, EpistemeLinearAlgebraBackend, GRPCLinearAlgebraBackend, JBlasBackend, NativeCPULinearAlgebraComplexBackend, NativeCPULinearAlgebraRealBackend, NativeCUDADenseLinearAlgebraDoubleBackend, NativeCUDADenseLinearAlgebraFloatBackend, NativeCUDASparseLinearAlgebraDoubleBackend, NativeCUDASparseLinearAlgebraFloatBackend, NativeFFMBLASComplexBackend, NativeFFMBLASRealBackend, NativeMPFRDenseLinearAlgebraBackend, NativeMPFRSparseLinearAlgebraBackend, NativeND4JLinearAlgebraBackend, NativeOpenCLDenseLinearAlgebraDoubleBackend, NativeOpenCLDenseLinearAlgebraFloatBackend, NativeOpenCLSparseLinearAlgebraDoubleBackend, NativeOpenCLSparseLinearAlgebraFloatBackend, NativeSIMDComplexBackend, NativeSIMDRealBackend, StandardLinearAlgebraProvider, StrassenLinearAlgebraProvider
Service provider interface for linear algebra operations.
Each provider implements only the operations it supports. Unsupported operations
throw UnsupportedOperationException. The AlgorithmManager is
responsible for selecting the best available provider and falling back to the
next one if the selected provider does not support a given operation.
This interface is parameterized by element type E. Two main
parameterizations exist in the codebase:
LinearAlgebraProvider<Real>— Public-facing API. Users and high-level code operate through this type.LinearAlgebraProvider<Double>— Internal optimization layer. Used by native BLAS backends that operate directly on rawdoublearrays.
- Since:
- 1.2
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptiondefault EReturns the angle between two vectors in radians.default CholeskyResult<E> Computes the Cholesky decomposition of the specified matrix.default voidclose()default EconditionNumber(Matrix<E> a) Returns the condition number of the matrix (L2 norm).default voidConfigure the provider with context parameters.Returns the cross product of two 3D vectors.default Edeterminant(Matrix<E> a) default Edefault EigenResult<E> Computes the eigenvalue decomposition of the specified matrix.Computes the matrix exponential e^A.default StringReturns the unique category of the algorithm.default StringReturns a string describing the execution environment (e.g., "CPU (AVX2)", "GPU (CUDA 12.0)").default StringgetName()default intPriority of this provider (higher means more preferred).default booleanisCompatible(Ring<?> ring) Checks if this provider is compatible with the given ring.Computes the LU decomposition of the specified matrix.default EReturns the normalized vector (unit vector).projection(Vector<E> a, Vector<E> b) Returns the projection of vector a onto vector b.Computes the QR decomposition of the specified matrix.default intReturns the rank of the matrix.default doublescore(OperationContext context) Scores this provider for a specific operation context.solve(CholeskyResult<E> cholesky, Vector<E> b) Solves Ax = b using a previously computed Cholesky decomposition.Solves Ax = b using a previously computed LU decomposition.Solves Ax = b using a previously computed QR decomposition.solveTriangular(Matrix<E> A, Vector<E> b, boolean upper, boolean transpose, boolean conjugate, boolean unit) Solves the triangular system Ax = b.Computes the Singular Value Decomposition (SVD) of the specified matrix.default EMethods inherited from interface AlgorithmProvider
description, getMetadata, isAvailable, shutdown
-
Method Details
-
isCompatible
Checks if this provider is compatible with the given ring. -
getPriority
default int getPriority()Priority of this provider (higher means more preferred). Used for automatic backend selection.- Specified by:
getPriorityin interfaceAlgorithmProvider
-
configure
-
add
-
subtract
-
multiply
-
dot
-
norm
-
normalize
-
cross
-
angle
-
projection
-
add
-
subtract
-
multiply
-
multiply
-
inverse
-
determinant
-
solve
-
transpose
-
conjugateTranspose
-
solveTriangular
default Vector<E> solveTriangular(Matrix<E> A, Vector<E> b, boolean upper, boolean transpose, boolean conjugate, boolean unit) Solves the triangular system Ax = b.- Parameters:
A- the triangular matrixb- the right-hand side vectorupper- true if A is upper triangular, false if lowertranspose- true if solving A^T x = bconjugate- true if solving A^H x = b (only if transpose is true and complex)unit- true if A is unit triangular (diagonal is all ones)
-
scale
-
exp
-
rank
-
conditionNumber
-
log
-
log10
-
sin
-
cos
-
tan
-
asin
-
acos
-
atan
-
sinh
-
cosh
-
tanh
-
asinh
-
acosh
-
atanh
-
pow
-
sqrt
-
cbrt
-
trace
-
qr
-
svd
-
eigen
Computes the eigenvalue decomposition of the specified matrix. -
lu
-
cholesky
Computes the Cholesky decomposition of the specified matrix. -
solve
-
solve
-
solve
-
score
Description copied from interface:AlgorithmProviderScores this provider for a specific operation context.Higher scores indicate better suitability. Used by
ProviderSelectorfor context-aware selection.Default implementation returns
AlgorithmProvider.getPriority(), so existing providers behave identically without changes.- Specified by:
scorein interfaceAlgorithmProvider- Parameters:
context- the operation context (data size, hints, etc.)- Returns:
- suitability score (higher = better)
-
getEnvironmentInfo
Returns a string describing the execution environment (e.g., "CPU (AVX2)", "GPU (CUDA 12.0)"). -
getName
- Specified by:
getNamein interfaceAlgorithmProvider
-
getAlgorithmType
Description copied from interface:AlgorithmProviderReturns the unique category of the algorithm.- Specified by:
getAlgorithmTypein interfaceAlgorithmProvider
-
close
default void close()- Specified by:
closein interfaceAutoCloseable
-