Base type for a linear solver, allowing the underlying matrix to be sparse. More...
#include <ptems/linearsolver.hpp>
Public Types | |
typedef T | value_type |
Defines the type of a matrix entry in the linear system. More... | |
typedef Ref | reference |
Defines the type of a reference to a matrix entry in the linear system. More... | |
typedef ConstRef | const_reference |
Defines the type of a const reference to a matrix entry in the linear system. More... | |
typedef std::optional< typename detail::ReferenceWrapper< reference >::type > | optional_reference |
Defines the type of a reference to a matrix entry in the linear system. More... | |
typedef std::optional< typename detail::ReferenceWrapper< const_reference >::type > | optional_const_reference |
Defines the type of a const reference to a matrix entry in the linear system. More... | |
Public Member Functions | |
virtual bool | DistributedConstruction () const =0 |
Gets if the matrix and right hand side should be constructed distributed (for MPI) More... | |
virtual optional_reference | Entry (std::size_t i, std::size_t j)=0 |
Gets a reference to the specified matrix entry. More... | |
virtual optional_const_reference | Entry (std::size_t i, std::size_t j) const =0 |
Gets a const reference to the specified matrix entry. More... | |
virtual void | Clear ()=0 |
Clear the matrix of the linear system. More... | |
virtual std::size_t | size () const =0 |
Gets the size of the linear system. More... | |
virtual std::vector< T > | Solve (const std::vector< T > &rhs, std::size_t offsetRHS=0, std::size_t lenRHS=-1)=0 |
Solves the linear system with the specified right-hand side. More... | |
virtual reference | operator() (std::size_t i, std::size_t j) |
Gets a reference to the specified matrix entry. More... | |
virtual const_reference | operator() (std::size_t i, std::size_t j) const |
Gets a const reference to the specified matrix entry. More... | |
virtual std::vector< T > | operator() (const std::vector< T > &rhs, std::size_t offsetRHS=0, std::size_t lenRHS=-1) |
Solves the linear system with the specified right-hand side. More... | |
Base type for a linear solver, allowing the underlying matrix to be sparse.
May only represent PART of the linear system if the underlying linear system supports distributed construction.
T | The type of the matrix entries |
Ref | The type of a reference to the matrix entries (can be proxy object) |
ConstRef | The type of a const reference to the matrix entries (can be proxy object) |
typedef ConstRef ptems::LinearSolver< T, Ref, ConstRef >::const_reference |
Defines the type of a const reference to a matrix entry in the linear system.
Can be a proxy object in some cases.
typedef std::optional<typename detail::ReferenceWrapper<const_reference>::type> ptems::LinearSolver< T, Ref, ConstRef >::optional_const_reference |
Defines the type of a const reference to a matrix entry in the linear system.
Can be a proxy object in some cases.
typedef std::optional<typename detail::ReferenceWrapper<reference>::type> ptems::LinearSolver< T, Ref, ConstRef >::optional_reference |
Defines the type of a reference to a matrix entry in the linear system.
Can be a proxy object in some cases.
typedef Ref ptems::LinearSolver< T, Ref, ConstRef >::reference |
Defines the type of a reference to a matrix entry in the linear system.
Can be a proxy object in some cases.
typedef T ptems::LinearSolver< T, Ref, ConstRef >::value_type |
Defines the type of a matrix entry in the linear system.
|
pure virtual |
Clear the matrix of the linear system.
Implemented in ptems::MumpsSolver< T >, and ptems::GMRESSolver< T >.
|
pure virtual |
Gets if the matrix and right hand side should be constructed distributed (for MPI)
Implemented in ptems::MumpsSolver< T >, and ptems::GMRESSolver< T >.
|
pure virtual |
Gets a const reference to the specified matrix entry.
std::out_of_range | If the row or column index are not less than the linear system size |
i | The row index |
j | The column index |
Implemented in ptems::MumpsSolver< T >, and ptems::GMRESSolver< T >.
|
pure virtual |
Gets a reference to the specified matrix entry.
std::out_of_range | If the row or column index are not less than the linear system size |
i | The row index |
j | The column index |
Implemented in ptems::MumpsSolver< T >, and ptems::GMRESSolver< T >.
|
inlinevirtual |
Solves the linear system with the specified right-hand side.
rhs | The right hand side vector |
offsetRHS | If using distributed matrix/rhs construction specifies the offset to the start of the right hand side vector populated by this process |
lenRHS | If using distributed matrix/rhs construction specifies the length of the right hand side vector populated by this process (or greater than size() for all) |
|
inlinevirtual |
Gets a reference to the specified matrix entry.
std::out_of_range | If the row or column index are not less than the linear system size |
std::invalid_argument | If the entry is not a non-zero entry of the sparse matrix |
i | The row index |
j | The column index |
|
inlinevirtual |
Gets a const reference to the specified matrix entry.
std::out_of_range | If the row or column index are not less than the linear system size |
std::invalid_argument | If the entry is not a non-zero entry of the sparse matrix |
i | The row index |
j | The column index |
|
pure virtual |
Gets the size of the linear system.
Implemented in ptems::MumpsSolver< T >, and ptems::GMRESSolver< T >.
|
pure virtual |
Solves the linear system with the specified right-hand side.
rhs | The right hand side vector |
offsetRHS | If using distributed matrix/rhs construction specifies the offset to the start of the right hand side vector populated by this process |
lenRHS | If using distributed matrix/rhs construction specifies the length of the right hand side vector populated by this process (or greater than size() for all) |
Implemented in ptems::MumpsSolver< T >, and ptems::GMRESSolver< T >.