46#ifndef XPETRA_EPETRAINTMULTIVECTOR_HPP
47#define XPETRA_EPETRAINTMULTIVECTOR_HPP
52#include "Xpetra_MultiVector.hpp"
57#include "Epetra_IntMultiVector.h"
62template<
class GlobalOrdinal,
class Node>
65template<
class GlobalOrdinal,
class 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)");
122 "Xpetra::EpetraIntMultiVectorT::setSeed(): Functionnality not available in Epetra"); }
132 return Teuchos::null;
137 return Teuchos::null;
160 "This function is not implemented in Epetra_IntMultiVector");
169 "This function is not implemented in Epetra_IntMultiVector");
179 "Xpetra::EpetraIntMultiVectorT::scale(): Functionnality not available in Epetra");
186 "Xpetra::EpetraIntMultiVectorT::update(): Functionnality not available in Epetra");
190 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) {
193 "Xpetra::EpetraIntMultiVectorT::update(): Functionnality not available in Epetra");
200 "Xpetra::EpetraIntMultiVectorT::norm1(): Functionnality not available in Epetra");
207 "Xpetra::EpetraIntMultiVectorT::norm2(): Functionnality not available in Epetra"); }
213 "Xpetra::EpetraIntMultiVectorT::normInf(): Functionnality not available in Epetra"); }
219 "Xpetra::EpetraIntMultiVectorT::meanValue(): Functionnality not available in Epetra");
226 "Xpetra::EpetraIntMultiVectorT::maxValue(): Functionnality not available in Epetra");
230 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) {
233 "Xpetra::EpetraIntMultiVectorT::multiply(): Functionnality not available in Epetra");
240 "Xpetra_EpetraIntMultiVector: elementWiseMultiply not implemented because Epetra_IntMultiVector does not support this operation");
297 return std::string(
"");
313 return Teuchos::null;
347#ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
350 :
public virtual MultiVector<int,int,int,EpetraNode>
384 "Xpetra::EpetraIntMultiVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
398 ierr = vec_->PutScalar(value);
434 int ** arrayOfPointers;
435 vec_->ExtractView(&arrayOfPointers);
436 int * data = arrayOfPointers[j];
437 int localLength = vec_->MyLength();
447 int ** arrayOfPointers;
448 vec_->ExtractView(&arrayOfPointers);
449 int * data = arrayOfPointers[j];
450 int localLength = vec_->MyLength();
466 "This function is not implemented in Epetra_IntMultiVector");
473 "This function is not available in Epetra_IntMultiVector");
505 void update(
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &) {
529 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"); }
544 vec_->ReplaceGlobalValue(globalRow, vectorIndex, value);
549 vec_->SumIntoGlobalValue(globalRow, vectorIndex, value);
554 vec_->ReplaceMyValue(myRow, vectorIndex, value);
559 vec_->SumIntoMyValue(myRow, vectorIndex, value);
569 return vec_->NumVectors();
575 return vec_->MyLength();
584 auto vv = toEpetra<GlobalOrdinal,Node>(vec);
585 return ( (
getLocalLength() == Teuchos::as<size_t>(vv.MyLength())) &&
599 std::ostringstream oss;
646 int err = vec_->
Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
658 int err = vec_->
Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
670 int err = vec_->
Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
682 int err = vec_->
Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
689 if (!map.is_null()) {
708 const this_type* rhsPtr =
dynamic_cast<const this_type*
> (&rhs);
710 rhsPtr == NULL, std::invalid_argument,
"Xpetra::MultiVector::operator=: "
711 "The left-hand side (LHS) of the assignment has a different type than "
712 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntMultiVectorT "
713 "(which means it wraps an Epetra_IntMultiVector), but the RHS has some "
714 "other type. This probably means that the RHS wraps either an "
715 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
716 "does not currently implement assignment from a Tpetra object to an "
717 "Epetra object, though this could be added with sufficient interest.");
723 rhsImpl.
is_null (), std::logic_error,
"Xpetra::MultiVector::operator= "
724 "(in Xpetra::EpetraIntMultiVectorT::assign): *this (the right-hand side of "
725 "the assignment) has a null RCP<Epetra_IntMultiVector> inside. Please "
726 "report this bug to the Xpetra developers.");
728 lhsImpl.
is_null (), std::logic_error,
"Xpetra::MultiVector::operator= "
729 "(in Xpetra::EpetraIntMultiVectorT::assign): The left-hand side of the "
730 "assignment has a null RCP<Epetra_IntMultiVector> inside. Please report "
731 "this bug to the Xpetra developers.");
745#ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
748 :
public virtual MultiVector<int,int,long long,EpetraNode>
773 "Xpetra::EpetraIntMultiVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
787 ierr = vec_->PutScalar(value);
823 int ** arrayOfPointers;
824 vec_->ExtractView(&arrayOfPointers);
825 int * data = arrayOfPointers[j];
826 int localLength = vec_->MyLength();
836 int ** arrayOfPointers;
837 vec_->ExtractView(&arrayOfPointers);
838 int * data = arrayOfPointers[j];
839 int localLength = vec_->MyLength();
861 "This function is not available in Epetra_IntMultiVector");
868 "This function is not implemented in Epetra_IntMultiVector");
892 void update(
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &,
const MultiVector<int,int,GlobalOrdinal,Node> &,
const int &) {
916 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"); }
931 vec_->ReplaceGlobalValue(globalRow, vectorIndex, value);
936 vec_->SumIntoGlobalValue(globalRow, vectorIndex, value);
941 vec_->ReplaceMyValue(myRow, vectorIndex, value);
946 vec_->SumIntoMyValue(myRow, vectorIndex, value);
956 return vec_->NumVectors();
970 auto vv = toEpetra<GlobalOrdinal, Node>(vec);
971 return ( (
getLocalLength() == Teuchos::as<size_t>(vv.MyLength())) &&
984 std::ostringstream oss;
1031 int err = vec_->
Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1043 int err = vec_->
Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1055 int err = vec_->
Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1067 int err = vec_->
Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1074 if (!map.is_null()) {
1093 const this_type* rhsPtr =
dynamic_cast<const this_type*
> (&rhs);
1095 rhsPtr == NULL, std::invalid_argument,
"Xpetra::MultiVector::operator=: "
1096 "The left-hand side (LHS) of the assignment has a different type than "
1097 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntMultiVectorT "
1098 "(which means it wraps an Epetra_IntMultiVector), but the RHS has some "
1099 "other type. This probably means that the RHS wraps either an "
1100 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
1101 "does not currently implement assignment from a Tpetra object to an "
1102 "Epetra object, though this could be added with sufficient interest.");
1108 rhsImpl.
is_null (), std::logic_error,
"Xpetra::MultiVector::operator= "
1109 "(in Xpetra::EpetraIntMultiVectorT::assign): *this (the right-hand side of "
1110 "the assignment) has a null RCP<Epetra_IntMultiVector> inside. Please "
1111 "report this bug to the Xpetra developers.");
1113 lhsImpl.
is_null (), std::logic_error,
"Xpetra::MultiVector::operator= "
1114 "(in Xpetra::EpetraIntMultiVectorT::assign): The left-hand side of the "
1115 "assignment has a null RCP<Epetra_IntMultiVector> inside. Please report "
1116 "this bug to the Xpetra developers.");
1119 *lhsImpl = *rhsImpl;
#define XPETRA_MONITOR(funcName)
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
int Import(const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
int Export(const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
static const EVerbosityLevel verbLevel_default
virtual std::string description() const
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t) const
Return a Vector which is a const view of column j.
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 > > &, const Teuchos::ArrayView< const Teuchos::ArrayView< const Scalar > > &, size_t)
Set multi-vector values from array of pointers using Teuchos memory management classes....
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,...
std::string description() const
Return a simple one-line description of this object.
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 1-norm of each vector in multi-vector.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
~EpetraIntMultiVectorT()
Destructor.
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
void randomize(bool=true)
Set multi-vector values to random numbers.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, 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).
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
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 normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute Inf-norm of each vector in multi-vector.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
RCP< Epetra_IntMultiVector > vec_
The Epetra_IntMultiVector which this class wraps.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 2-norm of each vector in multi-vector.
void scale(Teuchos::ArrayView< const int >)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
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 replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void randomize(const Scalar &minVal, const Scalar &maxVal, bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
void setSeed(unsigned int)
Set seed for Random function.
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 doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
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 scale(const int &)
Scale the current values of a multi-vector, this = alpha*this.
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
void maxValue(const Teuchos::ArrayView< int > &) const
Compute max value of each vector in multi-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 replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
EpetraIntMultiVectorT(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Teuchos::DataAccess copyOrView=Teuchos::Copy)
MultiVector copy constructor.
const RCP< const Comm< int > > getComm() const
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void meanValue(const Teuchos::ArrayView< int > &) const
Compute mean (average) value of each vector in multi-vector.
void dot(const MultiVector< int, int, GlobalOrdinal, Node > &, const Teuchos::ArrayView< int > &) const
Computes dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i])
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
Teuchos::ArrayRCP< const int > getData(size_t j) const
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
void randomize(const Scalar &minVal, const Scalar &maxVal, bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
const RCP< const Comm< int > > getComm() const
void dot(const MultiVector< int, int, GlobalOrdinal, Node > &, const Teuchos::ArrayView< int > &) const
Computes dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i])
void maxValue(const Teuchos::ArrayView< int > &) const
Compute max value of each vector in multi-vector.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
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,...
RCP< Epetra_IntMultiVector > getEpetra_IntMultiVector() const
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
Teuchos::ArrayRCP< const int > getData(size_t j) const
void scale(const int &)
Scale the current values of a multi-vector, this = alpha*this.
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.
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 norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 2-norm of each vector in multi-vector.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
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 scale(Teuchos::ArrayView< const int >)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
EpetraIntMultiVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Sets all vector entries to zero.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
~EpetraIntMultiVectorT()
Destructor.
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....
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 meanValue(const Teuchos::ArrayView< int > &) const
Compute mean (average) value of each vector in multi-vector.
void setSeed(unsigned int)
Set seed for Random function.
RCP< Epetra_IntMultiVector > vec_
The Epetra_IntMultiVector which this class wraps.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
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 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 norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 1-norm of each vector in multi-vector.
std::string description() const
Return a simple one-line description of this object.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void randomize(bool=true)
Set multi-vector values to random numbers.
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::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute Inf-norm of each vector in multi-vector.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
EpetraIntMultiVectorT(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source)
MultiVector copy constructor.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t) const
Return a Vector which is a const view of column j.
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).
std::string description() const
Return a simple one-line description of this object.
void setSeed(unsigned int seed)
Set seed for Random function.
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.
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
void meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
EpetraIntMultiVectorT(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Teuchos::DataAccess copyOrView=Teuchos::Copy)
MultiVector copy constructor.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
void randomize(const Scalar &minVal, const Scalar &maxVal, bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
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....
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-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 replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing 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,...
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 doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
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.
const RCP< const Comm< int > > getComm() const
~EpetraIntMultiVectorT()
Destructor.
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])
EpetraGlobalOrdinal GlobalOrdinal
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
Teuchos::ArrayRCP< const int > getData(size_t j) const
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
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.
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
void scale(Teuchos::ArrayView< const int > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
RCP< Epetra_IntMultiVector > getEpetra_IntMultiVector() const
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 doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, 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.
Exception throws when you call an unimplemented method of Xpetra.
Exception throws to report errors in the internal logical of the program.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
size_t global_size_t
Global size_t object.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
CombineMode
Xpetra::Combine Mode enumerable type.