46 #ifndef XPETRA_EPETRAINTVECTOR_HPP
47 #define XPETRA_EPETRAINTVECTOR_HPP
52 #include "Xpetra_MultiVector.hpp"
58 #include "Epetra_IntVector.h"
60 #if defined(XPETRA_ENABLE_DEPRECATED_CODE)
62 #warning "The header file Trilinos/packages/xpetra/src/Vector/Xpetra_EpetraIntVector.hpp is deprecated."
65 #error "The header file Trilinos/packages/xpetra/src/Vector/Xpetra_EpetraIntVector.hpp is deprecated."
71 template <
class GlobalOrdinal,
class Node>
72 XPETRA_DEPRECATED Epetra_IntVector &
toEpetra(Vector<int, int, GlobalOrdinal, Node> &);
74 template <
class GlobalOrdinal,
class Node>
75 const XPETRA_DEPRECATED Epetra_IntVector &
toEpetra(
const Vector<int, int, GlobalOrdinal, Node> &);
79 template <
class EpetraGlobalOrdinal,
class Node>
80 class XPETRA_DEPRECATED EpetraIntVectorT
81 :
public Vector<int, int, EpetraGlobalOrdinal, Node> {
105 TEUCHOS_UNREACHABLE_RETURN(-1);
109 Teuchos::ScalarTraits<int>::magnitudeType
norm1()
const {
112 TEUCHOS_UNREACHABLE_RETURN(-1);
116 Teuchos::ScalarTraits<int>::magnitudeType
norm2()
const {
119 TEUCHOS_UNREACHABLE_RETURN(-1);
123 Teuchos::ScalarTraits<int>::magnitudeType
normInf()
const {
126 TEUCHOS_UNREACHABLE_RETURN(-1);
133 TEUCHOS_UNREACHABLE_RETURN(-1);
140 TEUCHOS_UNREACHABLE_RETURN(-1);
200 Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getVector(
size_t j)
const {
211 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
return Teuchos::ArrayRCP<const int>(); }
234 void scale(Teuchos::ArrayView<const int> alpha) {
248 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) {
257 void norm1(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
263 void norm2(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
269 void normInf(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
275 void meanValue(
const Teuchos::ArrayView<int> &means)
const {
281 void maxValue(
const Teuchos::ArrayView<int> &maxs)
const {
287 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) {
295 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
354 return std::string(
"");
358 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
369 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap()
const {
370 return Teuchos::null;
402 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
405 :
public virtual Vector<int, int, int, EpetraNode> {
417 vec_ = rcp(
new Epetra_IntVector(toEpetra<GlobalOrdinal, Node>(map), zeroOut));
432 TEUCHOS_UNREACHABLE_RETURN(-1);
436 Teuchos::ScalarTraits<int>::magnitudeType
norm1()
const {
439 TEUCHOS_UNREACHABLE_RETURN(-1);
443 Teuchos::ScalarTraits<int>::magnitudeType
norm2()
const {
446 TEUCHOS_UNREACHABLE_RETURN(-1);
450 Teuchos::ScalarTraits<int>::magnitudeType
normInf()
const {
453 TEUCHOS_UNREACHABLE_RETURN(-1);
460 TEUCHOS_UNREACHABLE_RETURN(-1);
466 return vec_->MaxValue();
489 (*vec_)[myRow] = value;
495 (*vec_)[myRow] += value;
499 void putScalar(
const int &value) { vec_->PutValue(value); }
531 typedef Kokkos::View<
typename dual_view_type::t_host::data_type,
533 typename dual_view_type::t_host::device_type,
534 Kokkos::MemoryUnmanaged>
538 vec_->ExtractView(&data);
539 int localLength = vec_->MyLength();
542 epetra_view_type test = epetra_view_type(data, localLength, 1);
543 typename dual_view_type::t_host_um ret = subview(test, Kokkos::ALL(), Kokkos::ALL());
555 Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getVector(
size_t )
const {
566 Teuchos::ArrayRCP<const int>
getData(
size_t )
const {
569 int *data = vec_->Values();
570 int localLength = vec_->MyLength();
572 return ArrayRCP<int>(data, 0, localLength,
false);
580 int *data = vec_->Values();
581 int localLength = vec_->MyLength();
583 return ArrayRCP<int>(data, 0, localLength,
false);
621 void scale(Teuchos::ArrayView<const int> ) {
635 void update(
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
644 void norm1(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
650 void norm2(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
656 void normInf(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
662 void meanValue(
const Teuchos::ArrayView<int> & )
const {
668 void maxValue(
const Teuchos::ArrayView<int> & )
const {
674 void multiply(Teuchos::ETransp , Teuchos::ETransp ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
682 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
735 if (!asvec)
return false;
750 std::ostringstream oss;
751 oss << Teuchos::Describable::description();
758 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
764 using Teuchos::VERB_DEFAULT;
765 using Teuchos::VERB_EXTREME;
766 using Teuchos::VERB_HIGH;
767 using Teuchos::VERB_LOW;
768 using Teuchos::VERB_MEDIUM;
769 using Teuchos::VERB_NONE;
771 if (verbLevel > Teuchos::VERB_NONE)
784 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap()
const {
785 RCP<const Epetra_BlockMap> map = rcp(
new Epetra_BlockMap(vec_->Map()));
796 const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
797 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
798 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
808 const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
809 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
810 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
820 const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
821 int err = vec_->Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
822 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
832 const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
833 int err = vec_->Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
834 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
847 const this_type *rhsPtr =
dynamic_cast<const this_type *
>(&rhs);
848 TEUCHOS_TEST_FOR_EXCEPTION(
849 rhsPtr == NULL, std::invalid_argument,
850 "Xpetra::MultiVector::operator=: "
851 "The left-hand side (LHS) of the assignment has a different type than "
852 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT "
853 "(which means it wraps an Epetra_IntVector), but the RHS has some "
854 "other type. This probably means that the RHS wraps either an "
855 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
856 "does not currently implement assignment from a Tpetra object to an "
857 "Epetra object, though this could be added with sufficient interest.");
859 RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector();
862 TEUCHOS_TEST_FOR_EXCEPTION(
863 rhsImpl.is_null(), std::logic_error,
864 "Xpetra::MultiVector::operator= "
865 "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of "
866 "the assignment) has a null RCP<Epetra_IntVector> inside. Please "
867 "report this bug to the Xpetra developers.");
868 TEUCHOS_TEST_FOR_EXCEPTION(
869 lhsImpl.is_null(), std::logic_error,
870 "Xpetra::MultiVector::operator= "
871 "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the "
872 "assignment has a null RCP<Epetra_IntVector> inside. Please report "
873 "this bug to the Xpetra developers.");
886 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
889 :
public virtual Vector<int, int, long long, EpetraNode> {
901 vec_ = rcp(
new Epetra_IntVector(toEpetra<GlobalOrdinal, Node>(map), zeroOut));
919 Teuchos::ScalarTraits<int>::magnitudeType
norm1()
const {
925 Teuchos::ScalarTraits<int>::magnitudeType
norm2()
const {
931 Teuchos::ScalarTraits<int>::magnitudeType
normInf()
const {
945 return Teuchos::as<int>(vec_->MaxValue());
968 (*vec_)[myRow] = value;
974 (*vec_)[myRow] += value;
978 void putScalar(
const int &value) { vec_->PutValue(value); }
1005 Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getVector(
size_t )
const {
1016 Teuchos::ArrayRCP<const int>
getData(
size_t )
const {
1019 int *data = vec_->Values();
1020 int localLength = vec_->MyLength();
1022 return ArrayRCP<int>(data, 0, localLength,
false);
1030 int *data = vec_->Values();
1031 int localLength = vec_->MyLength();
1033 return ArrayRCP<int>(data, 0, localLength,
false);
1071 void scale(Teuchos::ArrayView<const int> ) {
1085 void update(
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
1094 void norm1(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
1100 void norm2(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
1106 void normInf(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
1118 void maxValue(
const Teuchos::ArrayView<int> & )
const {
1124 void multiply(Teuchos::ETransp , Teuchos::ETransp ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
1132 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
1185 if (!asvec)
return false;
1199 std::ostringstream oss;
1200 oss << Teuchos::Describable::description();
1207 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
1213 using Teuchos::VERB_DEFAULT;
1214 using Teuchos::VERB_EXTREME;
1215 using Teuchos::VERB_HIGH;
1216 using Teuchos::VERB_LOW;
1217 using Teuchos::VERB_MEDIUM;
1218 using Teuchos::VERB_NONE;
1220 if (verbLevel > Teuchos::VERB_NONE)
1233 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap()
const {
1234 RCP<const Epetra_BlockMap> map = rcp(
new Epetra_BlockMap(vec_->Map()));
1245 const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
1246 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1247 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1257 const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
1258 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1259 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1269 const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
1270 int err = vec_->Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1271 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1281 const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
1282 int err = vec_->Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1283 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1296 const this_type *rhsPtr =
dynamic_cast<const this_type *
>(&rhs);
1297 TEUCHOS_TEST_FOR_EXCEPTION(
1298 rhsPtr == NULL, std::invalid_argument,
1299 "Xpetra::MultiVector::operator=: "
1300 "The left-hand side (LHS) of the assignment has a different type than "
1301 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT "
1302 "(which means it wraps an Epetra_IntVector), but the RHS has some "
1303 "other type. This probably means that the RHS wraps either an "
1304 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
1305 "does not currently implement assignment from a Tpetra object to an "
1306 "Epetra object, though this could be added with sufficient interest.");
1308 RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector();
1311 TEUCHOS_TEST_FOR_EXCEPTION(
1312 rhsImpl.is_null(), std::logic_error,
1313 "Xpetra::MultiVector::operator= "
1314 "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of "
1315 "the assignment) has a null RCP<Epetra_IntVector> inside. Please "
1316 "report this bug to the Xpetra developers.");
1317 TEUCHOS_TEST_FOR_EXCEPTION(
1318 lhsImpl.is_null(), std::logic_error,
1319 "Xpetra::MultiVector::operator= "
1320 "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the "
1321 "assignment has a null RCP<Epetra_IntVector> inside. Please report "
1322 "this bug to the Xpetra developers.");
1325 *lhsImpl = *rhsImpl;
1336 #endif // XPETRA_EPETRAINTVECTOR_HPP
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
void replaceGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Replace value, using global (row) index.
std::string description() const
Return a simple one-line description of this object.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &) const
TODO missing comment.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
Teuchos::ArrayRCP< const int > getData(size_t j) const
void scale(Teuchos::ArrayView< const int > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
void meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 2-norm of each vector in multi-vector.
void replaceLocalValue(LocalOrdinal, size_t, const Scalar &)
Replace value, using local (row) index.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
int meanValue() const
Compute mean (average) value of this Vector.
RCP< Epetra_IntVector > getEpetra_IntVector() const
Teuchos::ArrayRCP< const int > getData(size_t) const
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void scale(const int &)
Scale the current values of a multi-vector, this = alpha*this.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void 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::ArrayRCP< int > getDataNonConst(size_t)
void randomize(bool=true)
Set multi-vector values to random numbers.
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
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 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.
const RCP< const Comm< int > > getComm() const
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
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.
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.
RCP< Epetra_IntVector > vec_
The Epetra_IntVector which this class wraps.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute Inf-norm of each vector in multi-vector.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
RCP< Epetra_IntVector > vec_
The Epetra_IntVector which this class wraps.
void setSeed(unsigned int)
Set seed for Random function.
void randomize(bool=true)
Set multi-vector values to random numbers.
void replaceLocalValue(LocalOrdinal, size_t, const Scalar &)
Replace value, using local (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.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-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 meanValue(const Teuchos::ArrayView< int > &) const
Compute mean (average) 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.
int meanValue() const
Compute mean (average) value of this Vector.
dual_view_type::t_host_um getHostLocalView(Access::OverwriteAllStruct) const override
dual_view_type::t_dev_const_um getDeviceLocalView(Access::ReadOnlyStruct) const override
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &)
void sumIntoGlobalValue(GlobalOrdinal, const Scalar &)
Adds specified value to existing value at the specified location.
void update(const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Update multi-vector with scaled values of A and B, this = gamma*this + alpha*A + beta*B.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
int meanValue() const
Compute mean (average) value of this Vector.
dual_view_type::t_host_const_um getHostLocalView(Access::ReadOnlyStruct) const override
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 Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
~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.
int maxValue() const
Compute max value of this Vector.
Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::dual_view_type dual_view_type
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
EpetraIntVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
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(const Scalar &, const Scalar &, bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t) const
Return a Vector which is a const view of column j.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void replaceGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Replace value, using global (row) index.
const RCP< const Comm< int > > getComm() const
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 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).
std::string description() const
Return a simple one-line description of this object.
void maxValue(const Teuchos::ArrayView< int > &) const
Compute max value of each vector in multi-vector.
void reciprocal(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
void scale(Teuchos::ArrayView< const int >)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
dual_view_type::t_dev_um getDeviceLocalView(Access::ReadWriteStruct) const override
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 1-norm of each vector in multi-vector.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void scale(Teuchos::ArrayView< const int >)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
Teuchos::ArrayRCP< int > getDataNonConst(size_t)
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
dual_view_type::t_host_um getHostLocalView(Access::ReadWriteStruct) const override
Teuchos::ArrayRCP< const int > getData(size_t) const
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void update(const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Update multi-vector with scaled values of A and B, this = gamma*this + alpha*A + beta*B.
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
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 norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 1-norm of each vector in multi-vector.
RCP< Epetra_IntVector > getEpetra_IntVector() const
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
Exception throws when you call an unimplemented method of Xpetra.
EpetraGlobalOrdinal GlobalOrdinal
void randomize(const Scalar &, const Scalar &, bool=true)
Set multi-vector values to random numbers.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &) const
TODO missing comment.
void replaceGlobalValue(GlobalOrdinal, const Scalar &)
Replace current value at the specified location with specified value.
void sumIntoGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Add value to existing value, using global (row) index.
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 replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &)
size_t global_size_t
Global size_t object.
int maxValue() const
Compute max value of this Vector.
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 sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
void setSeed(unsigned int)
Set seed for Random function.
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 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 RCP< const Comm< int > > getComm() const
int maxValue() const
Compute max value of this Vector.
~EpetraIntVectorT()
Destructor.
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 setSeed(unsigned int seed)
Set seed for Random function.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void replaceGlobalValue(GlobalOrdinal, const Scalar &)
Replace current value at the specified location with specified value.
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, const Scalar &value)
Replace current value at the specified location with specified values.
void randomize(const Scalar &, const Scalar &, bool=true)
Set multi-vector values to random numbers.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
dual_view_type::t_dev_um getDeviceLocalView(Access::OverwriteAllStruct) const override
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::dual_view_type dual_view_type
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, const Scalar &)
Adds specified value to existing value at the specified location.
void elementWiseMultiply(int, const Vector< int, int, GlobalOrdinal, Node > &, const MultiVector< int, int, GlobalOrdinal, Node > &, int)
Element-wise multiply of a Vector A with a EpetraMultiVector B.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
CombineMode
Xpetra::Combine Mode enumerable type.
void sumIntoGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Add value to existing value, using global (row) index.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
void sumIntoLocalValue(LocalOrdinal, size_t, const Scalar &)
Add value to existing value, using local (row) index.
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.
constexpr struct ReadWriteStruct ReadWrite
#define XPETRA_MONITOR(funcName)
~EpetraIntVectorT()
Destructor.
virtual dual_view_type::t_host_const_um getHostLocalView(Access::ReadOnlyStruct) const
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
void sumIntoLocalValue(LocalOrdinal, size_t, const Scalar &)
Add value to existing value, using local (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.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
virtual size_t getNumVectors() const =0
Number of columns in the multivector.
void scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
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.
void maxValue(const Teuchos::ArrayView< int > &) const
Compute max value 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 norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 2-norm of each vector in multi-vector.
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 scale(const int &)
Scale the current values of a multi-vector, this = alpha*this.
RCP< Epetra_IntVector > getEpetra_IntVector() const
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute Inf-norm of each vector in multi-vector.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t) const
Return a Vector which is a const view of column j.
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.
std::string description() const
Return a simple one-line description of this object.