46 #ifndef XPETRA_EPETRAINTVECTOR_HPP 47 #define XPETRA_EPETRAINTVECTOR_HPP 52 #include "Xpetra_MultiVector.hpp" 58 #include "Epetra_IntVector.h" 63 template<
class GlobalOrdinal,
class Node>
64 Epetra_IntVector &
toEpetra(Vector<int, int, GlobalOrdinal, Node> &);
66 template<
class GlobalOrdinal,
class Node>
67 const Epetra_IntVector &
toEpetra(
const Vector<int, int, GlobalOrdinal, Node> &);
71 template<
class EpetraGlobalOrdinal,
class Node>
72 class EpetraIntVectorT
73 :
public Vector<int,int,EpetraGlobalOrdinal, Node>
151 Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVector(
size_t j)
const {
156 Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVectorNonConst(
size_t j) {
162 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
return Teuchos::ArrayRCP<const int>(); }
185 void scale (Teuchos::ArrayView< const int > alpha) {
199 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) {
223 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) {
XPETRA_MONITOR(
"EpetraIntVectorT::multiply"); TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Not available in Epetra"); }
228 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
273 return std::string(
"");
277 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const { }
288 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap ()
const {
289 return Teuchos::null;
323 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES 326 :
public virtual Vector<int,int,int,EpetraNode>
341 vec_ = rcp(
new Epetra_IntVector(toEpetra<GlobalOrdinal,Node>(map), zeroOut));
391 void putScalar(
const int &value) { vec_->PutValue(value); }
408 Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVector(
size_t )
const {
413 Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVectorNonConst(
size_t ) {
419 Teuchos::ArrayRCP<const int>
getData(
size_t )
const {
422 int * data = vec_->Values();
423 int localLength = vec_->MyLength();
425 return ArrayRCP<int>(data, 0, localLength,
false);
433 int * data = vec_->Values();
434 int localLength = vec_->MyLength();
436 return ArrayRCP<int>(data, 0, localLength,
false);
474 void scale (Teuchos::ArrayView< const int > ) {
488 void update(
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &) {
512 void multiply(Teuchos::ETransp , Teuchos::ETransp ,
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &) {
XPETRA_MONITOR(
"EpetraIntVectorT::multiply"); TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Not available in Epetra"); }
517 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
556 if(!asvec)
return false;
571 std::ostringstream oss;
572 oss << Teuchos::Describable::description();
579 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
585 using Teuchos::VERB_DEFAULT;
586 using Teuchos::VERB_NONE;
587 using Teuchos::VERB_LOW;
588 using Teuchos::VERB_MEDIUM;
589 using Teuchos::VERB_HIGH;
590 using Teuchos::VERB_EXTREME;
592 if (verbLevel > Teuchos::VERB_NONE)
605 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap ()
const {
606 RCP<const Epetra_BlockMap> map = rcp(
new Epetra_BlockMap(vec_->Map()));
617 const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
618 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
619 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
629 const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
630 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
631 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
641 const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
642 int err = vec_->Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
643 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
653 const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
654 int err = vec_->Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
655 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
669 const this_type* rhsPtr =
dynamic_cast<const this_type*
> (&rhs);
670 TEUCHOS_TEST_FOR_EXCEPTION(
671 rhsPtr == NULL, std::invalid_argument,
"Xpetra::MultiVector::operator=: " 672 "The left-hand side (LHS) of the assignment has a different type than " 673 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT " 674 "(which means it wraps an Epetra_IntVector), but the RHS has some " 675 "other type. This probably means that the RHS wraps either an " 676 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector " 677 "does not currently implement assignment from a Tpetra object to an " 678 "Epetra object, though this could be added with sufficient interest.");
680 RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector ();
683 TEUCHOS_TEST_FOR_EXCEPTION(
684 rhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 685 "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of " 686 "the assignment) has a null RCP<Epetra_IntVector> inside. Please " 687 "report this bug to the Xpetra developers.");
688 TEUCHOS_TEST_FOR_EXCEPTION(
689 lhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 690 "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the " 691 "assignment has a null RCP<Epetra_IntVector> inside. Please report " 692 "this bug to the Xpetra developers.");
706 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES 709 :
public virtual Vector<int,int,long long,EpetraNode>
724 vec_ = rcp(
new Epetra_IntVector(toEpetra<GlobalOrdinal,Node>(map), zeroOut));
773 void putScalar(
const int &value) { vec_->PutValue(value); }
790 Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVector(
size_t )
const {
795 Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVectorNonConst(
size_t ) {
801 Teuchos::ArrayRCP<const int>
getData(
size_t )
const {
804 int * data = vec_->Values();
805 int localLength = vec_->MyLength();
807 return ArrayRCP<int>(data, 0, localLength,
false);
815 int * data = vec_->Values();
816 int localLength = vec_->MyLength();
818 return ArrayRCP<int>(data, 0, localLength,
false);
856 void scale (Teuchos::ArrayView< const int > ) {
870 void update(
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &) {
894 void multiply(Teuchos::ETransp , Teuchos::ETransp ,
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &) {
XPETRA_MONITOR(
"EpetraIntVectorT::multiply"); TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Not available in Epetra"); }
899 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
939 if(!asvec)
return false;
953 std::ostringstream oss;
954 oss << Teuchos::Describable::description();
961 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
967 using Teuchos::VERB_DEFAULT;
968 using Teuchos::VERB_NONE;
969 using Teuchos::VERB_LOW;
970 using Teuchos::VERB_MEDIUM;
971 using Teuchos::VERB_HIGH;
972 using Teuchos::VERB_EXTREME;
974 if (verbLevel > Teuchos::VERB_NONE)
987 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap ()
const {
988 RCP<const Epetra_BlockMap> map = rcp(
new Epetra_BlockMap(vec_->Map()));
999 const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
1000 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1001 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1011 const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
1012 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1013 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1023 const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
1024 int err = vec_->Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1025 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1035 const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
1036 int err = vec_->Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1037 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1051 const this_type* rhsPtr =
dynamic_cast<const this_type*
> (&rhs);
1052 TEUCHOS_TEST_FOR_EXCEPTION(
1053 rhsPtr == NULL, std::invalid_argument,
"Xpetra::MultiVector::operator=: " 1054 "The left-hand side (LHS) of the assignment has a different type than " 1055 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT " 1056 "(which means it wraps an Epetra_IntVector), but the RHS has some " 1057 "other type. This probably means that the RHS wraps either an " 1058 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector " 1059 "does not currently implement assignment from a Tpetra object to an " 1060 "Epetra object, though this could be added with sufficient interest.");
1062 RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector ();
1065 TEUCHOS_TEST_FOR_EXCEPTION(
1066 rhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 1067 "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of " 1068 "the assignment) has a null RCP<Epetra_IntVector> inside. Please " 1069 "report this bug to the Xpetra developers.");
1070 TEUCHOS_TEST_FOR_EXCEPTION(
1071 lhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 1072 "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the " 1073 "assignment has a null RCP<Epetra_IntVector> inside. Please report " 1074 "this bug to the Xpetra developers.");
1077 *lhsImpl = *rhsImpl;
1090 #endif // XPETRA_EPETRAINTVECTOR_HPP RCP< Epetra_IntVector > getEpetra_IntVector() const
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
RCP< Epetra_IntVector > getEpetra_IntVector() const
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
void replaceGlobalValue(GlobalOrdinal, size_t, const Scalar &)
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.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
Teuchos::ArrayRCP< const int > getData(size_t) const
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
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).
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
void replaceLocalValue(LocalOrdinal, size_t, const Scalar &)
Replace value, using local (row) index.
void setSeed(unsigned int seed)
Set seed for Random function.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
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)
Teuchos::ArrayRCP< int > getDataNonConst(size_t)
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 2-norm of each vector in multi-vector.
void randomize(bool=true)
Set multi-vector values to random numbers.
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in 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.
Teuchos::ArrayRCP< const int > getData(size_t j) const
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
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).
void meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
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.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &) const
TODO missing comment.
void setSeed(unsigned int)
Set seed for Random function.
void randomize(bool=true)
Set multi-vector values to random numbers.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void replaceLocalValue(LocalOrdinal, size_t, const Scalar &)
Replace value, using local (row) index.
RCP< Epetra_IntVector > getEpetra_IntVector() const
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.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
RCP< Epetra_IntVector > vec_
The Epetra_IntVector which this class wraps.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
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 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.
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &)
void sumIntoGlobalValue(GlobalOrdinal, const Scalar &)
Adds specified value to existing value at the specified location.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t) const
Return a Vector which is a const view of column j.
int meanValue() const
Compute mean (average) value of this Vector.
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
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.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
int maxValue() const
Compute max value of this Vector.
~EpetraIntVectorT()
Destructor.
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
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.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
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.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
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).
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
std::string description() const
Return a simple one-line description of this object.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
void maxValue(const Teuchos::ArrayView< int > &) const
Compute max value of each vector in multi-vector.
std::string description() const
Return a simple one-line description of this object.
void replaceGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Replace value, using global (row) index.
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 1-norm of each vector in multi-vector.
int meanValue() const
Compute mean (average) value of this Vector.
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
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 scale(Teuchos::ArrayView< const int >)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
const RCP< const Comm< int > > getComm() 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, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void scale(Teuchos::ArrayView< const int >)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
Teuchos::ArrayRCP< int > getDataNonConst(size_t)
const RCP< const Comm< int > > getComm() const
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
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.
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.
Exception throws when you call an unimplemented method of Xpetra.
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void replaceGlobalValue(GlobalOrdinal, const Scalar &)
Replace current value at the specified location with specified value.
void sumIntoGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Add value to existing value, using global (row) index.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
void scale(Teuchos::ArrayView< const int > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &)
size_t global_size_t
Global size_t object.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
int meanValue() const
Compute mean (average) value of this Vector.
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 sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
void setSeed(unsigned int)
Set seed for Random function.
int maxValue() const
Compute max value of this 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).
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
~EpetraIntVectorT()
Destructor.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
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 doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
void replaceGlobalValue(GlobalOrdinal, const Scalar &)
Replace current value at the specified location with specified value.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
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 > &) const
Compute max value of each vector in multi-vector.
void sumIntoGlobalValue(GlobalOrdinal, const Scalar &)
Adds specified value to existing value at the specified location.
EpetraGlobalOrdinal GlobalOrdinal
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 normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute Inf-norm of each vector in multi-vector.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace 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)
RCP< Epetra_IntVector > vec_
The Epetra_IntVector which this class wraps.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
CombineMode
Xpetra::Combine Mode enumerable type.
void sumIntoGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Add value to existing value, using global (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 sumIntoLocalValue(LocalOrdinal, size_t, const Scalar &)
Add value to existing value, using local (row) index.
#define XPETRA_MONITOR(funcName)
~EpetraIntVectorT()
Destructor.
void sumIntoLocalValue(LocalOrdinal, size_t, const Scalar &)
Add value to existing value, using local (row) index.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the 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 meanValue(const Teuchos::ArrayView< int > &) const
Compute mean (average) value of each vector in multi-vector.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &) const
TODO missing comment.
virtual size_t getNumVectors() const =0
Number of columns in the multivector.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
Teuchos::ArrayRCP< const int > getData(size_t) const
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
int maxValue() const
Compute max value of this Vector.
EpetraIntVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
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).
std::string description() const
Return a simple one-line description of this object.
EpetraIntVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the 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 scale(const int &)
Scale the current values of a multi-vector, this = alpha*this.
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 meanValue(const Teuchos::ArrayView< int > &) const
Compute mean (average) value of each vector in multi-vector.
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
EpetraIntVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
const RCP< const Comm< int > > getComm() const
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
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.