Package org.flag4j.linalg.solvers.exact
Class ComplexExactTensorSolver
java.lang.Object
org.flag4j.linalg.solvers.exact.ExactTensorSolver<CTensor,CMatrix,CVector>
org.flag4j.linalg.solvers.exact.ComplexExactTensorSolver
- All Implemented Interfaces:
LinearTensorSolver<CTensor>
Solver for solving a complex well determined linear tensor equation
A*X=B
in an exact sense.-
Constructor Summary
ConstructorDescriptionCreates an exact tensor solver for solving a well determined linear tensor equationA*X=B
forX
in an exact sense. -
Method Summary
Modifier and TypeMethodDescriptionprotected CMatrix
initMatrix
(CTensor A, int prod) Initializes matrix for equivalent linear matrix equation.protected CVector
Initializes vector for equivalent linear matrix equation.protected CTensor
Wraps 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 equationA*X=B
forX
in an exact sense.
-
-
Method Details
-
initMatrix
Initializes matrix for equivalent linear matrix equation.- Specified by:
initMatrix
in classExactTensorSolver<CTensor,
CMatrix, CVector> - Parameters:
A
- Tensor to convert to matrix.prod
- Product of all axis lengths inA
.- Returns:
- A matrix with the same entries as tensor
A
with shape (prod, prod).
-
initVector
Initializes vector for equivalent linear matrix equation.- Specified by:
initVector
in classExactTensorSolver<CTensor,
CMatrix, CVector> - Parameters:
B
- Tensor to convert to vector.- Returns:
- Flattens tensor
B
and converts to a vector.
-
wrap
Wraps solution as a tensor and reshapes to the proper shape.- Specified by:
wrap
in classExactTensorSolver<CTensor,
CMatrix, CVector> - Parameters:
x
- Vector solution to matrix linear equation which is equivalent to the tensor equationA*X=B
.outputShape
- Shape for the solution tensorX
.- Returns:
- The solution
X
to the linear tensor equationA*X=B
.
-