Anasazi::MultiVecTraits::CloneView signatures have inconsistent const qualifiers.
Created by: ecurtin2
Hello,
Problem
I've been working on implementing Anasazi::MultiVecTraits for a non-trilinos datatype.
Most of the interface seems reasonable, but there is an inconsistency between the 4 clone view interfaces. These are declared in AnasaziMultiVecTraits.hpp
starting at line 171
static Teuchos::RCP<MV> CloneViewNonConst( MV& mv, const std::vector<int>& index )
static Teuchos::RCP<MV> CloneViewNonConst( MV& mv, const Teuchos::Range1D& index )
static Teuchos::RCP<const MV> CloneView( const MV& mv, const std::vector<int>& index )
static Teuchos::RCP<MV> CloneView( MV& mv, const Teuchos::Range1D& index )
The signature of the 4th matches the 2nd. The naming and presence of the std::vector<>
versions implies the 4th should use a const MV&. Currently the Teuchos::Range1D
version does not parallel the std::vector<>
.
Proposed Solution
The signature of (AnasaziMultiVecTraits.hpp line 201)
static Teuchos::RCP<MV> CloneView( MV& mv, const Teuchos::Range1D& index )
should be changed to
static Teuchos::RCP<
const MV> CloneView(
const MV& mv, const Teuchos::Range1D& index )
Note
I was concerned of possible conflict with the adapters made for the other trilinos packages. It looks like the tpetra/src/AnasaziTpetraAdapter.hpp
line 320 has the signature I expect:
static Teuchos::RCP<const MV>
CloneView (const MV& mv, const Teuchos::Range1D& index)
So does the thrya adapter (Trilinos/packages/anasazi/thyra/src/AnasaziThyraAdapter.hpp
line 238):
static Teuchos::RCP<const TMVB>
CloneView (const TMVB& mv, const Teuchos::Range1D& index)
@trilinos/anasazi