[Trilinos-Users] Request for tpetra::RowMatrix<>::scalar_type as used by Ifpack2
Williams, Alan B
william at sandia.gov
Thu Jul 7 14:30:34 MDT 2011
>
> Hello Alan,
>
> ILUT only supports CrsMatrix? I don't see any use of Tpetra::CrsMatrix
> anywhere in the source for ILUT. In fact CrsMatrix has been used
> nowhere in ifpack2/src except for
> Ifpack2_ExplicitInstantiationHelpers.hpp, and I suppose it could be
> replaced by Tpetra::RowMatrix if you use the typedefs that Chris just
> wrote he will add.
>
> In fact the constructor for ILUT reads
> ILUT (const Teuchos::RCP< const Tpetra::RowMatrix< Scalar,
> LocalOrdinal, GlobalOrdinal, Node > > &A)
> so if I instantiate ILUT<Tpetra::CrsMatrix> there seems to be no
> downcast of Tpetra::RowMatrix to Tpetra::CrsMatrix.
>
Yes, you appear to have caught me in an error.
Now that I look back through the code again, it seems that the MatrixType template parameter determines the type of the L and U factors that are produced, while the constructor indeed accepts the RowMatrix base class as you point out.
When I said that only CrsMatrix support has been implemented, I should have instead said that only CrsMatrix support has been tested.
Using a MatrixType template parameter while accepting a RowMatrix constructor argument seems questionable now. It may be an unfortunate mixing of run-time and compile-time polymorphism.
Certainly you can't use RowMatrix as the MatrixType template parameter, because then ILUT would not compile, because the creation of the L and U factors makes use of member-methods of 'MatrixType' that don't exist on RowMatrix. (Such as insertLocalValues.)
Alan
More information about the Trilinos-Users
mailing list