33 #ifndef ANASAZI_EPETRA_ADAPTER_HPP
34 #define ANASAZI_EPETRA_ADAPTER_HPP
37 #include "Anasaziepetra_DLLExportMacro.h"
42 #include "Teuchos_Assert.hpp"
44 #include "Epetra_MultiVector.h"
45 #include "Epetra_Vector.h"
46 #include "Epetra_Operator.h"
47 #include "Epetra_Map.h"
48 #include "Epetra_LocalMap.h"
50 #if defined(HAVE_ANASAZI_TPETRA) && defined(HAVE_ANASAZI_TSQR)
51 # include <Tpetra_ConfigDefs.hpp>
52 # if defined(HAVE_TPETRA_EPETRA)
53 # include <Epetra_TsqrAdaptor.hpp>
54 # endif // defined(HAVE_TPETRA_EPETRA)
55 #endif // defined(HAVE_ANASAZI_TPETRA) && defined(HAVE_ANASAZI_TSQR)
136 EpetraMultiVec(
const Epetra_BlockMap& Map_in,
double * array,
const int numvecs,
const int stride=0);
145 EpetraMultiVec(Epetra_DataAccess CV,
const Epetra_MultiVector& P_vec,
const std::vector<int>& index);
204 if ( Map().GlobalIndicesLongLong() )
205 return static_cast<ptrdiff_t
>( GlobalLength64() );
207 return static_cast<ptrdiff_t
>( GlobalLength() );
232 #ifdef HAVE_ANASAZI_EXPERIMENTAL
240 #ifdef HAVE_ANASAZI_EXPERIMENTAL
249 "Anasazi::EpetraMultiVec::MvScale call to Epetra_MultiVector::Scale() returned a nonzero value.");
254 void MvScale (
const std::vector<double>& alpha );
263 void MvNorm ( std::vector<double> & normvec )
const {
264 if (((
int)normvec.size() >= GetNumberVecs()) ) {
266 "Anasazi::EpetraMultiVec::MvNorm call to Epetra_MultiVector::Norm2() returned a nonzero value.");
284 "Anasazi::EpetraMultiVec::MvRandom call to Epetra_MultiVector::Random() returned a nonzero value.");
291 "Anasazi::EpetraMultiVec::MvInit call to Epetra_MultiVector::PutScalar() returned a nonzero value.");
310 void MvPrint( std::ostream& os )
const { os << *
this << std::endl; };
354 #pragma warning(push)
355 #pragma warning(disable:4251)
383 class ANASAZIEPETRA_LIB_DLL_EXPORT
EpetraGenOp :
public virtual Operator<double>,
public virtual Epetra_Operator {
391 bool isAInverse =
true );
404 int Apply(
const Epetra_MultiVector &X, Epetra_MultiVector &Y)
const;
409 int ApplyInverse(
const Epetra_MultiVector &X, Epetra_MultiVector &Y)
const;
412 const char*
Label()
const {
return "Epetra_Operator applying A^{-1}M"; };
427 const Epetra_Comm&
Comm()
const {
return Epetra_AOp->Comm(); };
441 #pragma warning(push)
442 #pragma warning(disable:4251)
469 class ANASAZIEPETRA_LIB_DLL_EXPORT
EpetraSymOp :
public virtual Operator<double>,
public virtual Epetra_Operator {
487 int Apply(
const Epetra_MultiVector &X, Epetra_MultiVector &Y)
const;
493 int ApplyInverse(
const Epetra_MultiVector &X, Epetra_MultiVector &Y)
const;
496 const char*
Label()
const {
return "Epetra_Operator applying A^TA or AA^T"; };
511 const Epetra_Comm&
Comm()
const {
return Epetra_Op->Comm(); };
523 #pragma warning(push)
524 #pragma warning(disable:4251)
559 bool isTrans =
false );
574 #pragma warning(push)
575 #pragma warning(disable:4251)
623 #pragma warning(push)
624 #pragma warning(disable:4251)
672 #pragma warning(push)
673 #pragma warning(disable:4251)
715 Clone (
const Epetra_MultiVector& mv,
const int outNumVecs)
718 "Belos::MultiVecTraits<double, Epetra_MultiVector>::"
719 "Clone(mv, outNumVecs = " << outNumVecs <<
"): "
720 "outNumVecs must be positive.");
725 return Teuchos::rcp (
new Epetra_MultiVector (mv.Map(), outNumVecs));
744 CloneCopy (
const Epetra_MultiVector& mv,
const std::vector<int>& index)
747 const int outNumVecs = index.size();
751 "Anasazi::MultiVecTraits<double,Epetra_MultiVector>::"
752 "CloneCopy(mv, index = {}): At least one vector must be"
754 if (outNumVecs > inNumVecs)
756 std::ostringstream os;
757 os <<
"Anasazi::MultiVecTraits<double,Epetra_MultiVector>::"
758 "CloneCopy(mv, index = {";
759 for (
int k = 0; k < outNumVecs - 1; ++k)
760 os << index[k] <<
", ";
761 os << index[outNumVecs-1] <<
"}): There are " << outNumVecs
762 <<
" indices to copy, but only " << inNumVecs <<
" columns of mv.";
770 const int minIndex = *std::min_element (index.begin(), index.end());
771 const int maxIndex = *std::max_element (index.begin(), index.end());
775 std::ostringstream os;
776 os <<
"Anasazi::MultiVecTraits<double,Epetra_MultiVector>::"
777 "CloneCopy(mv, index = {";
778 for (
int k = 0; k < outNumVecs - 1; ++k)
779 os << index[k] <<
", ";
780 os << index[outNumVecs-1] <<
"}): Indices must be nonnegative, but "
781 "the smallest index " << minIndex <<
" is negative.";
784 if (maxIndex >= inNumVecs)
786 std::ostringstream os;
787 os <<
"Anasazi::MultiVecTraits<double,Epetra_MultiVector>::"
788 "CloneCopy(mv, index = {";
789 for (
int k = 0; k < outNumVecs - 1; ++k)
790 os << index[k] <<
", ";
791 os << index[outNumVecs-1] <<
"}): Indices must be strictly less than "
792 "the number of vectors " << inNumVecs <<
" in mv; the largest index "
793 << maxIndex <<
" is out of bounds.";
796 #endif // TEUCHOS_DEBUG
800 std::vector<int>& tmpind =
const_cast< std::vector<int>&
> (index);
801 return Teuchos::rcp (
new Epetra_MultiVector (
Copy, mv, &tmpind[0], index.size()));
809 const int outNumVecs = index.
size();
810 const bool validRange = outNumVecs > 0 && index.
lbound() >= 0 &&
811 index.
ubound() < inNumVecs;
814 std::ostringstream os;
815 os <<
"Anasazi::MultiVecTraits<double,Epetra_MultiVector>::Clone(mv,"
816 "index=[" << index.
lbound() <<
", " << index.
ubound() <<
"]): ";
818 os.str() <<
"Column index range must be nonempty.");
820 os.str() <<
"Column index range must be nonnegative.");
822 os.str() <<
"Column index range must not exceed "
823 "number of vectors " << inNumVecs <<
" in the "
824 "input multivector.");
838 const int outNumVecs = index.size();
842 "Anasazi::MultiVecTraits<double,Epetra_MultiVector>::"
843 "CloneViewNonConst(mv, index = {}): The output view "
844 "must have at least one column.");
845 if (outNumVecs > inNumVecs)
847 std::ostringstream os;
848 os <<
"Anasazi::MultiVecTraits<double,Epetra_MultiVector>::"
849 "CloneViewNonConst(mv, index = {";
850 for (
int k = 0; k < outNumVecs - 1; ++k)
851 os << index[k] <<
", ";
852 os << index[outNumVecs-1] <<
"}): There are " << outNumVecs
853 <<
" indices to view, but only " << inNumVecs <<
" columns of mv.";
861 const int minIndex = *std::min_element (index.begin(), index.end());
862 const int maxIndex = *std::max_element (index.begin(), index.end());
866 std::ostringstream os;
867 os <<
"Anasazi::MultiVecTraits<double,Epetra_MultiVector>::"
868 "CloneViewNonConst(mv, index = {";
869 for (
int k = 0; k < outNumVecs - 1; ++k)
870 os << index[k] <<
", ";
871 os << index[outNumVecs-1] <<
"}): Indices must be nonnegative, but "
872 "the smallest index " << minIndex <<
" is negative.";
875 if (maxIndex >= inNumVecs)
877 std::ostringstream os;
878 os <<
"Anasazi::MultiVecTraits<double,Epetra_MultiVector>::"
879 "CloneViewNonConst(mv, index = {";
880 for (
int k = 0; k < outNumVecs - 1; ++k)
881 os << index[k] <<
", ";
882 os << index[outNumVecs-1] <<
"}): Indices must be strictly less than "
883 "the number of vectors " << inNumVecs <<
" in mv; the largest index "
884 << maxIndex <<
" is out of bounds.";
887 #endif // TEUCHOS_DEBUG
891 std::vector<int>& tmpind =
const_cast< std::vector<int>&
> (index);
892 return Teuchos::rcp (
new Epetra_MultiVector (
View, mv, &tmpind[0], index.size()));
898 const bool validRange = index.
size() > 0 &&
900 index.
ubound() < mv.NumVectors();
903 std::ostringstream os;
904 os <<
"Anasazi::MultiVecTraits<double,Epetra_MultiVector>::CloneView"
905 "NonConst(mv,index=[" << index.
lbound() <<
", " << index.
ubound()
908 os.str() <<
"Column index range must be nonempty.");
910 os.str() <<
"Column index range must be nonnegative.");
912 std::invalid_argument,
913 os.str() <<
"Column index range must not exceed "
914 "number of vectors " << mv.NumVectors() <<
" in "
915 "the input multivector.");
926 CloneView (
const Epetra_MultiVector& mv,
const std::vector<int>& index)
929 const int outNumVecs = index.size();
933 "Belos::MultiVecTraits<double,Epetra_MultiVector>::"
934 "CloneView(mv, index = {}): The output view "
935 "must have at least one column.");
936 if (outNumVecs > inNumVecs)
938 std::ostringstream os;
939 os <<
"Belos::MultiVecTraits<double,Epetra_MultiVector>::"
940 "CloneView(mv, index = {";
941 for (
int k = 0; k < outNumVecs - 1; ++k)
942 os << index[k] <<
", ";
943 os << index[outNumVecs-1] <<
"}): There are " << outNumVecs
944 <<
" indices to view, but only " << inNumVecs <<
" columns of mv.";
952 const int minIndex = *std::min_element (index.begin(), index.end());
953 const int maxIndex = *std::max_element (index.begin(), index.end());
957 std::ostringstream os;
958 os <<
"Belos::MultiVecTraits<double,Epetra_MultiVector>::"
959 "CloneView(mv, index = {";
960 for (
int k = 0; k < outNumVecs - 1; ++k)
961 os << index[k] <<
", ";
962 os << index[outNumVecs-1] <<
"}): Indices must be nonnegative, but "
963 "the smallest index " << minIndex <<
" is negative.";
966 if (maxIndex >= inNumVecs)
968 std::ostringstream os;
969 os <<
"Belos::MultiVecTraits<double,Epetra_MultiVector>::"
970 "CloneView(mv, index = {";
971 for (
int k = 0; k < outNumVecs - 1; ++k)
972 os << index[k] <<
", ";
973 os << index[outNumVecs-1] <<
"}): Indices must be strictly less than "
974 "the number of vectors " << inNumVecs <<
" in mv; the largest index "
975 << maxIndex <<
" is out of bounds.";
978 #endif // TEUCHOS_DEBUG
982 std::vector<int>& tmpind =
const_cast< std::vector<int>&
> (index);
983 return Teuchos::rcp (
new Epetra_MultiVector (
View, mv, &tmpind[0], index.size()));
989 const bool validRange = index.
size() > 0 &&
991 index.
ubound() < mv.NumVectors();
994 std::ostringstream os;
995 os <<
"Anasazi::MultiVecTraits<double,Epetra_MultiVector>::CloneView"
996 "(mv,index=[" << index.
lbound() <<
", " << index.
ubound()
999 os.str() <<
"Column index range must be nonempty.");
1001 os.str() <<
"Column index range must be nonnegative.");
1003 std::invalid_argument,
1004 os.str() <<
"Column index range must not exceed "
1005 "number of vectors " << mv.NumVectors() <<
" in "
1006 "the input multivector.");
1018 {
return mv.GlobalLength(); }
1022 {
return mv.NumVectors(); }
1024 static bool HasConstantStride(
const Epetra_MultiVector& mv )
1025 {
return mv.ConstantStride(); }
1035 double beta, Epetra_MultiVector& mv )
1037 Epetra_LocalMap LocalMap(B.
numRows(), 0, mv.Map().Comm());
1041 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvNorm call to Epetra_MultiVector::Multiply() returned a nonzero value.");
1046 static void MvAddMv(
double alpha,
const Epetra_MultiVector& A,
double beta,
const Epetra_MultiVector& B, Epetra_MultiVector& mv )
1080 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvAddMv call to Epetra_MultiVector::Update(alpha,A,0.0) returned a nonzero value.");
1083 else if (alpha == 0.0) {
1091 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvAddMv call to Epetra_MultiVector::Update(beta,B,0.0) returned a nonzero value.");
1097 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvAddMv call to Epetra_MultiVector::Update(alpha,A,beta,B,0.0) returned a nonzero value.");
1104 #ifdef HAVE_ANASAZI_EXPERIMENTAL
1109 Epetra_LocalMap LocalMap(B.numRows(), 0, mv.Map().Comm());
1110 Epetra_MultiVector B_Pvec(::
View, LocalMap, B.values(), B.stride(), B.numCols());
1113 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvTransMv call to Epetra_MultiVector::Multiply() returned a nonzero value.");
1118 static void MvDot(
const Epetra_MultiVector& A,
const Epetra_MultiVector& B, std::vector<double> &b
1119 #ifdef HAVE_ANASAZI_EXPERIMENTAL
1124 #ifdef TEUCHOS_DEBUG
1126 "Anasazi::MultiVecTraits<double,Epetra_MultiVector>::MvDot(A,B,b): A and B must have the same number of vectors.");
1128 "Anasazi::MultiVecTraits<double,Epetra_MultiVector>::MvDot(A,B,b): b must have room for all dot products.");
1131 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvDot(A,B,b) call to Epetra_MultiVector::Dot() returned a nonzero value.");
1141 static void MvNorm(
const Epetra_MultiVector& mv, std::vector<double> &normvec )
1143 #ifdef TEUCHOS_DEBUG
1145 "Anasazi::MultiVecTraits<double,Epetra_MultiVector>::MvNorm(mv,normvec): normvec must be the same size of mv.");
1148 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvNorm call to Epetra_MultiVector::Norm2() returned a nonzero value.");
1159 const std::vector<int>& index,
1160 Epetra_MultiVector& mv)
1163 const int outNumVecs = index.size();
1171 if (inNumVecs != outNumVecs)
1173 std::ostringstream os;
1174 os <<
"Belos::MultiVecTraits<double,Epetra_MultiVector>::"
1175 "SetBlock(A, mv, index = {";
1178 for (
int k = 0; k < outNumVecs - 1; ++k)
1179 os << index[k] <<
", ";
1180 os << index[outNumVecs-1];
1182 os <<
"}): A has only " << inNumVecs <<
" columns, but there are "
1183 << outNumVecs <<
" indices in the index vector.";
1193 if (outNumVecs == inNumVecs)
1194 A_view = Teuchos::rcpFromRef (A);
1209 SetBlock (
const Epetra_MultiVector& A,
1211 Epetra_MultiVector& mv)
1213 const int numColsA = A.NumVectors();
1214 const int numColsMv = mv.NumVectors();
1216 const bool validIndex = index.
lbound() >= 0 && index.
ubound() < numColsMv;
1218 const bool validSource = index.
size() <= numColsA;
1220 if (! validIndex || ! validSource)
1222 std::ostringstream os;
1223 os <<
"Anasazi::MultiVecTraits<double, Epetra_MultiVector>::SetBlock"
1224 "(A, index=[" << index.
lbound() <<
", " << index.
ubound() <<
"], "
1227 os.str() <<
"Range lower bound must be nonnegative.");
1229 os.str() <<
"Range upper bound must be less than "
1230 "the number of columns " << numColsA <<
" in the "
1231 "'mv' output argument.");
1233 os.str() <<
"Range must have no more elements than"
1234 " the number of columns " << numColsA <<
" in the "
1235 "'A' input argument.");
1244 if (index.
lbound() == 0 && index.
ubound()+1 == numColsMv)
1245 mv_view = Teuchos::rcpFromRef (mv);
1253 if (index.
size() == numColsA)
1254 A_view = Teuchos::rcpFromRef (A);
1269 Assign (
const Epetra_MultiVector& A,
1270 Epetra_MultiVector& mv)
1274 if (numColsA > numColsMv)
1276 std::ostringstream os;
1277 os <<
"Anasazi::MultiVecTraits<double, Epetra_MultiVector>::Assign"
1280 os.str() <<
"Input multivector 'A' has "
1281 << numColsA <<
" columns, but output multivector "
1282 "'mv' has only " << numColsMv <<
" columns.");
1287 if (numColsMv == numColsA)
1288 mv_view = Teuchos::rcpFromRef (mv);
1304 static void MvScale ( Epetra_MultiVector& mv,
double alpha )
1307 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvScale call to Epetra_MultiVector::Scale(mv,double alpha) returned a nonzero value.");
1312 static void MvScale ( Epetra_MultiVector& mv,
const std::vector<double>& alpha )
1315 int numvecs = mv.NumVectors();
1316 #ifdef TEUCHOS_DEBUG
1318 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvScale(mv,vector alpha): size of alpha inconsistent with number of vectors in mv.")
1320 for (
int i=0; i<numvecs; i++) {
1322 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvScale call to Epetra_MultiVector::Scale() returned a nonzero value.");
1331 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvRandom call to Epetra_MultiVector::Random() returned a nonzero value.");
1339 "Anasazi::MultiVecTraits<double, Epetra_MultiVector>::MvInit call to Epetra_MultiVector::PutScalar() returned a nonzero value.");
1349 static void MvPrint(
const Epetra_MultiVector& mv, std::ostream& os )
1350 { os << mv << std::endl; }
1354 #if defined(HAVE_ANASAZI_TPETRA) && defined(HAVE_ANASAZI_TSQR)
1355 # if defined(HAVE_TPETRA_EPETRA)
1356 typedef Epetra::TsqrAdaptor tsqr_adaptor_type;
1362 # endif // defined(HAVE_TPETRA_EPETRA)
1363 #endif // defined(HAVE_ANASAZI_TPETRA) && defined(HAVE_ANASAZI_TSQR)
1391 static void Apply (
const Epetra_Operator& Op,
1392 const Epetra_MultiVector& x,
1393 Epetra_MultiVector& y )
1395 #ifdef TEUCHOS_DEBUG
1397 "Anasazi::OperatorTraits<double,Epetra_MultiVector,Epetra_Operator>::Apply(Op,x,y): x and y must have the same number of columns.");
1399 int ret = Op.Apply(x,y);
1401 "Anasazi::OperatorTraits<double,Epetra_Multivector,Epetra_Operator>::Apply(): Error in Epetra_Operator::Apply(). Code " << ret);
1407 class MultiVecTraitsExt<double, Epetra_MultiVector>
1417 if (mv.Map().GlobalIndicesLongLong())
1418 return static_cast<ptrdiff_t>( mv.GlobalLength64() );
1420 return static_cast<ptrdiff_t
>( mv.GlobalLength() );
ScalarType * values() const
void MvRandom()
Fill the vectors in *this with random numbers.
Adapter class for creating an operators often used in solving generalized eigenproblems.
EpetraMultiVecAccessor is an interfaceto allow any Anasazi::MultiVec implementation that is based on ...
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
static void MvAddMv(double alpha, const Epetra_MultiVector &A, double beta, const Epetra_MultiVector &B, Epetra_MultiVector &mv)
Replace mv with .
void MvInit(double alpha)
Replace each element of the vectors in *this with alpha.
static ptrdiff_t GetGlobalLength(const MV &mv)
static void SetBlock(const Epetra_MultiVector &A, const std::vector< int > &index, Epetra_MultiVector &mv)
Copy the vectors in A to a set of vectors in mv indicated by the indices given in index...
virtual ~EpetraMultiVecAccessor()
Destructor.
~EpetraSymMVOp()
Destructor.
Adapter class for creating a weighted symmetric operator from an Epetra_MultiVector and Epetra_Operat...
static void MvInit(Epetra_MultiVector &mv, double alpha=Teuchos::ScalarTraits< double >::zero())
Replace each element of the vectors in mv with alpha.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
~EpetraWSymMVOp()
Destructor.
Virtual base class which defines basic traits for the operator type.
const char * Label() const
Returns a character string describing the operator.
void MvNorm(std::vector< double > &normvec) const
Compute the 2-norm of each individual vector of *this. Upon return, normvec[i] holds the 2-norm of th...
virtual Epetra_MultiVector * GetEpetraMultiVec()
Return the pointer to the Epetra_MultiVector object.
static void MvPrint(const Epetra_MultiVector &mv, std::ostream &os)
Print the mv multi-vector to the os output stream.
static void MvRandom(Epetra_MultiVector &mv)
Replace the vectors in mv with random vectors.
static void MvTransMv(double alpha, const Epetra_MultiVector &A, const Epetra_MultiVector &mv, Teuchos::SerialDenseMatrix< int, double > &B)
Compute a dense matrix B through the matrix-matrix multiply .
static void Assign(const MV &A, MV &mv)
mv := A
int GetVecLength() const
Obtain the number of vectors in *this.
An exception class parent to all Anasazi exceptions.
Interface for multivectors used by Anasazi' linear solvers.
Basic adapter class for Anasazi::Operator that uses Epetra_Operator.
static void MvDot(const Epetra_MultiVector &A, const Epetra_MultiVector &B, std::vector< double > &b)
Compute a vector b where the components are the individual dot-products of the i-th columns of A and ...
const char * Label() const
Returns a character string describing the operator.
bool HasNormInf() const
Returns true if this object can provide an approximate inf-norm [always false for this operator]...
ptrdiff_t GetGlobalLength() const
ConjType
Enumerated types used to specify conjugation arguments.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
static Teuchos::RCP< Epetra_MultiVector > CloneCopy(const Epetra_MultiVector &mv, const std::vector< int > &index)
Creates a new Epetra_MultiVector and copies the selected contents of mv into the new vector (deep cop...
Epetra_MultiVector * GetEpetraMultiVec()
Return the pointer to the Epetra_MultiVector object.
bool HasNormInf() const
Returns true if this object can provide an approximate inf-norm [always false for this operator]...
int GetNumberVecs() const
The number of vectors (i.e., columns) in the multivector.
static void MvScale(Epetra_MultiVector &mv, const std::vector< double > &alpha)
Scale each element of the i-th vector in mv with alpha[i].
const Epetra_Comm & Comm() const
Returns the Epetra_Comm communicator associated with this operator.
static void MvTimesMatAddMv(double alpha, const Epetra_MultiVector &A, const Teuchos::SerialDenseMatrix< int, double > &B, double beta, Epetra_MultiVector &mv)
Update mv with .
Traits class which defines basic operations on multivectors.
static Teuchos::RCP< MV > CloneCopy(const MV &mv)
Creates a new MV and copies contents of mv into the new vector (deep copy).
static Teuchos::RCP< const Epetra_MultiVector > CloneView(const Epetra_MultiVector &mv, const std::vector< int > &index)
Creates a new const Epetra_MultiVector that shares the selected contents of mv (shallow copy)...
Adapter class for creating a weighted operator from an Epetra_MultiVector and Epetra_Operator.
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
bool UseTranspose() const
Returns the current UseTranspose setting [always false for this operator].
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
const Epetra_MultiVector * GetEpetraMultiVec() const
Return the pointer to the Epetra_MultiVector object.
static Teuchos::RCP< Epetra_MultiVector > Clone(const Epetra_MultiVector &mv, const int outNumVecs)
Creates a new empty Epetra_MultiVector containing numVecs columns.
Anasazi header file which uses auto-configuration information to include necessary C++ headers...
double NormInf() const
Returns the infinity norm of the global matrix [not functional for this operator].
static Teuchos::RCP< MV > CloneViewNonConst(MV &mv, const std::vector< int > &index)
Creates a new MV that shares the selected contents of mv (shallow copy).
int SetUseTranspose(bool)
If set true, the transpose of this operator will be applied [not functional for this operator]...
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
Adapter class for creating a symmetric operator from an Epetra_Operator.
static Teuchos::RCP< const MV > CloneView(const MV &mv, const std::vector< int > &index)
Creates a new const MV that shares the selected contents of mv (shallow copy).
void MvScale(double alpha)
Scale each element of the vectors in *this with alpha.
static void MvScale(Epetra_MultiVector &mv, double alpha)
Scale each element of the vectors in mv with alpha.
static void SetBlock(const MV &A, const std::vector< int > &index, MV &mv)
Copy the vectors in A to a set of vectors in mv indicated by the indices given in index...
static void Apply(const Epetra_Operator &Op, const Epetra_MultiVector &x, Epetra_MultiVector &y)
This method takes the Epetra_MultiVector x and applies the Epetra_Operator Op to it resulting in the ...
~EpetraW2SymMVOp()
Destructor.
static int GetNumberVecs(const MV &mv)
Obtain the number of vectors in mv.
OrdinalType numCols() const
const Epetra_Comm & Comm() const
Returns the Epetra_Comm communicator associated with this operator.
Templated virtual class for creating operators that can interface with the Anasazi::OperatorTraits cl...
static Teuchos::RCP< Epetra_MultiVector > CloneViewNonConst(Epetra_MultiVector &mv, const std::vector< int > &index)
Creates a new Epetra_MultiVector that shares the selected contents of mv (shallow copy)...
EpetraMultiVecFailure is thrown when a return value from an Epetra call on an Epetra_MultiVector is n...
Types and exceptions used within Anasazi solvers and interfaces.
bool UseTranspose() const
Returns the current UseTranspose setting [always false for this operator].
static int GetVecLength(const Epetra_MultiVector &mv)
Obtain the vector length of mv.
virtual const Epetra_MultiVector * GetEpetraMultiVec() const
Return the pointer to the Epetra_MultiVector object.
Interface for multivectors used by Anasazi's linear solvers.
Adapter class for creating a symmetric operator from an Epetra_MultiVector.
static void MvNorm(const Epetra_MultiVector &mv, std::vector< double > &normvec)
Compute the 2-norm of each individual vector of mv. Upon return, normvec[i] holds the value of ...
static int GetNumberVecs(const Epetra_MultiVector &mv)
Obtain the number of vectors in mv.
static Teuchos::RCP< Epetra_MultiVector > CloneCopy(const Epetra_MultiVector &mv)
Creates a new Epetra_MultiVector and copies contents of mv into the new vector (deep copy)...
Anasazi's templated virtual class for constructing an operator that can interface with the OperatorTr...
virtual ~EpetraMultiVec()
Destructor.
int SetUseTranspose(bool)
If set true, the transpose of this operator will be applied [not functional for this operator]...
double NormInf() const
Returns the infinity norm of the global matrix [not functional for this operator].
OrdinalType stride() const
OrdinalType numRows() const
EpetraOpFailure is thrown when a return value from an Epetra call on an Epetra_Operator is non-zero...
void MvPrint(std::ostream &os) const
Print *this EpetraMultiVec.
Exceptions thrown to signal error in operator application.
Basic adapter class for Anasazi::MultiVec that uses Epetra_MultiVector.