46 #ifndef XPETRA_EPETRAINTMULTIVECTOR_HPP 47 #define XPETRA_EPETRAINTMULTIVECTOR_HPP 52 #include "Xpetra_MultiVector.hpp" 57 #include "Epetra_IntMultiVector.h" 62 template<
class GlobalOrdinal,
class Node>
63 Epetra_IntMultiVector &
toEpetra(MultiVector<int, int, GlobalOrdinal, Node> &);
65 template<
class GlobalOrdinal,
class Node>
66 const Epetra_IntMultiVector &
toEpetra(
const MultiVector<int, int, GlobalOrdinal, Node> &);
70 template<
class EpetraGlobalOrdinal,
class Node>
72 :
public MultiVector<int,int,EpetraGlobalOrdinal, Node>
86 "Xpetra::EpetraIntMultiVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
92 "Xpetra::EpetraIntMultiVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
98 "Xpetra::EpetraIntMultiVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
120 "Xpetra::EpetraIntMultiVectorT::setSeed(): Functionnality not available in Epetra"); }
129 Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVector(
size_t j)
const {
130 return Teuchos::null;
134 Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVectorNonConst(
size_t j) {
135 return Teuchos::null;
140 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
141 return Teuchos::ArrayRCP<const int>();
147 return Teuchos::ArrayRCP<int>();
156 const Teuchos::ArrayView<int> &dots)
const {
158 "This function is not implemented in Epetra_IntMultiVector");
167 "This function is not implemented in Epetra_IntMultiVector");
174 void scale (Teuchos::ArrayView< const int > alpha) {
177 "Xpetra::EpetraIntMultiVectorT::scale(): Functionnality not available in Epetra");
184 "Xpetra::EpetraIntMultiVectorT::update(): Functionnality not available in Epetra");
188 void update(
const int &alpha,
const MultiVector<int,int,GlobalOrdinal,Node> &A,
const int &beta,
const MultiVector<int,int,GlobalOrdinal,Node> &B,
const int &gamma) {
191 "Xpetra::EpetraIntMultiVectorT::update(): Functionnality not available in Epetra");
195 void norm1(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
198 "Xpetra::EpetraIntMultiVectorT::norm1(): Functionnality not available in Epetra");
202 void norm2(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
205 "Xpetra::EpetraIntMultiVectorT::norm2(): Functionnality not available in Epetra"); }
208 void normInf(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
211 "Xpetra::EpetraIntMultiVectorT::normInf(): Functionnality not available in Epetra"); }
214 void meanValue(
const Teuchos::ArrayView<int> &means)
const {
217 "Xpetra::EpetraIntMultiVectorT::meanValue(): Functionnality not available in Epetra");
221 void maxValue(
const Teuchos::ArrayView<int> &maxs)
const {
224 "Xpetra::EpetraIntMultiVectorT::maxValue(): Functionnality not available in Epetra");
228 void multiply(Teuchos::ETransp transA, Teuchos::ETransp transB,
const int &alpha,
const MultiVector<int,int,GlobalOrdinal,Node> &A,
const MultiVector<int,int,GlobalOrdinal,Node> &B,
const int &beta) {
231 "Xpetra::EpetraIntMultiVectorT::multiply(): Functionnality not available in Epetra");
238 "Xpetra_EpetraIntMultiVector: elementWiseMultiply not implemented because Epetra_IntMultiVector does not support this operation");
295 return std::string(
"");
299 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const { }
310 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap ()
const {
311 return Teuchos::null;
345 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES 348 :
public virtual MultiVector<int,int,int,EpetraNode>
362 vec_ = rcp(
new Epetra_IntMultiVector(toEpetra<GlobalOrdinal,Node>(map), NumVectors, zeroOut));
368 if (copyOrView==Teuchos::Copy)
369 vec_ = rcp(
new Epetra_IntMultiVector(toEpetra<GlobalOrdinal,Node>(source)));
374 vec_ = Teuchos::rcp(
new Epetra_IntMultiVector(View, toEpetra<GlobalOrdinal,Node>(source), indices,
getNumVectors()));
382 "Xpetra::EpetraIntMultiVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
396 ierr = vec_->PutScalar(value);
415 Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVector(
size_t )
const {
420 Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVectorNonConst(
size_t ) {
426 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
429 int ** arrayOfPointers;
430 vec_->ExtractView(&arrayOfPointers);
431 int * data = arrayOfPointers[j];
432 int localLength = vec_->MyLength();
434 return ArrayRCP<int>(data, 0, localLength,
false);
442 int ** arrayOfPointers;
443 vec_->ExtractView(&arrayOfPointers);
444 int * data = arrayOfPointers[j];
445 int localLength = vec_->MyLength();
447 return ArrayRCP<int>(data, 0, localLength,
false);
456 const Teuchos::ArrayView<int> &)
const {
461 "This function is not implemented in Epetra_IntMultiVector");
468 "This function is not available in Epetra_IntMultiVector");
486 void scale (Teuchos::ArrayView< const int > ) {
500 void update(
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &) {
524 void multiply(Teuchos::ETransp , Teuchos::ETransp ,
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &) {
XPETRA_MONITOR(
"EpetraIntMultiVectorT::multiply"); TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Not available in Epetra"); }
529 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntMultiVector: elementWiseMultiply not implemented because Epetra_IntMultiVector does not support this operation");
539 vec_->ReplaceGlobalValue(globalRow, vectorIndex, value);
544 vec_->SumIntoGlobalValue(globalRow, vectorIndex, value);
549 vec_->ReplaceMyValue(myRow, vectorIndex, value);
554 vec_->SumIntoMyValue(myRow, vectorIndex, value);
564 return vec_->NumVectors();
570 return vec_->MyLength();
579 auto vv = toEpetra<GlobalOrdinal,Node>(vec);
580 return ( (
getLocalLength() == Teuchos::as<size_t>(vv.MyLength())) &&
594 std::ostringstream oss;
595 oss << Teuchos::Describable::description();
602 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
608 using Teuchos::VERB_DEFAULT;
609 using Teuchos::VERB_NONE;
610 using Teuchos::VERB_LOW;
611 using Teuchos::VERB_MEDIUM;
612 using Teuchos::VERB_HIGH;
613 using Teuchos::VERB_EXTREME;
615 if (verbLevel > Teuchos::VERB_NONE)
628 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap ()
const {
629 RCP<const Epetra_BlockMap> map = rcp(
new Epetra_BlockMap(vec_->Map()));
640 const Epetra_IntMultiVector & v = *tSource.getEpetra_IntMultiVector();
641 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
642 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
652 const Epetra_IntMultiVector & v = *tDest.getEpetra_IntMultiVector();
653 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
654 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
664 const Epetra_IntMultiVector & v = *tSource.getEpetra_IntMultiVector();
665 int err = vec_->Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
666 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
676 const Epetra_IntMultiVector & v = *tDest.getEpetra_IntMultiVector();
677 int err = vec_->Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
678 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
684 if (!map.is_null()) {
689 Epetra_SerialComm SComm;
693 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
703 const this_type* rhsPtr =
dynamic_cast<const this_type*
> (&rhs);
704 TEUCHOS_TEST_FOR_EXCEPTION(
705 rhsPtr == NULL, std::invalid_argument,
"Xpetra::MultiVector::operator=: " 706 "The left-hand side (LHS) of the assignment has a different type than " 707 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntMultiVectorT " 708 "(which means it wraps an Epetra_IntMultiVector), but the RHS has some " 709 "other type. This probably means that the RHS wraps either an " 710 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector " 711 "does not currently implement assignment from a Tpetra object to an " 712 "Epetra object, though this could be added with sufficient interest.");
714 RCP<const Epetra_IntMultiVector> rhsImpl = rhsPtr->getEpetra_IntMultiVector ();
717 TEUCHOS_TEST_FOR_EXCEPTION(
718 rhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 719 "(in Xpetra::EpetraIntMultiVectorT::assign): *this (the right-hand side of " 720 "the assignment) has a null RCP<Epetra_IntMultiVector> inside. Please " 721 "report this bug to the Xpetra developers.");
722 TEUCHOS_TEST_FOR_EXCEPTION(
723 lhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 724 "(in Xpetra::EpetraIntMultiVectorT::assign): The left-hand side of the " 725 "assignment has a null RCP<Epetra_IntMultiVector> inside. Please report " 726 "this bug to the Xpetra developers.");
735 RCP< Epetra_IntMultiVector >
vec_;
740 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES 743 :
public virtual MultiVector<int,int,long long,EpetraNode>
757 vec_ = rcp(
new Epetra_IntMultiVector(toEpetra<GlobalOrdinal,Node>(map), NumVectors, zeroOut));
762 vec_ = rcp(
new Epetra_IntMultiVector(toEpetra<GlobalOrdinal,Node>(source)));
768 "Xpetra::EpetraIntMultiVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
782 ierr = vec_->PutScalar(value);
801 Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVector(
size_t )
const {
806 Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVectorNonConst(
size_t ) {
812 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
815 int ** arrayOfPointers;
816 vec_->ExtractView(&arrayOfPointers);
817 int * data = arrayOfPointers[j];
818 int localLength = vec_->MyLength();
820 return ArrayRCP<int>(data, 0, localLength,
false);
828 int ** arrayOfPointers;
829 vec_->ExtractView(&arrayOfPointers);
830 int * data = arrayOfPointers[j];
831 int localLength = vec_->MyLength();
833 return ArrayRCP<int>(data, 0, localLength,
false);
842 const Teuchos::ArrayView<int> &)
const {
853 "This function is not available in Epetra_IntMultiVector");
860 "This function is not implemented in Epetra_IntMultiVector");
870 void scale (Teuchos::ArrayView< const int > ) {
884 void update(
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &) {
908 void multiply(Teuchos::ETransp , Teuchos::ETransp ,
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &) {
XPETRA_MONITOR(
"EpetraIntMultiVectorT::multiply"); TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Not available in Epetra"); }
913 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntMultiVector: elementWiseMultiply not implemented because Epetra_IntMultiVector does not support this operation");
923 vec_->ReplaceGlobalValue(globalRow, vectorIndex, value);
928 vec_->SumIntoGlobalValue(globalRow, vectorIndex, value);
933 vec_->ReplaceMyValue(myRow, vectorIndex, value);
938 vec_->SumIntoMyValue(myRow, vectorIndex, value);
948 return vec_->NumVectors();
962 auto vv = toEpetra<GlobalOrdinal, Node>(vec);
963 return ( (
getLocalLength() == Teuchos::as<size_t>(vv.MyLength())) &&
976 std::ostringstream oss;
977 oss << Teuchos::Describable::description();
984 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
990 using Teuchos::VERB_DEFAULT;
991 using Teuchos::VERB_NONE;
992 using Teuchos::VERB_LOW;
993 using Teuchos::VERB_MEDIUM;
994 using Teuchos::VERB_HIGH;
995 using Teuchos::VERB_EXTREME;
997 if (verbLevel > Teuchos::VERB_NONE)
1010 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap ()
const {
1011 RCP<const Epetra_BlockMap> map = rcp(
new Epetra_BlockMap(vec_->Map()));
1022 const Epetra_IntMultiVector & v = *tSource.getEpetra_IntMultiVector();
1023 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1024 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1034 const Epetra_IntMultiVector & v = *tDest.getEpetra_IntMultiVector();
1035 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1036 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1046 const Epetra_IntMultiVector & v = *tSource.getEpetra_IntMultiVector();
1047 int err = vec_->Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1048 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1058 const Epetra_IntMultiVector & v = *tDest.getEpetra_IntMultiVector();
1059 int err = vec_->Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1060 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1066 if (!map.is_null()) {
1071 Epetra_SerialComm SComm;
1075 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1085 const this_type* rhsPtr =
dynamic_cast<const this_type*
> (&rhs);
1086 TEUCHOS_TEST_FOR_EXCEPTION(
1087 rhsPtr == NULL, std::invalid_argument,
"Xpetra::MultiVector::operator=: " 1088 "The left-hand side (LHS) of the assignment has a different type than " 1089 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntMultiVectorT " 1090 "(which means it wraps an Epetra_IntMultiVector), but the RHS has some " 1091 "other type. This probably means that the RHS wraps either an " 1092 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector " 1093 "does not currently implement assignment from a Tpetra object to an " 1094 "Epetra object, though this could be added with sufficient interest.");
1096 RCP<const Epetra_IntMultiVector> rhsImpl = rhsPtr->getEpetra_IntMultiVector ();
1099 TEUCHOS_TEST_FOR_EXCEPTION(
1100 rhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 1101 "(in Xpetra::EpetraIntMultiVectorT::assign): *this (the right-hand side of " 1102 "the assignment) has a null RCP<Epetra_IntMultiVector> inside. Please " 1103 "report this bug to the Xpetra developers.");
1104 TEUCHOS_TEST_FOR_EXCEPTION(
1105 lhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 1106 "(in Xpetra::EpetraIntMultiVectorT::assign): The left-hand side of the " 1107 "assignment has a null RCP<Epetra_IntMultiVector> inside. Please report " 1108 "this bug to the Xpetra developers.");
1111 *lhsImpl = *rhsImpl;
1124 #endif // XPETRA_EPETRAINTMULTIVECTOR_HPP void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
void meanValue(const Teuchos::ArrayView< int > &) const
Compute mean (average) value of each vector in multi-vector.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t) const
Return a Vector which is a const view of column j.
void meanValue(const Teuchos::ArrayView< int > &) const
Compute mean (average) value of each vector in multi-vector.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute Inf-norm of each vector in multi-vector.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
EpetraIntMultiVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &, const Teuchos::ArrayView< const Teuchos::ArrayView< const Scalar > > &, size_t)
Set multi-vector values from array of pointers using Teuchos memory management classes. (copy).
RCP< Epetra_IntMultiVector > getEpetra_IntMultiVector() const
EpetraIntMultiVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Sets all vector entries to zero.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
EpetraIntMultiVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Sets all vector entries to zero.
RCP< Epetra_IntMultiVector > getEpetra_IntMultiVector() const
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
void update(const int &alpha, const MultiVector< int, int, GlobalOrdinal, Node > &A, const int &beta)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
void maxValue(const Teuchos::ArrayView< int > &) const
Compute max value of each vector in multi-vector.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 2-norm of each vector in multi-vector.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void update(const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
const RCP< const Comm< int > > getComm() const
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
void scale(const int &)
Scale the current values of a multi-vector, this = alpha*this.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
EpetraGlobalOrdinal GlobalOrdinal
std::string description() const
Return a simple one-line description of this object.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
void elementWiseMultiply(int, const Vector< int, int, GlobalOrdinal, Node > &, const MultiVector< int, int, GlobalOrdinal, Node > &, int)
Element-wise multiply of a Vector A with a EpetraMultiVector B.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
void reciprocal(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
Exception throws to report errors in the internal logical of the program.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
void update(const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Update multi-vector with scaled values of A and B, this = gamma*this + alpha*A + beta*B.
EpetraIntMultiVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const Teuchos::ArrayView< const Teuchos::ArrayView< const Scalar > > &ArrayOfPtrs, size_t NumVectors)
Set multi-vector values from array of pointers using Teuchos memory management classes. (copy).
void scale(const int &)
Scale the current values of a multi-vector, this = alpha*this.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
void scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
RCP< Epetra_IntMultiVector > vec_
The Epetra_IntMultiVector which this class wraps.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
void scale(Teuchos::ArrayView< const int >)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void maxValue(const Teuchos::ArrayView< int > &) const
Compute max value of each vector in multi-vector.
void elementWiseMultiply(int, const Vector< int, int, GlobalOrdinal, Node > &, const MultiVector< int, int, GlobalOrdinal, Node > &, int)
Element-wise multiply of a Vector A with a EpetraMultiVector B.
void reciprocal(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
void randomize(bool=true)
Set multi-vector values to random numbers.
void setSeed(unsigned int)
Set seed for Random function.
void scale(Teuchos::ArrayView< const int > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
~EpetraIntMultiVectorT()
Destructor.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 2-norm of each vector in multi-vector.
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
~EpetraIntMultiVectorT()
Destructor.
void update(const int &alpha, const MultiVector< int, int, GlobalOrdinal, Node > &A, const int &beta, const MultiVector< int, int, GlobalOrdinal, Node > &B, const int &gamma)
Update multi-vector with scaled values of A and B, this = gamma*this + alpha*A + beta*B.
bool isSameSize(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &vec) const
Checks to see if the local length, number of vectors and size of Scalar type match.
~EpetraIntMultiVectorT()
Destructor.
const RCP< const Comm< int > > getComm() const
void meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
void dot(const MultiVector< int, int, GlobalOrdinal, Node > &A, const Teuchos::ArrayView< int > &dots) const
Computes dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i]) ...
bool isSameSize(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &vec) const
Checks to see if the local length, number of vectors and size of Scalar type match.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
void update(const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Update multi-vector with scaled values of A and B, this = gamma*this + alpha*A + beta*B.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
void reciprocal(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
Exception throws when you call an unimplemented method of Xpetra.
void setSeed(unsigned int seed)
Set seed for Random function.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
Teuchos::ArrayRCP< const int > getData(size_t j) const
void update(const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
void elementWiseMultiply(int scalarAB, const Vector< int, int, GlobalOrdinal, Node > &A, const MultiVector< int, int, GlobalOrdinal, Node > &B, int scalarThis)
Element-wise multiply of a Vector A with a EpetraMultiVector B.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
void scale(Teuchos::ArrayView< const int >)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
size_t global_size_t
Global size_t object.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
EpetraIntMultiVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &, const Teuchos::ArrayView< const Teuchos::ArrayView< const Scalar > > &, size_t)
Set multi-vector values from array of pointers using Teuchos memory management classes. (copy).
void randomize(bool=true)
Set multi-vector values to random numbers.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute Inf-norm of each vector in multi-vector.
void multiply(Teuchos::ETransp, Teuchos::ETransp, const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Matrix-Matrix multiplication, this = beta*this + alpha*op(A)*op(B).
bool isSameSize(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &vec) const
Checks to see if the local length, number of vectors and size of Scalar type match.
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
RCP< Epetra_IntMultiVector > vec_
The Epetra_IntMultiVector which this class wraps.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void multiply(Teuchos::ETransp, Teuchos::ETransp, const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Matrix-Matrix multiplication, this = beta*this + alpha*op(A)*op(B).
EpetraIntMultiVectorT(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Teuchos::DataAccess copyOrView=Teuchos::Copy)
MultiVector copy constructor.
CombineMode
Xpetra::Combine Mode enumerable type.
void setSeed(unsigned int)
Set seed for Random function.
EpetraIntMultiVectorT(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Teuchos::DataAccess copyOrView=Teuchos::Copy)
MultiVector copy constructor.
#define XPETRA_MONITOR(funcName)
std::string description() const
Return a simple one-line description of this object.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 1-norm of each vector in multi-vector.
EpetraIntMultiVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Sets all vector entries to zero.
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
Teuchos::ArrayRCP< const int > getData(size_t j) const
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
RCP< Epetra_IntMultiVector > getEpetra_IntMultiVector() const
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 1-norm of each vector in multi-vector.
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
std::string description() const
Return a simple one-line description of this object.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
Teuchos::ArrayRCP< const int > getData(size_t j) const
const RCP< const Comm< int > > getComm() const
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t) const
Return a Vector which is a const view of column j.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
EpetraIntMultiVectorT(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source)
MultiVector copy constructor.
void multiply(Teuchos::ETransp transA, Teuchos::ETransp transB, const int &alpha, const MultiVector< int, int, GlobalOrdinal, Node > &A, const MultiVector< int, int, GlobalOrdinal, Node > &B, const int &beta)
Matrix-Matrix multiplication, this = beta*this + alpha*op(A)*op(B).