59 const int numvecs,
const int stride)
73 const std::vector<int>& index )
74 :
Epetra_MultiVector(CV, P_vec, &(const_cast<std::vector<int> &>(index))[0], index.size())
137 int numvecs = index.size();
139 std::vector<int> index2( numvecs );
140 for(
int i=0; i<numvecs; i++)
143 TEUCHOS_TEST_FOR_EXCEPTION( tmp_vec==NULL, std::invalid_argument,
"Anasazi::EpetraMultiVec::SetBlocks() cast of MultiVec<double> to EpetraMultiVec failed.");
145 temp_vec.
MvAddMv( 1.0, A_vec, 0.0, A_vec );
148 temp_vec.
MvAddMv( 1.0, A, 0.0, A );
165 TEUCHOS_TEST_FOR_EXCEPTION( A_vec==NULL, std::invalid_argument,
"Anasazi::EpetraMultiVec::SetBlocks() cast of MultiVec<double> to EpetraMultiVec failed.");
168 Multiply(
'N',
'N', alpha, *A_vec, B_Pvec, beta ) != 0,
169 EpetraMultiVecFailure,
"Anasazi::EpetraMultiVec::MvTimesMatAddMv() call to Epetra_MultiVec::Multiply() returned a nonzero value.");
182 TEUCHOS_TEST_FOR_EXCEPTION( A_vec==NULL, std::invalid_argument,
"Anasazi::EpetraMultiVec::MvAddMv() cast of MultiVec<double> to EpetraMultiVec failed.");
184 TEUCHOS_TEST_FOR_EXCEPTION( B_vec==NULL, std::invalid_argument,
"Anasazi::EpetraMultiVec::MvAddMv() cast of MultiVec<double> to EpetraMultiVec failed.");
187 Update( alpha, *A_vec, beta, *B_vec, 0.0 ) != 0,
188 EpetraMultiVecFailure,
"Anasazi::EpetraMultiVec::MvAddMv() call to Epetra_MultiVec::Update() returned a nonzero value.");
199 #ifdef HAVE_ANASAZI_EXPERIMENTAL
208 Epetra_MultiVector B_Pvec(Epetra_DataAccess::View, LocalMap, B.values(), B.stride(), B.numCols());
211 B_Pvec.Multiply(
'T',
'N', alpha, *A_vec, *
this, 0.0 ) != 0,
212 EpetraMultiVecFailure,
"Anasazi::EpetraMultiVec::MvTransMv() call to Epetra_MultiVec::Multiply() returned a nonzero value.");
223 #ifdef HAVE_ANASAZI_EXPERIMENTAL
229 TEUCHOS_TEST_FOR_EXCEPTION( A_vec==NULL, std::invalid_argument,
"Anasazi::EpetraMultiVec::MvDot() cast of MultiVec<double> to EpetraMultiVec failed.");
231 if (( (
int)b.size() >= A_vec->NumVectors() ) ) {
233 this->Dot( *A_vec, &b[0] ) != 0,
234 EpetraMultiVecFailure,
"Anasazi::EpetraMultiVec::MvDot() call to Epetra_MultiVec::Dot() returned a nonzero value.");
246 int numvecs = this->NumVectors();
248 "Anasazi::EpetraMultiVec::MvScale() alpha argument size was inconsistent with number of vectors in mv.");
250 std::vector<int> tmp_index( 1, 0 );
251 for (
int i=0; i<numvecs; i++) {
254 temp_vec.Scale( alpha[i] ) != 0,
255 EpetraMultiVecFailure,
"Anasazi::EpetraMultiVec::MvScale() call to Epetra_MultiVec::Scale() returned a nonzero value.");
290 TEUCHOS_TEST_FOR_EXCEPTION( vec_X==NULL, std::invalid_argument,
"Anasazi::EpetraOp::Apply() cast of MultiVec<double> to Epetra_MultiVector failed.");
291 TEUCHOS_TEST_FOR_EXCEPTION( vec_Y==NULL, std::invalid_argument,
"Anasazi::EpetraOp::Apply() cast of MultiVec<double> to Epetra_MultiVector failed.");
293 int info = Epetra_Op->
Apply( *vec_X, *vec_Y );
295 "Anasazi::EpetraOp::Apply(): Error returned from Epetra_Operator::Apply()" );
311 : isAInverse( isAInverse_ ), Epetra_AOp(AOp), Epetra_MOp(MOp)
332 TEUCHOS_TEST_FOR_EXCEPTION( vec_X==NULL, std::invalid_argument,
"Anasazi::EpetraGenOp::Apply() cast of MultiVec<double> to Epetra_MultiVector failed.");
333 TEUCHOS_TEST_FOR_EXCEPTION( vec_Y==NULL, std::invalid_argument,
"Anasazi::EpetraGenOp::Apply() cast of MultiVec<double> to Epetra_MultiVector failed.");
339 info = Epetra_MOp->
Apply( *vec_X, temp_Y );
341 "Anasazi::EpetraGenOp::Apply(): Error returned from Epetra_Operator::Apply()" );
347 info = Epetra_AOp->
Apply( temp_Y, *vec_Y );
350 "Anasazi::EpetraGenOp::Apply(): Error returned from Epetra_Operator::Apply()" );
362 info = Epetra_MOp->
Apply( X, temp_Y );
363 if (info!=0)
return info;
369 info = Epetra_AOp->
Apply( temp_Y, Y );
384 info = Epetra_AOp->
Apply( X, temp_Y );
387 if (info!=0)
return info;
406 : Epetra_Op(Op), isTrans_(isTrans)
426 vec_X->NumVectors() );
428 TEUCHOS_TEST_FOR_EXCEPTION( vec_X==NULL , std::invalid_argument,
"Anasazi::EpetraSymOp::Apply() cast of MultiVec<double> to Epetra_MultiVector failed.");
429 TEUCHOS_TEST_FOR_EXCEPTION( vec_Y==NULL , std::invalid_argument,
"Anasazi::EpetraSymOp::Apply() cast of MultiVec<double> to Epetra_MultiVector failed.");
430 TEUCHOS_TEST_FOR_EXCEPTION( temp_vec==NULL, std::invalid_argument,
"Anasazi::EpetraSymOp::Apply() allocation Epetra_MultiVector failed.");
441 "Anasazi::EpetraSymOp::Apply(): Error returned from Epetra_Operator::Apply()" );
447 info=Epetra_Op->
Apply( *vec_X, *temp_vec );
451 "Anasazi::EpetraSymOp::Apply(): Error returned from Epetra_Operator::Apply()" );
459 "Anasazi::EpetraSymOp::Apply(): Error returned from Epetra_Operator::Apply()" );
463 info=Epetra_Op->
Apply( *temp_vec, *vec_Y );
467 "Anasazi::EpetraSymOp::Apply(): Error returned from Epetra_Operator::Apply()" );
474 "Anasazi::EpetraSymOp::Apply(): Error returned from Epetra_Operator::Apply()" );
487 if (info!=0) {
return info; }
492 info=Epetra_Op->
Apply( X, temp_vec );
493 if (info!=0) {
return info; }
497 if (info!=0) {
return info; }
500 info=Epetra_Op->
Apply( temp_vec, Y );
501 if (info!=0) {
return info; }
518 if (info!=0) {
return info; }
524 if (info!=0) {
return info; }
528 if (info!=0) {
return info; }
531 info=Epetra_Op->
Apply( temp_vec, Y );
532 if (info!=0) {
return info; }
550 : Epetra_MV(MV), isTrans_(isTrans)
573 info = temp_vec.Multiply(
'T',
'N', 1.0, *Epetra_MV, *vec_X, 0.0 );
575 "Anasazi::EpetraSymMVOp::Apply(): Error returned from Epetra_MultiVector::Multiply()" );
578 info = vec_Y->Multiply(
'N',
'N', 1.0, *Epetra_MV, temp_vec, 0.0 );
580 "Anasazi::EpetraSymMVOp::Apply(): Error returned from Epetra_MultiVector::Multiply()" );
587 info = temp_vec.Multiply(
'N',
'N', 1.0, *Epetra_MV, *vec_X, 0.0 );
589 "Anasazi::EpetraSymMVOp::Apply(): Error returned from Epetra_MultiVector::Multiply()" );
592 info = vec_Y->Multiply(
'T',
'N', 1.0, *Epetra_MV, temp_vec, 0.0 );
594 "Anasazi::EpetraSymMVOp::Apply(): Error returned from Epetra_MultiVector::Multiply()" );
609 : Epetra_MV(MV), Epetra_OP(OP)
613 Epetra_OP->
Apply( *Epetra_MV, *Epetra_WMV );
629 info = temp_vec.Multiply(
'N',
'N', 1.0, *Epetra_WMV, *vec_X, 0.0 );
631 "Anasazi::EpetraWSymMVOp::Apply(): Error returned from Epetra_MultiVector::Multiply()" );
634 info = vec_Y->Multiply(
'T',
'N', 1.0, *Epetra_MV, temp_vec, 0.0 );
636 "Anasazi::EpetraWSymMVOp::Apply(): Error returned from Epetra_MultiVector::Multiply()" );
650 : Epetra_MV(MV), Epetra_OP(OP)
654 Epetra_OP->
Apply( *Epetra_MV, *Epetra_WMV );
670 info = temp_vec.Multiply(
'N',
'N', 1.0, *Epetra_WMV, *vec_X, 0.0 );
672 "Anasazi::EpetraW2SymMVOp::Apply(): Error returned from Epetra_MultiVector::Multiply()" );
675 info = vec_Y->Multiply(
'T',
'N', 1.0, *Epetra_WMV, temp_vec, 0.0 );
677 "Anasazi::EpetraW2SymMVOp::Apply(): Error returned from Epetra_MultiVector::Multiply()" );
ScalarType * values() const
EpetraMultiVecAccessor is an interfaceto allow any Anasazi::MultiVec implementation that is based on ...
MultiVec< double > * CloneViewNonConst(const std::vector< int > &index)
Creates a new EpetraMultiVec that shares the selected contents of *this.
void SetBlock(const MultiVec< double > &A, const std::vector< int > &index)
Copy the vectors in A to a set of vectors in *this.
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
virtual int SetUseTranspose(bool UseTranspose)=0
void Apply(const MultiVec< double > &X, MultiVec< double > &Y) const
Apply method.
void Apply(const MultiVec< double > &X, MultiVec< double > &Y) const
Apply method [inherited from Anasazi::Operator class].
void MvTransMv(double alpha, const MultiVec< double > &A, Teuchos::SerialDenseMatrix< int, double > &B) const
Compute a dense matrix B through the matrix-matrix multiply .
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const =0
void Apply(const MultiVec< double > &X, MultiVec< double > &Y) const
Apply method.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
~EpetraGenOp()
Destructor.
virtual const Epetra_Map & OperatorDomainMap() const =0
void Apply(const MultiVec< double > &X, MultiVec< double > &Y) const
Apply method.
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const =0
EpetraSymMVOp(const Teuchos::RCP< const Epetra_MultiVector > &MV, bool isTrans=false)
Basic constructor for applying operator [default] or .
virtual const Epetra_Map & OperatorRangeMap() const =0
void MvTimesMatAddMv(double alpha, const MultiVec< double > &A, const Teuchos::SerialDenseMatrix< int, double > &B, double beta)
Update *this with .
ConjType
Enumerated types used to specify conjugation arguments.
virtual int GetNumberVecs() const =0
The number of vectors (i.e., columns) in the multivector.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void MvDot(const MultiVec< double > &A, std::vector< double > &b) const
Compute a vector b where the components are the individual dot-products, i.e. where A[i] is the i-th...
EpetraSymOp(const Teuchos::RCP< Epetra_Operator > &Op, bool isTrans=false)
Basic constructor for applying operator [default] or .
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
void MvAddMv(double alpha, const MultiVec< double > &A, double beta, const MultiVec< double > &B)
Replace *this with .
~EpetraSymOp()
Destructor.
void MvScale(double alpha)
Scale each element of the vectors in *this with alpha.
MultiVec< double > * Clone(const int numvecs) const
Creates a new empty EpetraMultiVec containing numvecs columns.
OrdinalType numCols() const
int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Apply inverse method [inherited from Epetra_Operator class].
EpetraW2SymMVOp(const Teuchos::RCP< const Epetra_MultiVector > &MV, const Teuchos::RCP< Epetra_Operator > &OP)
Basic constructor for applying operator .
MultiVec< double > * CloneCopy() const
Creates a new EpetraMultiVec and copies contents of *this into the new vector (deep copy)...
EpetraWSymMVOp(const Teuchos::RCP< const Epetra_MultiVector > &MV, const Teuchos::RCP< Epetra_Operator > &OP)
Basic constructor for applying operator .
EpetraMultiVecFailure is thrown when a return value from an Epetra call on an Epetra_MultiVector is n...
EpetraGenOp(const Teuchos::RCP< Epetra_Operator > &AOp, const Teuchos::RCP< Epetra_Operator > &MOp, bool isAInverse=true)
Basic constructor for applying operator [default] or .
EpetraMultiVec(const Epetra_BlockMap &Map_in, const int numvecs)
Basic EpetraMultiVec constructor.
EpetraOp(const Teuchos::RCP< Epetra_Operator > &Op)
Basic constructor. Accepts reference-counted pointer to an Epetra_Operator.
Declarations of Anasazi multi-vector and operator classes using Epetra_MultiVector and Epetra_Operato...
int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Apply inverse method [inherited from Epetra_Operator class].
OrdinalType stride() const
void Apply(const MultiVec< double > &X, MultiVec< double > &Y) const
This method takes the Anasazi::MultiVec X and applies the operator to it resulting in the Anasazi::Mu...
OrdinalType numRows() const
const MultiVec< double > * CloneView(const std::vector< int > &index) const
Creates a new EpetraMultiVec that shares the selected contents of *this.
Exceptions thrown to signal error in operator application.
Basic adapter class for Anasazi::MultiVec that uses Epetra_MultiVector.
void Apply(const MultiVec< double > &X, MultiVec< double > &Y) const
Apply method [inherited from Anasazi::Operator class].