Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Amesos2::AbstractConcreteMatrixAdapter< Abstract, Matrix > Class Template Reference

#include <Amesos2_AbstractConcreteMatrixAdapter.hpp>

Inheritance diagram for Amesos2::AbstractConcreteMatrixAdapter< Abstract, Matrix >:
Inheritance graph
[legend]

Detailed Description

template<class Abstract, class Matrix>
class Amesos2::AbstractConcreteMatrixAdapter< Abstract, Matrix >

This class provides a statically polymorphic abstract base class for concrete matrix adapters.

If a matrix M inherits from another matrix class A, it's adapter should inherit from::

* AbstractConcreteMatrixAdapter<A,M>
*

and the common functionality for matrices inheritting from A should reside in a specialization of AbstractConcreteMatrixAdapter

For example, Epetra_CrsMatrix and Epetra_VbrMatrix both inherit from Epetra_RowMatrix. There is much functionality which is common, but some details, such as object construction is specific to each, so the get_impl function, which must create new instances should be adapted differently for each.

* template < typename M >
* AbstractConcreteMatrixAdapter<Epetra_RowMatrix, M>
* : MatrixAdapter<M> {
*
* // < ...common functions... >
*
* RCP<MatrixAdapter<M> > get_impl(){
* return static_cast<ConcreteMatrixAdapter<M>*>(this)->get_impl();
* }
* }
*

So now the ConcreteMatrixAdapter specializations for Epetra_CrsMatrix and Epetra_VbrMatrix must only provide the get_impl function.


The documentation for this class was generated from the following file: