46 #ifndef XPETRA_EPETRAINTVECTOR_HPP 47 #define XPETRA_EPETRAINTVECTOR_HPP 58 #include "Epetra_IntVector.h" 63 template<
class EpetraGlobalOrdinal,
class Node>
64 class EpetraIntVectorT
65 :
public Vector<int,int,EpetraGlobalOrdinal, Node>
143 Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVector(
size_t j)
const {
148 Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVectorNonConst(
size_t j) {
154 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
return Teuchos::ArrayRCP<const int>(); }
177 void scale (Teuchos::ArrayView< const int > alpha) {
191 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) {
215 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"); }
220 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
262 return std::string(
"");
266 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const { }
277 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap ()
const {
278 return Teuchos::null;
300 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 303 typename dual_view_type::t_host_um getHostLocalView ()
const {
304 throw std::runtime_error(
"EpetraIntVector does not support device views! Must be implemented extra...");
305 typename dual_view_type::t_host_um ret;
309 typename dual_view_type::t_dev_um getDeviceLocalView()
const {
310 throw std::runtime_error(
"Epetra does not support device views!");
311 typename dual_view_type::t_dev_um ret;
325 template<
class TargetDeviceType>
326 typename Kokkos::Impl::if_c<
327 Kokkos::Impl::is_same<
328 typename dual_view_type::t_dev_um::execution_space::memory_space,
329 typename TargetDeviceType::memory_space>::value,
330 typename dual_view_type::t_dev_um,
331 typename dual_view_type::t_host_um>::type
332 getLocalView ()
const {
333 return this->MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
354 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES 357 :
public virtual Vector<int,int,int,EpetraNode>
373 vec_ = rcp(
new Epetra_IntVector(eMap->getEpetra_BlockMap(), zeroOut));
423 void putScalar(
const int &value) { vec_->PutValue(value); }
440 Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVector(
size_t j)
const {
445 Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVectorNonConst(
size_t j) {
451 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
454 int * data = vec_->Values();
455 int localLength = vec_->MyLength();
457 return ArrayRCP<int>(data, 0, localLength,
false);
465 int * data = vec_->Values();
466 int localLength = vec_->MyLength();
468 return ArrayRCP<int>(data, 0, localLength,
false);
506 void scale (Teuchos::ArrayView< const int > alpha) {
520 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) {
544 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"); }
549 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
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_IntVector & v = *tSource.getEpetra_IntVector();
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_IntVector & v = *tDest.getEpetra_IntVector();
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_IntVector & v = *tSource.getEpetra_IntVector();
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_IntVector & v = *tDest.getEpetra_IntVector();
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.");
688 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 691 typename dual_view_type::t_host_um getHostLocalView ()
const {
692 typedef Kokkos::View<
typename dual_view_type::t_host::data_type ,
694 typename dual_view_type::t_host::device_type ,
695 Kokkos::MemoryUnmanaged> epetra_view_type;
699 vec_->ExtractView(&data);
700 int localLength = vec_->MyLength();
703 epetra_view_type test = epetra_view_type(data, localLength,1);
704 typename dual_view_type::t_host_um ret = subview(test, Kokkos::ALL(), Kokkos::ALL());
709 typename dual_view_type::t_dev_um getDeviceLocalView()
const {
710 throw std::runtime_error(
"Epetra does not support device views!");
711 typename dual_view_type::t_dev_um ret;
725 template<
class TargetDeviceType>
726 typename Kokkos::Impl::if_c<
727 Kokkos::Impl::is_same<
728 typename dual_view_type::t_dev_um::execution_space::memory_space,
729 typename TargetDeviceType::memory_space>::value,
730 typename dual_view_type::t_dev_um,
731 typename dual_view_type::t_host_um>::type
732 getLocalView ()
const {
733 return this->MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
746 const this_type* rhsPtr =
dynamic_cast<const this_type*
> (&rhs);
747 TEUCHOS_TEST_FOR_EXCEPTION(
748 rhsPtr == NULL, std::invalid_argument,
"Xpetra::MultiVector::operator=: " 749 "The left-hand side (LHS) of the assignment has a different type than " 750 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT " 751 "(which means it wraps an Epetra_IntVector), but the RHS has some " 752 "other type. This probably means that the RHS wraps either an " 753 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector " 754 "does not currently implement assignment from a Tpetra object to an " 755 "Epetra object, though this could be added with sufficient interest.");
757 RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector ();
760 TEUCHOS_TEST_FOR_EXCEPTION(
761 rhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 762 "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of " 763 "the assignment) has a null RCP<Epetra_IntVector> inside. Please " 764 "report this bug to the Xpetra developers.");
765 TEUCHOS_TEST_FOR_EXCEPTION(
766 lhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 767 "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the " 768 "assignment has a null RCP<Epetra_IntVector> inside. Please report " 769 "this bug to the Xpetra developers.");
783 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES 786 :
public virtual Vector<int,int,long long,EpetraNode>
802 vec_ = rcp(
new Epetra_IntVector(eMap->getEpetra_BlockMap(), zeroOut));
851 void putScalar(
const int &value) { vec_->PutValue(value); }
868 Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVector(
size_t j)
const {
873 Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > >
getVectorNonConst(
size_t j) {
879 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
882 int * data = vec_->Values();
883 int localLength = vec_->MyLength();
885 return ArrayRCP<int>(data, 0, localLength,
false);
893 int * data = vec_->Values();
894 int localLength = vec_->MyLength();
896 return ArrayRCP<int>(data, 0, localLength,
false);
934 void scale (Teuchos::ArrayView< const int > alpha) {
948 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) {
972 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"); }
977 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
1022 std::ostringstream oss;
1023 oss << Teuchos::Describable::description();
1030 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
1036 using Teuchos::VERB_DEFAULT;
1037 using Teuchos::VERB_NONE;
1038 using Teuchos::VERB_LOW;
1039 using Teuchos::VERB_MEDIUM;
1040 using Teuchos::VERB_HIGH;
1041 using Teuchos::VERB_EXTREME;
1043 if (verbLevel > Teuchos::VERB_NONE)
1056 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap ()
const {
1057 RCP<const Epetra_BlockMap> map = rcp(
new Epetra_BlockMap(vec_->Map()));
1068 const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
1069 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1070 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1080 const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
1081 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1082 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1092 const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
1093 int err = vec_->Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1094 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1104 const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
1105 int err = vec_->Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1106 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1116 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 1119 typename dual_view_type::t_host_um getHostLocalView ()
const {
1120 typedef Kokkos::View<
typename dual_view_type::t_host::data_type ,
1122 typename dual_view_type::t_host::device_type ,
1123 Kokkos::MemoryUnmanaged> epetra_view_type;
1127 vec_->ExtractView(&data);
1128 int localLength = vec_->MyLength();
1131 epetra_view_type test = epetra_view_type(data, localLength, 1);
1132 typename dual_view_type::t_host_um ret = subview(test, Kokkos::ALL(), Kokkos::ALL());
1137 typename dual_view_type::t_dev_um getDeviceLocalView()
const {
1138 throw std::runtime_error(
"Epetra does not support device views!");
1139 typename dual_view_type::t_dev_um ret;
1153 template<
class TargetDeviceType>
1154 typename Kokkos::Impl::if_c<
1155 Kokkos::Impl::is_same<
1156 typename dual_view_type::t_dev_um::execution_space::memory_space,
1157 typename TargetDeviceType::memory_space>::value,
1158 typename dual_view_type::t_dev_um,
1159 typename dual_view_type::t_host_um>::type
1160 getLocalView ()
const {
1161 return this->MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
1174 const this_type* rhsPtr =
dynamic_cast<const this_type*
> (&rhs);
1175 TEUCHOS_TEST_FOR_EXCEPTION(
1176 rhsPtr == NULL, std::invalid_argument,
"Xpetra::MultiVector::operator=: " 1177 "The left-hand side (LHS) of the assignment has a different type than " 1178 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT " 1179 "(which means it wraps an Epetra_IntVector), but the RHS has some " 1180 "other type. This probably means that the RHS wraps either an " 1181 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector " 1182 "does not currently implement assignment from a Tpetra object to an " 1183 "Epetra object, though this could be added with sufficient interest.");
1185 RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector ();
1188 TEUCHOS_TEST_FOR_EXCEPTION(
1189 rhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 1190 "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of " 1191 "the assignment) has a null RCP<Epetra_IntVector> inside. Please " 1192 "report this bug to the Xpetra developers.");
1193 TEUCHOS_TEST_FOR_EXCEPTION(
1194 lhsImpl.is_null (), std::logic_error,
"Xpetra::MultiVector::operator= " 1195 "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the " 1196 "assignment has a null RCP<Epetra_IntVector> inside. Please report " 1197 "this bug to the Xpetra developers.");
1200 *lhsImpl = *rhsImpl;
1213 #endif // XPETRA_EPETRAINTVECTOR_HPP RCP< Epetra_IntVector > getEpetra_IntVector() const
RCP< Epetra_IntVector > getEpetra_IntVector() const
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
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.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
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 replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
void setSeed(unsigned int seed)
Set seed for Random function.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
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 norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-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, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
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 scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
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.
void setSeed(unsigned int seed)
Set seed for Random function.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
RCP< Epetra_IntVector > getEpetra_IntVector() const
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
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::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
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 sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
int meanValue() const
Compute mean (average) value of this Vector.
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
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 norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
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)
void scale(Teuchos::ArrayView< const int > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[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).
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.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void setSeed(unsigned int seed)
Set seed for Random function.
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.
Teuchos::ArrayRCP< const int > getData(size_t j) const
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 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.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
std::string description() const
Return a simple one-line description of this object.
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
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 normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
const RCP< const Comm< int > > getComm() const
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-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 sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
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 norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm 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.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void scale(Teuchos::ArrayView< const int > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
const RCP< const Comm< int > > getComm() const
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) 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 sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
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)
#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 scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
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.
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
int maxValue() const
Compute max value of this Vector.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
~EpetraIntVectorT()
Destructor.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
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.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
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 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.
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 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 replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
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).
EpetraGlobalOrdinal GlobalOrdinal
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &A)
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.
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.
#define XPETRA_MONITOR(funcName)
~EpetraIntVectorT()
Destructor.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-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.
Teuchos::ArrayRCP< const int > getData(size_t j) const
void meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
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.
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.
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.
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 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 normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.