46 #ifndef XPETRA_EPETRAINTVECTOR_HPP 47 #define XPETRA_EPETRAINTVECTOR_HPP 58 #include "Epetra_IntVector.h" 62 template<
class EpetraGlobalOrdinal>
63 class EpetraIntVectorT
64 :
public Vector<int,int,EpetraGlobalOrdinal>
80 vec_ =
rcp(
new Epetra_IntVector(eMap->getEpetra_BlockMap(), zeroOut));
133 void randomize(
bool bUseXpetraImplementation =
true);
137 void setSeed(
unsigned int seed);
172 void scale(
const int &alpha);
181 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);
202 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);
213 void replaceGlobalValue(GlobalOrdinal globalRow,
size_t vectorIndex,
const Scalar &value);
216 void sumIntoGlobalValue(GlobalOrdinal globalRow,
size_t vectorIndex,
const Scalar &value);
219 void replaceLocalValue(LocalOrdinal myRow,
size_t vectorIndex,
const Scalar &value);
222 void sumIntoLocalValue(LocalOrdinal myRow,
size_t vectorIndex,
const Scalar &value);
286 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 289 typename dual_view_type::t_host_um getHostLocalView ()
const {
290 throw std::runtime_error(
"EpetraIntVector does not support device views! Must be implemented extra...");
291 typename dual_view_type::t_host_um ret;
295 typename dual_view_type::t_dev_um getDeviceLocalView()
const {
296 throw std::runtime_error(
"Epetra does not support device views!");
297 typename dual_view_type::t_dev_um ret;
311 template<
class TargetDeviceType>
312 typename Kokkos::Impl::if_c<
313 Kokkos::Impl::is_same<
314 typename dual_view_type::t_dev_um::execution_space::memory_space,
315 typename TargetDeviceType::memory_space>::value,
316 typename dual_view_type::t_dev_um,
317 typename dual_view_type::t_host_um>::type
318 getLocalView ()
const {
337 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES 341 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES 347 #endif // XPETRA_EPETRAINTVECTOR_HPP KokkosClassic::DefaultNode::DefaultNodeType Node
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
std::string description() const
Return a simple one-line description of this object.
EpetraIntVectorT< long long > EpetraIntVector64
void elementWiseMultiply(int scalarAB, const Vector< int, int, GlobalOrdinal, Node > &A, const MultiVector< int, int, GlobalOrdinal, Node > &B, int scalarThis)
Element-wise multiply of a Vector A with a EpetraMultiVector B.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this 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).
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
void update(const int &alpha, const MultiVector< int, int, GlobalOrdinal, Node > &A, const int &beta)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
const RCP< const Comm< int > > getComm() const
Teuchos::RCP< const Map< int, GlobalOrdinal > > getMap() const
The Map describing the parallel distribution of this object.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
void doExport(const DistObject< int, int, GlobalOrdinal > &dest, const Import< int, GlobalOrdinal > &importer, CombineMode CM)
void doImport(const DistObject< int, int, GlobalOrdinal > &source, const Import< int, GlobalOrdinal > &importer, CombineMode CM)
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
RCP< Epetra_IntVector > getEpetra_IntVector() const
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
EpetraGlobalOrdinal GlobalOrdinal
int meanValue() const
Compute mean (average) value of this Vector.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
EpetraIntVectorT< int > EpetraIntVector
void replaceMap(const RCP< const Map< int, GlobalOrdinal > > &map)
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
Exception throws when you call an unimplemented method of Xpetra.
Teuchos::ArrayRCP< const int > getData(size_t j) const
Teuchos::ScalarTraits< int >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const
Compute Weighted 2-norm (RMS Norm) of this Vector.
size_t global_size_t
Global size_t object.
static const EVerbosityLevel verbLevel_default
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
void setSeed(unsigned int seed)
Set seed for Random function.
EpetraIntVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
RCP< Epetra_IntVector > vec_
The Epetra_IntVector which this class wraps.
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
~EpetraIntVectorT()
Destructor.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
CombineMode
Xpetra::Combine Mode enumerable type.
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-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).
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
int maxValue() const
Compute max value of this Vector.