    

 ## On this page

  

 

 # SparseSolver Class Reference

 Last update: 16.07.2025 

The base class for sparse solvers. It provides a unified interface which can be used by generic algorithms. [More...](class_sparse_solver.xhtml#details)

## <a name="pub-types"></a>Public Types

<a id="ad33f729eda6e45412aac71cee702012f"></a>typedef number [TScalar](class_sparse_solver.xhtml#ad33f729eda6e45412aac71cee702012f) data type of matrix elements   
 <a id="a0ce6eae547dc1456730d2df72d9c29cb"></a>typedef Eigen::SparseMatrix&lt; [TScalar](class_sparse_solver.xhtml#ad33f729eda6e45412aac71cee702012f) &gt; [TSparseMatrix](class_sparse_solver.xhtml#a0ce6eae547dc1456730d2df72d9c29cb) the sparse matrix base type   
 ## <a name="pub-methods"></a>Public Member Functions

virtual bool [Compute](class_sparse_solver.xhtml#a198e988cd87fa6915dd1aa906d1fb87c) ([SparseMatrix](class_sparse_matrix.xhtml) A) computes the factorization, returns true if succeeded [More...](#a198e988cd87fa6915dd1aa906d1fb87c)  
 virtual bool [Compute](class_sparse_solver.xhtml#ac6480ddf60c975e344ad332af27eba9b) ([SymSparseMatrix](class_sym_sparse_matrix.xhtml) A) computes the factorization, returns true if succeeded [More...](#ac6480ddf60c975e344ad332af27eba9b)  
 virtual [Matrix](class_matrix.xhtml) [operator\*](class_sparse_solver.xhtml#ab575d53b6b3741bf8b54ca4dad896322) ([Matrix](class_matrix.xhtml) other) returns the matrix product inv(A)\*B [More...](#ab575d53b6b3741bf8b54ca4dad896322)  
  [Solve](class_sparse_solver.xhtml#a03c9937003c1c78404c778f1ce257cfd) ([Matrix](class_matrix.xhtml) INPUT, [Matrix](class_matrix.xhtml) \*\*OUTPUT, bool \*\*OUTPUT) Solves the given vector on return; returns true if succeeded. [More...](#a03c9937003c1c78404c778f1ce257cfd)  
  [Solve](class_sparse_solver.xhtml#aed85b6e6bc9e10b49a5eacee4930dc12) ([SparseMatrix](class_sparse_matrix.xhtml) INPUT, [Matrix](class_matrix.xhtml) \*\*OUTPUT, bool \*\*OUTPUT) Solves the given sparse RHS on return; returns true if succeeded. [More...](#aed85b6e6bc9e10b49a5eacee4930dc12)  
 virtual bool [SolveInPlace](class_sparse_solver.xhtml#a6facb69b91b239c79f8272159402c4f4) ([Matrix](class_matrix.xhtml) b) Factorizes this matrix and solves the given vector in place;. [More...](#a6facb69b91b239c79f8272159402c4f4)  
  [SolveTransposed](class_sparse_solver.xhtml#aeb600a838ac25ea5705191ddcd35d5aa) ([Matrix](class_matrix.xhtml) INPUT, [Matrix](class_matrix.xhtml) \*\*OUTPUT, bool \*\*OUTPUT) Solves the system (transpose(Matrix)\*x=b for x; returns true if succeeded. [More...](#aeb600a838ac25ea5705191ddcd35d5aa)  
  [SparseSolver](class_sparse_solver.xhtml#af1e7f2e7e3552b4dc667f324d0f21492) () destructor [More...](#af1e7f2e7e3552b4dc667f324d0f21492)  
 virtual string [typeIdent](class_sparse_solver.xhtml#a4bab1e661cce06aa1bab0b15bc3f5f9e) () <a id="details" name="details"></a>## Detailed Description

The base class for sparse solvers. It provides a unified interface which can be used by generic algorithms.



## Constructor &amp; Destructor Documentation

<a id="af1e7f2e7e3552b4dc667f324d0f21492"></a>## [◆ ](#af1e7f2e7e3552b4dc667f324d0f21492)SparseSolver()

 [SparseSolver](class_sparse_solver.xhtml)  ( ) 

destructor

default constructor





## Member Function Documentation

<a id="a198e988cd87fa6915dd1aa906d1fb87c"></a>## [◆ ](#a198e988cd87fa6915dd1aa906d1fb87c)Compute() \[1/2\]

 virtual bool Compute  ( [SparseMatrix](class_sparse_matrix.xhtml)  *A*)   virtual 

computes the factorization, returns true if succeeded

Parameters Athe matrix to be factorized Returnstrue of successful Reimplemented in [SparseLU](class_sparse_l_u.xhtml#a79c58864d591ecafc1ef6fc3c5f2e8fc), and [MUMPS](class_m_u_m_p_s.xhtml#a79c58864d591ecafc1ef6fc3c5f2e8fc).





<a id="ac6480ddf60c975e344ad332af27eba9b"></a>## [◆ ](#ac6480ddf60c975e344ad332af27eba9b)Compute() \[2/2\]

 virtual bool Compute  ( [SymSparseMatrix](class_sym_sparse_matrix.xhtml)  *A*)   virtual 

computes the factorization, returns true if succeeded

Parameters Athe matrix to be factorized Returnstrue of successful Reimplemented in [SparseLU](class_sparse_l_u.xhtml#ac6480ddf60c975e344ad332af27eba9b), and [MUMPS](class_m_u_m_p_s.xhtml#a5526f969e26fc63c313b4aa589c764d8).





<a id="ab575d53b6b3741bf8b54ca4dad896322"></a>## [◆ ](#ab575d53b6b3741bf8b54ca4dad896322)operator\*()

 virtual [Matrix](class_matrix.xhtml) operator\*  ( [Matrix](class_matrix.xhtml)  *other*)   virtual 

returns the matrix product inv(A)\*B

Parameters otherthe second argument of inv(A)\*B Returnsthe product of the factorized matrix multiplied with *other* 



<a id="a03c9937003c1c78404c778f1ce257cfd"></a>## [◆ ](#a03c9937003c1c78404c778f1ce257cfd)Solve() \[1/2\]

 Solve  ( [Matrix](class_matrix.xhtml)  *INPUT*,    [Matrix](class_matrix.xhtml) \*\*  *OUTPUT*,    bool \*\*  *OUTPUT*   ) 

Solves the given vector on return; returns true if succeeded.

Parameters bthe right hand side xthe solution successthe return value of *Solve(b,x)* allow the SWIG syntax (x,bool)=Solve(b) for solving x in Ax=b in script bindings 



<a id="aed85b6e6bc9e10b49a5eacee4930dc12"></a>## [◆ ](#aed85b6e6bc9e10b49a5eacee4930dc12)Solve() \[2/2\]

 Solve  ( [SparseMatrix](class_sparse_matrix.xhtml)  *INPUT*,    [Matrix](class_matrix.xhtml) \*\*  *OUTPUT*,    bool \*\*  *OUTPUT*   ) 

Solves the given sparse RHS on return; returns true if succeeded.

Parameters bthe right hand side xthe solution Returnstrue if successfulallows the SWIG syntax (x,bool)=Solve(b) for solving x in Ax=b in script 



<a id="a6facb69b91b239c79f8272159402c4f4"></a>## [◆ ](#a6facb69b91b239c79f8272159402c4f4)SolveInPlace()

 virtual bool SolveInPlace  ( [Matrix](class_matrix.xhtml)  *b*)   virtual 

Factorizes this matrix and solves the given vector in place;.

Returnsreturns true if succeeded Parameters bon input: the right hand side. On output: the solution x Reimplemented in [SparseLU](class_sparse_l_u.xhtml#a6facb69b91b239c79f8272159402c4f4), and [MUMPS](class_m_u_m_p_s.xhtml#a6facb69b91b239c79f8272159402c4f4).





<a id="aeb600a838ac25ea5705191ddcd35d5aa"></a>## [◆ ](#aeb600a838ac25ea5705191ddcd35d5aa)SolveTransposed()

 SolveTransposed  ( [Matrix](class_matrix.xhtml)  *INPUT*,    [Matrix](class_matrix.xhtml) \*\*  *OUTPUT*,    bool \*\*  *OUTPUT*   ) 

Solves the system (transpose(Matrix)\*x=b for x; returns true if succeeded.

Parameters bthe right hand side xthe solution Returnstrue if successful allows the SWIG syntax (x,bool)=Solve(b) for solving x in Ax=b in script. 



<a id="a4bab1e661cce06aa1bab0b15bc3f5f9e"></a>## [◆ ](#a4bab1e661cce06aa1bab0b15bc3f5f9e)typeIdent()

 virtual string typeIdent  ( )   virtual 

Returnsthe name of the datatype