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>

public class ComplexExactTensorSolver extends ExactTensorSolver<CTensor,CMatrix,CVector>
Solver for solving a complex well determined linear tensor equation A*X=B in an exact sense.
  • 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

      protected CMatrix initMatrix(CTensor A, int prod)
      Initializes matrix for equivalent linear matrix equation.
      Specified by:
      initMatrix in class ExactTensorSolver<CTensor,CMatrix,CVector>
      Parameters:
      A - Tensor to convert to matrix.
      prod - Product of all axis lengths in A.
      Returns:
      A matrix with the same data as tensor A with shape (prod, prod).
    • initVector

      protected CVector initVector(CTensor B)
      Initializes vector for equivalent linear matrix equation.
      Specified by:
      initVector in class ExactTensorSolver<CTensor,CMatrix,CVector>
      Parameters:
      B - Tensor to convert to vector.
      Returns:
      Flattens tensor B and converts to a vector.
    • wrap

      protected CTensor wrap(CVector x, Shape outputShape)
      Wraps solution as a tensor and reshapes to the proper shape.
      Specified by:
      wrap in class ExactTensorSolver<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.