54 #include "Epetra_SerialComm.h"
61 const std::string tfecfFuncName(
"MultiVector(ArrayOfPtrs)");
63 ": ArrayOfPtrs.size() must be strictly positive and as large as ArrayOfPtrs.");
65 #ifdef HAVE_XPETRA_DEBUG
68 size_t localLength = map->getNodeNumElements();
69 for(
int j=0; j<ArrayOfPtrs.size(); j++) {
71 ": ArrayOfPtrs[" << j <<
"].size() (== " << ArrayOfPtrs[j].size() <<
72 ") is not equal to getLocalLength() (== " << localLength);
80 for(
int i=0; i<ArrayOfPtrs.size(); i++) {
81 arrayOfRawPtrs[i] = ArrayOfPtrs[i].
getRawPtr();
83 double** rawArrayOfRawPtrs =
const_cast<double**
>(arrayOfRawPtrs.getRawPtr());
102 double ** arrayOfPointers;
104 vec_->ExtractView(&arrayOfPointers);
106 double * data = arrayOfPointers[j];
107 int localLength =
vec_->MyLength();
115 double ** arrayOfPointers;
117 vec_->ExtractView(&arrayOfPointers);
119 double * data = arrayOfPointers[j];
120 int localLength =
vec_->MyLength();
142 vec_->NormWeighted(*eWeights.getEpetra_MultiVector(), norms.getRawPtr());
162 XPETRA_DYNAMIC_CAST(
const EpetraImport, importer, tImporter,
"Xpetra::EpetraMultiVector::doImport only accept Xpetra::EpetraImport as input arguments.");
173 XPETRA_DYNAMIC_CAST(
const EpetraImport, importer, tImporter,
"Xpetra::EpetraMultiVector::doImport only accept Xpetra::EpetraImport as input arguments.");
175 RCP<Epetra_MultiVector> v = tDest.getEpetra_MultiVector();
184 XPETRA_DYNAMIC_CAST(
const EpetraExport, exporter, tExporter,
"Xpetra::EpetraMultiVector::doImport only accept Xpetra::EpetraImport as input arguments.");
186 RCP<Epetra_MultiVector> v = tSource.getEpetra_MultiVector();
195 XPETRA_DYNAMIC_CAST(
const EpetraExport, exporter, tExporter,
"Xpetra::EpetraMultiVector::doImport only accept Xpetra::EpetraImport as input arguments.");
197 RCP<Epetra_MultiVector> v = tDest.getEpetra_MultiVector();
209 Epetra_SerialComm SComm;
210 Epetra_Map NewMap(
vec_->MyLength(),
vec_->Map().IndexBase(),SComm);
220 return *tX.getEpetra_MultiVector();
225 return *tX.getEpetra_MultiVector();
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
#define TEUCHOS_TEST_FOR_EXCEPTION_CLASS_FUNC(throw_exception_test, Exception, msg)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
RCP< Epetra_MultiVector > getEpetra_MultiVector() const
Get the underlying Epetra multivector.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, int > > &graph)
void meanValue(const Teuchos::ArrayView< Scalar > &means) const
Compute mean (average) value of each vector in multi-vector. The outcome of this routine is undefined...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
EpetraMultiVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Basic MultiVector constuctor.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
void doExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void doImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
Exception throws when you call an unimplemented method of Xpetra.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
RCP< Epetra_MultiVector > vec_
Teuchos::ArrayRCP< Scalar > getDataNonConst(size_t j)
View of the local values in a particular vector of this multivector.
CombineMode
Xpetra::Combine Mode enumerable type.
#define XPETRA_MONITOR(funcName)
Teuchos::ArrayRCP< const Scalar > getData(size_t j) const
Const view of the local values in a particular vector of this multivector.
void normWeighted(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights, const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
std::string description() const
A simple one-line description of this object.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node, LocalMatOps > > toXpetra(RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node, LocalMatOps > >)
Convert an Epetra_Comm.to a Teuchos_Comm.
void dot(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Teuchos::ArrayView< Scalar > &dots) const
Compute dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i]).
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with the given verbosity level to a FancyOStream.
void replaceMap(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
Replace the map.