[Trilinos-Users] Request for tpetra::RowMatrix<>::scalar_type as used by Ifpack2

Williams, Alan B william at sandia.gov
Thu Jul 7 12:24:13 MDT 2011

> 2) why does Ifpack2 follow the style of having a base class with four
> template parameters:
> template<class Scalar, class LocalOrdinal = int, class GlobalOrdinal =
> LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
> class Preconditioner
> but then creates derived classes with only one template parameter:
> template<class MatrixType> class ILUT: [...]
> Wouldn't it be better to already have 4 template parameters in ILUT?

The Preconditioner base-class doesn't depend on an input-matrix (none of the Preconditioner methods accept a matrix object), it only depends on those four template parameters for the low-level data-types etc.

However, specific preconditioner implementations (such as ILUT) accept a matrix object and operate on it (accessing its data etc). The hope is that if the input-matrix type is a template parameter, then different matrix types (e.g. VbrMatrix vs CrsMatrix) could be supported with the same ILUT class declaration by simply specializing instantiations.
This hasn't been tried yet, only CrsMatrix support is implemented; but that's the idea behind the design decision.


More information about the Trilinos-Users mailing list