10 #ifndef XPETRA_EPETRAINTVECTOR_HPP
11 #define XPETRA_EPETRAINTVECTOR_HPP
16 #include "Xpetra_MultiVector.hpp"
22 #include "Epetra_IntVector.h"
24 #if defined(XPETRA_ENABLE_DEPRECATED_CODE)
26 #if defined(Xpetra_SHOW_DEPRECATED_WARNINGS)
27 #warning "The header file Trilinos/packages/xpetra/src/Vector/Xpetra_EpetraIntVector.hpp is deprecated."
31 #error "The header file Trilinos/packages/xpetra/src/Vector/Xpetra_EpetraIntVector.hpp is deprecated."
37 template <
class GlobalOrdinal,
class Node>
38 XPETRA_DEPRECATED Epetra_IntVector &
toEpetra(Vector<int, int, GlobalOrdinal, Node> &);
40 template <
class GlobalOrdinal,
class Node>
41 const XPETRA_DEPRECATED Epetra_IntVector &
toEpetra(
const Vector<int, int, GlobalOrdinal, Node> &);
45 template <
class EpetraGlobalOrdinal,
class Node>
46 class XPETRA_DEPRECATED EpetraIntVectorT
47 :
public Vector<int, int, EpetraGlobalOrdinal, Node> {
71 TEUCHOS_UNREACHABLE_RETURN(-1);
75 Teuchos::ScalarTraits<int>::magnitudeType
norm1()
const {
78 TEUCHOS_UNREACHABLE_RETURN(-1);
82 Teuchos::ScalarTraits<int>::magnitudeType
norm2()
const {
85 TEUCHOS_UNREACHABLE_RETURN(-1);
89 Teuchos::ScalarTraits<int>::magnitudeType
normInf()
const {
92 TEUCHOS_UNREACHABLE_RETURN(-1);
99 TEUCHOS_UNREACHABLE_RETURN(-1);
106 TEUCHOS_UNREACHABLE_RETURN(-1);
166 Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getVector(
size_t j)
const {
177 Teuchos::ArrayRCP<const int>
getData(
size_t j)
const {
return Teuchos::ArrayRCP<const int>(); }
200 void scale(Teuchos::ArrayView<const int> alpha) {
214 void update(
const int &alpha,
const MultiVector<int, int, GlobalOrdinal, Node> &A,
const int &beta,
const MultiVector<int, int, GlobalOrdinal, Node> &B,
const int &gamma) {
223 void norm1(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
229 void norm2(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
235 void normInf(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms)
const {
241 void meanValue(
const Teuchos::ArrayView<int> &means)
const {
247 void maxValue(
const Teuchos::ArrayView<int> &maxs)
const {
253 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) {
261 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
320 return std::string(
"");
324 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
335 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap()
const {
336 return Teuchos::null;
368 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
371 :
public virtual Vector<int, int, int, EpetraNode> {
383 vec_ = rcp(
new Epetra_IntVector(toEpetra<GlobalOrdinal, Node>(map), zeroOut));
398 TEUCHOS_UNREACHABLE_RETURN(-1);
402 Teuchos::ScalarTraits<int>::magnitudeType
norm1()
const {
405 TEUCHOS_UNREACHABLE_RETURN(-1);
409 Teuchos::ScalarTraits<int>::magnitudeType
norm2()
const {
412 TEUCHOS_UNREACHABLE_RETURN(-1);
416 Teuchos::ScalarTraits<int>::magnitudeType
normInf()
const {
419 TEUCHOS_UNREACHABLE_RETURN(-1);
426 TEUCHOS_UNREACHABLE_RETURN(-1);
432 return vec_->MaxValue();
455 (*vec_)[myRow] = value;
461 (*vec_)[myRow] += value;
465 void putScalar(
const int &value) { vec_->PutValue(value); }
497 typedef Kokkos::View<
typename dual_view_type::t_host::data_type,
499 typename dual_view_type::t_host::device_type,
500 Kokkos::MemoryUnmanaged>
504 vec_->ExtractView(&data);
505 int localLength = vec_->MyLength();
508 epetra_view_type test = epetra_view_type(data, localLength, 1);
509 typename dual_view_type::t_host_um ret = subview(test, Kokkos::ALL(), Kokkos::ALL());
521 Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getVector(
size_t )
const {
532 Teuchos::ArrayRCP<const int>
getData(
size_t )
const {
535 int *data = vec_->Values();
536 int localLength = vec_->MyLength();
538 return ArrayRCP<int>(data, 0, localLength,
false);
546 int *data = vec_->Values();
547 int localLength = vec_->MyLength();
549 return ArrayRCP<int>(data, 0, localLength,
false);
587 void scale(Teuchos::ArrayView<const int> ) {
601 void update(
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
610 void norm1(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
616 void norm2(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
622 void normInf(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
628 void meanValue(
const Teuchos::ArrayView<int> & )
const {
634 void maxValue(
const Teuchos::ArrayView<int> & )
const {
640 void multiply(Teuchos::ETransp , Teuchos::ETransp ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
648 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
701 if (!asvec)
return false;
716 std::ostringstream oss;
717 oss << Teuchos::Describable::description();
724 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
730 using Teuchos::VERB_DEFAULT;
731 using Teuchos::VERB_EXTREME;
732 using Teuchos::VERB_HIGH;
733 using Teuchos::VERB_LOW;
734 using Teuchos::VERB_MEDIUM;
735 using Teuchos::VERB_NONE;
737 if (verbLevel > Teuchos::VERB_NONE)
750 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap()
const {
751 RCP<const Epetra_BlockMap> map = rcp(
new Epetra_BlockMap(vec_->Map()));
762 const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
763 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
764 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
774 const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
775 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
776 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
786 const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
787 int err = vec_->Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
788 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
798 const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
799 int err = vec_->Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
800 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
813 const this_type *rhsPtr =
dynamic_cast<const this_type *
>(&rhs);
814 TEUCHOS_TEST_FOR_EXCEPTION(
815 rhsPtr == NULL, std::invalid_argument,
816 "Xpetra::MultiVector::operator=: "
817 "The left-hand side (LHS) of the assignment has a different type than "
818 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT "
819 "(which means it wraps an Epetra_IntVector), but the RHS has some "
820 "other type. This probably means that the RHS wraps either an "
821 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
822 "does not currently implement assignment from a Tpetra object to an "
823 "Epetra object, though this could be added with sufficient interest.");
825 RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector();
828 TEUCHOS_TEST_FOR_EXCEPTION(
829 rhsImpl.is_null(), std::logic_error,
830 "Xpetra::MultiVector::operator= "
831 "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of "
832 "the assignment) has a null RCP<Epetra_IntVector> inside. Please "
833 "report this bug to the Xpetra developers.");
834 TEUCHOS_TEST_FOR_EXCEPTION(
835 lhsImpl.is_null(), std::logic_error,
836 "Xpetra::MultiVector::operator= "
837 "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the "
838 "assignment has a null RCP<Epetra_IntVector> inside. Please report "
839 "this bug to the Xpetra developers.");
852 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
855 :
public virtual Vector<int, int, long long, EpetraNode> {
867 vec_ = rcp(
new Epetra_IntVector(toEpetra<GlobalOrdinal, Node>(map), zeroOut));
885 Teuchos::ScalarTraits<int>::magnitudeType
norm1()
const {
891 Teuchos::ScalarTraits<int>::magnitudeType
norm2()
const {
897 Teuchos::ScalarTraits<int>::magnitudeType
normInf()
const {
911 return Teuchos::as<int>(vec_->MaxValue());
934 (*vec_)[myRow] = value;
940 (*vec_)[myRow] += value;
944 void putScalar(
const int &value) { vec_->PutValue(value); }
971 Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getVector(
size_t )
const {
982 Teuchos::ArrayRCP<const int>
getData(
size_t )
const {
985 int *data = vec_->Values();
986 int localLength = vec_->MyLength();
988 return ArrayRCP<int>(data, 0, localLength,
false);
996 int *data = vec_->Values();
997 int localLength = vec_->MyLength();
999 return ArrayRCP<int>(data, 0, localLength,
false);
1037 void scale(Teuchos::ArrayView<const int> ) {
1051 void update(
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
1060 void norm1(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
1066 void norm2(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
1072 void normInf(
const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & )
const {
1084 void maxValue(
const Teuchos::ArrayView<int> & )
const {
1090 void multiply(Teuchos::ETransp , Teuchos::ETransp ,
const int & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const MultiVector<int, int, GlobalOrdinal, Node> & ,
const int & ) {
1098 TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
1151 if (!asvec)
return false;
1165 std::ostringstream oss;
1166 oss << Teuchos::Describable::description();
1173 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
1179 using Teuchos::VERB_DEFAULT;
1180 using Teuchos::VERB_EXTREME;
1181 using Teuchos::VERB_HIGH;
1182 using Teuchos::VERB_LOW;
1183 using Teuchos::VERB_MEDIUM;
1184 using Teuchos::VERB_NONE;
1186 if (verbLevel > Teuchos::VERB_NONE)
1199 Teuchos::RCP<const Map<int, GlobalOrdinal, Node> >
getMap()
const {
1200 RCP<const Epetra_BlockMap> map = rcp(
new Epetra_BlockMap(vec_->Map()));
1211 const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
1212 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1213 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1223 const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
1224 int err = vec_->Import(v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1225 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1235 const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
1236 int err = vec_->Import(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1237 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1247 const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
1248 int err = vec_->Export(v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1249 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1262 const this_type *rhsPtr =
dynamic_cast<const this_type *
>(&rhs);
1263 TEUCHOS_TEST_FOR_EXCEPTION(
1264 rhsPtr == NULL, std::invalid_argument,
1265 "Xpetra::MultiVector::operator=: "
1266 "The left-hand side (LHS) of the assignment has a different type than "
1267 "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT "
1268 "(which means it wraps an Epetra_IntVector), but the RHS has some "
1269 "other type. This probably means that the RHS wraps either an "
1270 "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
1271 "does not currently implement assignment from a Tpetra object to an "
1272 "Epetra object, though this could be added with sufficient interest.");
1274 RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector();
1277 TEUCHOS_TEST_FOR_EXCEPTION(
1278 rhsImpl.is_null(), std::logic_error,
1279 "Xpetra::MultiVector::operator= "
1280 "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of "
1281 "the assignment) has a null RCP<Epetra_IntVector> inside. Please "
1282 "report this bug to the Xpetra developers.");
1283 TEUCHOS_TEST_FOR_EXCEPTION(
1284 lhsImpl.is_null(), std::logic_error,
1285 "Xpetra::MultiVector::operator= "
1286 "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the "
1287 "assignment has a null RCP<Epetra_IntVector> inside. Please report "
1288 "this bug to the Xpetra developers.");
1291 *lhsImpl = *rhsImpl;
1302 #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.