Interface LinearSolverDense<T extends Matrix>

All Superinterfaces:
LinearSolver<T,​T>
All Known Subinterfaces:
AdjustableLinearSolver_DDRM, AdjustableLinearSolver_FDRM
All Known Implementing Classes:
AdjLinearSolverQr_DDRM, AdjLinearSolverQr_FDRM, BaseLinearSolverQrp_DDRM, BaseLinearSolverQrp_FDRM, CholeskyOuterSolver_DDRB, CholeskyOuterSolver_FDRB, CholeskyOuterSolver_MT_DDRB, CholeskyOuterSolver_MT_FDRB, LinearSolver_DDRB_to_DDRM, LinearSolver_FDRB_to_FDRM, LinearSolverAbstract_CDRM, LinearSolverAbstract_DDRM, LinearSolverAbstract_FDRM, LinearSolverAbstract_ZDRM, LinearSolverChol_CDRM, LinearSolverChol_DDRB, LinearSolverChol_DDRM, LinearSolverChol_FDRB, LinearSolverChol_FDRM, LinearSolverChol_ZDRM, LinearSolverCholLDL_DDRM, LinearSolverCholLDL_FDRM, LinearSolverLu_CDRM, LinearSolverLu_DDRM, LinearSolverLu_FDRM, LinearSolverLu_ZDRM, LinearSolverLuBase_CDRM, LinearSolverLuBase_DDRM, LinearSolverLuBase_FDRM, LinearSolverLuBase_ZDRM, LinearSolverLuKJI_DDRM, LinearSolverLuKJI_FDRM, LinearSolverQr_CDRM, LinearSolverQr_DDRM, LinearSolverQr_FDRM, LinearSolverQr_ZDRM, LinearSolverQrBlock64_DDRM, LinearSolverQrBlock64_FDRM, LinearSolverQrHouse_CDRM, LinearSolverQrHouse_DDRM, LinearSolverQrHouse_FDRM, LinearSolverQrHouse_ZDRM, LinearSolverQrHouseCol_CDRM, LinearSolverQrHouseCol_DDRM, LinearSolverQrHouseCol_FDRM, LinearSolverQrHouseCol_MT_DDRM, LinearSolverQrHouseCol_MT_FDRM, LinearSolverQrHouseCol_ZDRM, LinearSolverQrHouseTran_CDRM, LinearSolverQrHouseTran_DDRM, LinearSolverQrHouseTran_FDRM, LinearSolverQrHouseTran_ZDRM, LinearSolverQrpHouseCol_DDRM, LinearSolverQrpHouseCol_FDRM, LinearSolverSafe, LinearSolverUnrolled_DDRM, LinearSolverUnrolled_FDRM, QrHouseHolderSolver_DDRB, QrHouseHolderSolver_FDRB, QrHouseHolderSolver_MT_DDRB, QrHouseHolderSolver_MT_FDRB, SolvePseudoInverseQrp_DDRM, SolvePseudoInverseQrp_FDRM, SolvePseudoInverseSvd_DDRM, SolvePseudoInverseSvd_FDRM

public interface LinearSolverDense<T extends Matrix>
extends LinearSolver<T,​T>

An implementation of LinearSolverDense solves a linear system or inverts a matrix. It masks more complex implementation details, while giving the programmer control over memory management and performance. To quickly detect nearly singular matrices without computing the SVD the LinearSolver.quality() function is provided.

A linear system is defined as: A*X = B.
where A ∈ ℜ m × n, X ∈ ℜ n × p, B ∈ ℜ m × p. Different implementations can solve different types and shapes in input matrices and have different memory and runtime performance.

To solve a system:
  1. Call LinearSolver.setA(org.ejml.data.Matrix)
  2. Call LinearSolver.solve(org.ejml.data.Matrix, org.ejml.data.Matrix).

To invert a matrix:

  1. Call LinearSolver.setA(org.ejml.data.Matrix)
  2. Call invert(org.ejml.data.Matrix).

A matrix can also be inverted by passing in an identity matrix to solve, but this will be slower and more memory intensive than the specialized invert() function.

IMPORTANT: Depending upon the implementation, input matrices might be overwritten by the solver. This reduces memory and computational requirements and give more control to the programmer. If the input matrices need to be not modified then LinearSolverSafe can be used. The functions LinearSolver.modifiesA() and LinearSolver.modifiesB() specify which input matrices are being modified.

  • Method Details

    • invert

      void invert​(T A_inv)
      Computes the inverse of of the 'A' matrix passed into LinearSolver.setA(Matrix) and writes the results to the provided matrix. If 'A_inv' needs to be different from 'A' is implementation dependent.
      Parameters:
      A_inv - Where the inverted matrix saved. Modified.