Class ComplexExactTensorSolver
java.lang.Object
org.flag4j.linalg.solvers.exact.ExactTensorSolver<CTensor,CMatrix,CVector>
org.flag4j.linalg.solvers.exact.ComplexExactTensorSolver
- All Implemented Interfaces:
LinearSolver<CTensor>
Solver for solving a real well determined linear tensor equation \( AX = B \) in an exact sense.
All indices of \( X \) are summed over in the tensor product with the rightmost indices of
\( A \) as if by
A.tensorDot(X, M, N) where
M = new int[]{X.rank()-1, X.rank(), X.rank()+1, ..., A.rank()-1} and
N = new int[]{0, 1, ..., X.rank()-1}.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an exact tensor solver for solving a well determined linear tensor equation A*X=B for X in an exact sense. -
Method Summary
Modifier and TypeMethodDescriptionprotected CMatrixinitMatrix(CTensor A, int prod) Initializes matrix for equivalent linear matrix equation.protected CVectorInitializes vector for equivalent linear matrix equation.protected CTensorWraps solution as a tensor and reshapes to the proper shape.Methods inherited from class org.flag4j.linalg.solvers.exact.ExactTensorSolver
checkSize, getOutputShape, solve
-
Constructor Details
-
ComplexExactTensorSolver
public ComplexExactTensorSolver()Creates an exact tensor solver for solving a well determined linear tensor equation A*X=B for X in an exact sense.
-
-
Method Details
-
initMatrix
Initializes matrix for equivalent linear matrix equation.- Specified by:
initMatrixin classExactTensorSolver<CTensor,CMatrix, CVector> - Parameters:
A- Tensor to convert to matrix.prod- Product of all axis lengths inA.- Returns:
- A matrix with the same data as tensor
Awith shape (prod, prod).
-
initVector
Initializes vector for equivalent linear matrix equation.- Specified by:
initVectorin classExactTensorSolver<CTensor,CMatrix, CVector> - Parameters:
B- Tensor to convert to vector.- Returns:
- Flattens tensor
Band converts to a vector.
-
wrap
Wraps solution as a tensor and reshapes to the proper shape.- Specified by:
wrapin classExactTensorSolver<CTensor,CMatrix, CVector> - Parameters:
x- Vector solution to matrix linear equation which is equivalent to the tensor equation A*X=B.outputShape- Shape for the solution tensor X.- Returns:
- The solution X to the linear tensor equation A*X=B.
-