46 #ifndef XPETRA_EPETRAINTMULTIVECTOR_HPP
47 #define XPETRA_EPETRAINTMULTIVECTOR_HPP
52 #include "Xpetra_MultiVector.hpp"
57 #include "Epetra_IntMultiVector.h"
59 #if defined(XPETRA_ENABLE_DEPRECATED_CODE)
61 #warning "The header file Trilinos/packages/xpetra/src/MultiVector/Xpetra_EpetraIntMultiVector.hpp is deprecated."
64 #error "The header file Trilinos/packages/xpetra/src/MultiVector/Xpetra_EpetraIntMultiVector.hpp is deprecated."
70 template <
class GlobalOrdinal,
class Node>
71 XPETRA_DEPRECATED Epetra_IntMultiVector &
toEpetra(MultiVector<int, int, GlobalOrdinal, Node> &);
73 template <
class GlobalOrdinal,
class Node>
74 XPETRA_DEPRECATED
const Epetra_IntMultiVector &
toEpetra(
const MultiVector<int, int, GlobalOrdinal, Node> &);
78 template <
class EpetraGlobalOrdinal,
class Node>
80 :
public MultiVector<int, int, EpetraGlobalOrdinal, Node> {
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)");
104 "Xpetra::EpetraIntMultiVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
135 "Xpetra::EpetraIntMultiVectorT::setSeed(): Functionnality not available in Epetra");
144 Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getVector(
size_t j)
const {
145 return Teuchos::null;
150 return Teuchos::null;
155 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
156 return Teuchos::ArrayRCP<const int>();
162 return Teuchos::ArrayRCP<int>();
171 const Teuchos::ArrayView<int> &dots)
const {
173 "This function is not implemented in Epetra_IntMultiVector");
182 "This function is not implemented in Epetra_IntMultiVector");
189 void scale(Teuchos::ArrayView<const int> alpha) {
192 "Xpetra::EpetraIntMultiVectorT::scale(): Functionnality not available in Epetra");
199 "Xpetra::EpetraIntMultiVectorT::update(): Functionnality not available in Epetra");
203 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) {
206 "Xpetra::EpetraIntMultiVectorT::update(): Functionnality not available in Epetra");
210 void norm1(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
213 "Xpetra::EpetraIntMultiVectorT::norm1(): Functionnality not available in Epetra");
217 void norm2(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
220 "Xpetra::EpetraIntMultiVectorT::norm2(): Functionnality not available in Epetra");
224 void normInf(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
227 "Xpetra::EpetraIntMultiVectorT::normInf(): Functionnality not available in Epetra");
231 void meanValue(
const Teuchos::ArrayView<int> &means)
const {
234 "Xpetra::EpetraIntMultiVectorT::meanValue(): Functionnality not available in Epetra");
238 void maxValue(
const Teuchos::ArrayView<int> &maxs)
const {
241 "Xpetra::EpetraIntMultiVectorT::maxValue(): Functionnality not available in Epetra");
245 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) {
248 "Xpetra::EpetraIntMultiVectorT::multiply(): Functionnality not available in Epetra");
255 "Xpetra_EpetraIntMultiVector: elementWiseMultiply not implemented because Epetra_IntMultiVector does not support this operation");
314 return std::string(
"");
318 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
329 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap()
const {
330 return Teuchos::null;
362 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
365 :
public virtual MultiVector<int, int, int, EpetraNode> {
377 vec_ = rcp(
new Epetra_IntMultiVector(toEpetra<GlobalOrdinal, Node>(map), NumVectors, zeroOut));
382 if (copyOrView == Teuchos::Copy)
383 vec_ = rcp(
new Epetra_IntMultiVector(toEpetra<GlobalOrdinal, Node>(source)));
388 vec_ = Teuchos::rcp(
new Epetra_IntMultiVector(View, toEpetra<GlobalOrdinal, Node>(source), indices,
getNumVectors()));
396 "Xpetra::EpetraIntMultiVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
410 ierr = vec_->PutScalar(value);
444 typedef Kokkos::View<
typename dual_view_type::t_host::data_type,
446 typename dual_view_type::t_host::device_type,
447 Kokkos::MemoryUnmanaged>
452 vec_->ExtractView(&data, &myLDA);
453 int localLength = vec_->MyLength();
457 epetra_view_type test = epetra_view_type(data, localLength, numVectors);
458 typename dual_view_type::t_host_um ret = subview(test, Kokkos::ALL(), Kokkos::ALL());
471 Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getVector(
size_t )
const {
482 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
485 int **arrayOfPointers;
486 vec_->ExtractView(&arrayOfPointers);
487 int *data = arrayOfPointers[j];
488 int localLength = vec_->MyLength();
490 return ArrayRCP<int>(data, 0, localLength,
false);
498 int **arrayOfPointers;
499 vec_->ExtractView(&arrayOfPointers);
500 int *data = arrayOfPointers[j];
501 int localLength = vec_->MyLength();
503 return ArrayRCP<int>(data, 0, localLength,
false);
512 const Teuchos::ArrayView<int> & )
const {
517 "This function is not implemented in Epetra_IntMultiVector");
524 "This function is not available in Epetra_IntMultiVector");
542 void scale(Teuchos::ArrayView<const int> ) {
556 void update(
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
565 void norm1(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
571 void norm2(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
577 void normInf(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
583 void meanValue(
const Teuchos::ArrayView<int> & )
const {
589 void maxValue(
const Teuchos::ArrayView<int> & )
const {
595 void multiply(Teuchos::ETransp , Teuchos::ETransp ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
603 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntMultiVector: elementWiseMultiply not implemented because Epetra_IntMultiVector does not support this operation");
613 vec_->ReplaceGlobalValue(globalRow, vectorIndex, value);
618 vec_->SumIntoGlobalValue(globalRow, vectorIndex, value);
623 vec_->ReplaceMyValue(myRow, vectorIndex, value);
628 vec_->SumIntoMyValue(myRow, vectorIndex, value);
638 return vec_->NumVectors();
643 return vec_->MyLength();
652 auto vv = toEpetra<GlobalOrdinal, Node>(vec);
653 return ((
getLocalLength() == Teuchos::as<size_t>(vv.MyLength())) &&
667 std::ostringstream oss;
668 oss << Teuchos::Describable::description();
675 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
681 using Teuchos::VERB_DEFAULT;
682 using Teuchos::VERB_EXTREME;
683 using Teuchos::VERB_HIGH;
684 using Teuchos::VERB_LOW;
685 using Teuchos::VERB_MEDIUM;
686 using Teuchos::VERB_NONE;
688 if (verbLevel > Teuchos::VERB_NONE)
701 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap()
const {
702 RCP<const Epetra_BlockMap> map = rcp(
new Epetra_BlockMap(vec_->Map()));
713 const Epetra_IntMultiVector &v = *tSource.getEpetra_IntMultiVector();
714 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
715 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
725 const Epetra_IntMultiVector &v = *tDest.getEpetra_IntMultiVector();
726 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
727 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
737 const Epetra_IntMultiVector &v = *tSource.getEpetra_IntMultiVector();
738 int err = vec_->Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
739 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
749 const Epetra_IntMultiVector &v = *tDest.getEpetra_IntMultiVector();
750 int err = vec_->Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
751 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
757 if (!map.is_null()) {
762 Epetra_SerialComm SComm;
766 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
775 const this_type *rhsPtr =
dynamic_cast<const this_type *
>(&rhs);
776 TEUCHOS_TEST_FOR_EXCEPTION(
777 rhsPtr == NULL, std::invalid_argument,
778 "Xpetra::MultiVector::operator=: "
779 "The left-hand side (LHS) of the assignment has a different type than "
780 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntMultiVectorT "
781 "(which means it wraps an Epetra_IntMultiVector), but the RHS has some "
782 "other type. This probably means that the RHS wraps either an "
783 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
784 "does not currently implement assignment from a Tpetra object to an "
785 "Epetra object, though this could be added with sufficient interest.");
787 RCP<const Epetra_IntMultiVector> rhsImpl = rhsPtr->getEpetra_IntMultiVector();
790 TEUCHOS_TEST_FOR_EXCEPTION(
791 rhsImpl.is_null(), std::logic_error,
792 "Xpetra::MultiVector::operator= "
793 "(in Xpetra::EpetraIntMultiVectorT::assign): *this (the right-hand side of "
794 "the assignment) has a null RCP<Epetra_IntMultiVector> inside. Please "
795 "report this bug to the Xpetra developers.");
796 TEUCHOS_TEST_FOR_EXCEPTION(
797 lhsImpl.is_null(), std::logic_error,
798 "Xpetra::MultiVector::operator= "
799 "(in Xpetra::EpetraIntMultiVectorT::assign): The left-hand side of the "
800 "assignment has a null RCP<Epetra_IntMultiVector> inside. Please report "
801 "this bug to the Xpetra developers.");
809 RCP<Epetra_IntMultiVector>
vec_;
814 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
817 :
public virtual MultiVector<int, int, long long, EpetraNode> {
829 vec_ = rcp(
new Epetra_IntMultiVector(toEpetra<GlobalOrdinal, Node>(map), NumVectors, zeroOut));
834 vec_ = rcp(
new Epetra_IntMultiVector(toEpetra<GlobalOrdinal, Node>(source)));
840 "Xpetra::EpetraIntMultiVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
854 ierr = vec_->PutScalar(value);
883 Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getVector(
size_t )
const {
894 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
897 int **arrayOfPointers;
898 vec_->ExtractView(&arrayOfPointers);
899 int *data = arrayOfPointers[j];
900 int localLength = vec_->MyLength();
902 return ArrayRCP<int>(data, 0, localLength,
false);
910 int **arrayOfPointers;
911 vec_->ExtractView(&arrayOfPointers);
912 int *data = arrayOfPointers[j];
913 int localLength = vec_->MyLength();
915 return ArrayRCP<int>(data, 0, localLength,
false);
924 const Teuchos::ArrayView<int> & )
const {
935 "This function is not available in Epetra_IntMultiVector");
942 "This function is not implemented in Epetra_IntMultiVector");
952 void scale(Teuchos::ArrayView<const int> ) {
966 void update(
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
975 void norm1(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
981 void norm2(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
987 void normInf(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
993 void meanValue(
const Teuchos::ArrayView<int> & )
const {
999 void maxValue(
const Teuchos::ArrayView<int> & )
const {
1005 void multiply(Teuchos::ETransp , Teuchos::ETransp ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
1013 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntMultiVector: elementWiseMultiply not implemented because Epetra_IntMultiVector does not support this operation");
1023 vec_->ReplaceGlobalValue(globalRow, vectorIndex, value);
1028 vec_->SumIntoGlobalValue(globalRow, vectorIndex, value);
1033 vec_->ReplaceMyValue(myRow, vectorIndex, value);
1038 vec_->SumIntoMyValue(myRow, vectorIndex, value);
1048 return vec_->NumVectors();
1060 auto vv = toEpetra<GlobalOrdinal, Node>(vec);
1061 return ((
getLocalLength() == Teuchos::as<size_t>(vv.MyLength())) &&
1074 std::ostringstream oss;
1075 oss << Teuchos::Describable::description();
1082 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
1088 using Teuchos::VERB_DEFAULT;
1089 using Teuchos::VERB_EXTREME;
1090 using Teuchos::VERB_HIGH;
1091 using Teuchos::VERB_LOW;
1092 using Teuchos::VERB_MEDIUM;
1093 using Teuchos::VERB_NONE;
1095 if (verbLevel > Teuchos::VERB_NONE)
1108 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap()
const {
1109 RCP<const Epetra_BlockMap> map = rcp(
new Epetra_BlockMap(vec_->Map()));
1120 const Epetra_IntMultiVector &v = *tSource.getEpetra_IntMultiVector();
1121 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1122 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1132 const Epetra_IntMultiVector &v = *tDest.getEpetra_IntMultiVector();
1133 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1134 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1144 const Epetra_IntMultiVector &v = *tSource.getEpetra_IntMultiVector();
1145 int err = vec_->Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1146 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1156 const Epetra_IntMultiVector &v = *tDest.getEpetra_IntMultiVector();
1157 int err = vec_->Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1158 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1164 if (!map.is_null()) {
1169 Epetra_SerialComm SComm;
1173 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1182 const this_type *rhsPtr =
dynamic_cast<const this_type *
>(&rhs);
1183 TEUCHOS_TEST_FOR_EXCEPTION(
1184 rhsPtr == NULL, std::invalid_argument,
1185 "Xpetra::MultiVector::operator=: "
1186 "The left-hand side (LHS) of the assignment has a different type than "
1187 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntMultiVectorT "
1188 "(which means it wraps an Epetra_IntMultiVector), but the RHS has some "
1189 "other type. This probably means that the RHS wraps either an "
1190 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
1191 "does not currently implement assignment from a Tpetra object to an "
1192 "Epetra object, though this could be added with sufficient interest.");
1194 RCP<const Epetra_IntMultiVector> rhsImpl = rhsPtr->getEpetra_IntMultiVector();
1197 TEUCHOS_TEST_FOR_EXCEPTION(
1198 rhsImpl.is_null(), std::logic_error,
1199 "Xpetra::MultiVector::operator= "
1200 "(in Xpetra::EpetraIntMultiVectorT::assign): *this (the right-hand side of "
1201 "the assignment) has a null RCP<Epetra_IntMultiVector> inside. Please "
1202 "report this bug to the Xpetra developers.");
1203 TEUCHOS_TEST_FOR_EXCEPTION(
1204 lhsImpl.is_null(), std::logic_error,
1205 "Xpetra::MultiVector::operator= "
1206 "(in Xpetra::EpetraIntMultiVectorT::assign): The left-hand side of the "
1207 "assignment has a null RCP<Epetra_IntMultiVector> inside. Please report "
1208 "this bug to the Xpetra developers.");
1211 *lhsImpl = *rhsImpl;
1222 #endif // XPETRA_EPETRAINTMULTIVECTOR_HPP
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).
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.
dual_view_type::t_host_um getHostLocalView(Access::ReadWriteStruct) const override
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t) const
Return a Vector which is a const view of column j.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
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.
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 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)
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 replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
void meanValue(const Teuchos::ArrayView< int > &) const
Compute mean (average) value of each vector in multi-vector.
void scale(const int &)
Scale the current values of a multi-vector, this = alpha*this.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
EpetraGlobalOrdinal GlobalOrdinal
dual_view_type::t_host_const_um getHostLocalView(Access::ReadOnlyStruct) const override
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]) ...
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
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 > &A)
Puts element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,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 sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
Exception throws to report errors in the internal logical of the program.
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 doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void randomize(const Scalar &minVal, const Scalar &maxVal, bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
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 meanValue(const Teuchos::ArrayView< int > &) const
Compute mean (average) value of each vector in multi-vector.
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)
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.
size_t getNumVectors() const
Returns the number 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 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 sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
dual_view_type::t_dev_um getDeviceLocalView(Access::OverwriteAllStruct) const override
void scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
const RCP< const Comm< int > > getComm() const
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 normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute Inf-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].
std::string description() const
Return a simple one-line description of this object.
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
Teuchos::ArrayRCP< const int > getData(size_t j) const
const RCP< const Comm< int > > getComm() const
void randomize(const Scalar &minVal, const Scalar &maxVal, bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
size_t getLocalLength() const
Returns the local vector length on the calling processor 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 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 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)
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
dual_view_type::t_host_um getHostLocalView(Access::OverwriteAllStruct) const override
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)
RCP< Epetra_IntMultiVector > vec_
The Epetra_IntMultiVector which this class wraps.
~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.
~EpetraIntMultiVectorT()
Destructor.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute Inf-norm 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.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void maxValue(const Teuchos::ArrayView< int > &) const
Compute max value of each vector in multi-vector.
RCP< Epetra_IntMultiVector > getEpetra_IntMultiVector() const
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.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
const RCP< const Comm< int > > getComm() const
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
RCP< Epetra_IntMultiVector > getEpetra_IntMultiVector() const
Teuchos::ArrayRCP< const int > getData(size_t j) const
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).
RCP< Epetra_IntMultiVector > vec_
The Epetra_IntMultiVector which this class wraps.
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.
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) 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.
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].
size_t global_size_t
Global size_t object.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
void maxValue(const Teuchos::ArrayView< int > &) 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).
void randomize(bool=true)
Set multi-vector values to random numbers.
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.
Kokkos::DualView< impl_scalar_type **, Kokkos::LayoutStride, typename node_type::device_type, Kokkos::MemoryUnmanaged > dual_view_type
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 2-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).
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, 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 replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
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 norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 1-norm of each vector in multi-vector.
dual_view_type::t_dev_const_um getDeviceLocalView(Access::ReadOnlyStruct) const override
std::string description() const
Return a simple one-line description of this object.
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
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).
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
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.
constexpr struct ReadWriteStruct ReadWrite
#define XPETRA_MONITOR(funcName)
virtual dual_view_type::t_host_const_um getHostLocalView(Access::ReadOnlyStruct) const
void meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
dual_view_type::t_dev_um getDeviceLocalView(Access::ReadWriteStruct) const override
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)
Teuchos::ArrayRCP< const int > getData(size_t j) const
EpetraIntMultiVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Sets all vector entries to zero.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
void randomize(const Scalar &minVal, const Scalar &maxVal, 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)
RCP< Epetra_IntMultiVector > getEpetra_IntMultiVector() const
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::dual_view_type dual_view_type
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.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
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).