Caribou
LinearSolver.h
1 #pragma once
2 
3 namespace sofa::defaulttype {
4 class BaseMatrix;
5 class BaseVector;
6 }
7 
8 namespace SofaCaribou::solver {
9 
14 class LinearSolver {
15 public:
30  [[nodiscard]]
31  virtual sofa::defaulttype::BaseMatrix * create_new_matrix(unsigned int rows, unsigned int cols) const = 0;
32 
47  [[nodiscard]]
48  virtual sofa::defaulttype::BaseVector * create_new_vector(unsigned int n) const = 0;
49 
63  virtual bool solve(const sofa::defaulttype::BaseMatrix * A,
64  const sofa::defaulttype::BaseVector * F,
65  sofa::defaulttype::BaseVector * X) const = 0;
66 
67 };
68 
69 } // namespace SofaCaribou::solver
SofaCaribou::solver::LinearSolver::create_new_matrix
virtual sofa::defaulttype::BaseMatrix * create_new_matrix(unsigned int rows, unsigned int cols) const =0
Creates a new BaseMatrix of size rows x cols.
SofaCaribou::solver::LinearSolver::create_new_vector
virtual sofa::defaulttype::BaseVector * create_new_vector(unsigned int n) const =0
Creates a new BaseVector of size n.
SofaCaribou::solver::LinearSolver::solve
virtual bool solve(const sofa::defaulttype::BaseMatrix *A, const sofa::defaulttype::BaseVector *F, sofa::defaulttype::BaseVector *X) const =0
Solve the linear system A [X] = F.
SofaCaribou::solver::LinearSolver
Base interface for linear solvers.
Definition: LinearSolver.h:14