10 #ifndef XPETRA_BLOCKEDVECTOR_DECL_HPP
11 #define XPETRA_BLOCKEDVECTOR_DECL_HPP
24 template <
class Scalar,
27 class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
29 :
public virtual Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>,
48 #undef XPETRA_BLOCKEDVECTOR_SHORT
64 BlockedVector(
const Teuchos::RCP<const BlockedMap>& map,
bool zeroOut =
true);
112 virtual void replaceGlobalValue(GlobalOrdinal globalRow,
size_t vectorIndex,
const Scalar& value);
115 virtual void sumIntoGlobalValue(GlobalOrdinal globalRow,
size_t vectorIndex,
const Scalar& value);
118 virtual void replaceLocalValue(LocalOrdinal myRow,
size_t vectorIndex,
const Scalar& value);
121 virtual void sumIntoLocalValue(LocalOrdinal myRow,
size_t vectorIndex,
const Scalar& value);
136 virtual void putScalar(
const Scalar& value);
144 virtual Teuchos::RCP<const Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
148 virtual Teuchos::RCP<Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
152 virtual Teuchos::ArrayRCP<const Scalar>
getData(
size_t j)
const;
164 const Teuchos::ArrayView<Scalar>& dots)
const;
175 virtual void scale(
const Scalar& alpha);
178 virtual void scale(Teuchos::ArrayView<const Scalar> alpha);
180 virtual void update(
const Scalar& alpha,
185 virtual void update(
const Scalar& alpha,
189 const Scalar& gamma);
192 virtual typename Teuchos::ScalarTraits<Scalar>::magnitudeType
norm1()
const;
195 virtual typename Teuchos::ScalarTraits<Scalar>::magnitudeType
norm2()
const;
198 virtual typename Teuchos::ScalarTraits<Scalar>::magnitudeType
normInf()
const;
201 virtual void norm1(
const Teuchos::ArrayView<
typename Teuchos::ScalarTraits<Scalar>::magnitudeType>& norms)
const;
204 virtual void norm2(
const Teuchos::ArrayView<
typename Teuchos::ScalarTraits<Scalar>::magnitudeType>& norms)
const;
207 virtual void normInf(
const Teuchos::ArrayView<
typename Teuchos::ScalarTraits<Scalar>::magnitudeType>& norms)
const;
211 virtual void meanValue(
const Teuchos::ArrayView<Scalar>& )
const;
216 virtual void multiply(Teuchos::ETransp ,
223 virtual void multiply(Teuchos::ETransp ,
267 virtual void describe(Teuchos::FancyOStream& out,
268 const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const;
270 virtual void replaceMap(
const RCP<const Map>& map);
298 virtual void setSeed(
unsigned int seed);
300 virtual void randomize(
bool bUseXpetraImplementation =
false);
302 virtual void randomize(
const Scalar& minVal,
const Scalar& maxVal,
bool bUseXpetraImplementation =
false);
313 Teuchos::RCP<const Map>
getMap()
const;
316 Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
320 Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
330 Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
352 #define XPETRA_BLOCKEDVECTOR_SHORT
353 #endif // XPETRA_BLOCKEDVECTOR_DECL_HPP
virtual Teuchos::RCP< Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
virtual Scalar meanValue() const
Compute mean (average) value of this Vector.
void setMultiVector(size_t r, Teuchos::RCP< const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >> v, bool bThyraMode)
set partial Vector associated with block row r
virtual void setSeed(unsigned int seed)
Set seed for Random function.
virtual void multiply(Teuchos::ETransp, Teuchos::ETransp, const Scalar &, const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, const Scalar &)
Matrix-matrix multiplication: this = beta*this + alpha*op(A)*op(B).
virtual void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
virtual void update(const Scalar &alpha, const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
virtual Teuchos::RCP< const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
virtual void elementWiseMultiply(Scalar, const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, Scalar)
Element-wise multiply of a Vector A with a MultiVector B.
virtual void scale(const Scalar &alpha)
Scale the current values of a vector, this = alpha*this.
virtual void replaceMap(const RCP< const Map > &map)
virtual size_t getNumVectors() const
Number of columns in the Vector.
virtual std::string description() const
A simple one-line description of this object.
virtual void abs(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise absolute values of input vector in target: A = abs(this).
virtual void dot(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Teuchos::ArrayView< Scalar > &dots) const
Compute dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i]).
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with the given verbosity level to a FancyOStream.
virtual void reciprocal(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise reciprocal values of input vector in target, this(i,j) = 1/A(i,j).
virtual bool isSameSize(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &) const
Local number of rows on the calling process.
virtual void assign(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
Teuchos::RCP< const Map > getMap() const
Access function for the underlying Map this DistObject was constructed with.
virtual size_t getLocalLength() const
Local number of rows on the calling process.
GlobalOrdinal global_ordinal_type
virtual void randomize(bool bUseXpetraImplementation=false)
Set multi-vector values to random numbers.
LocalOrdinal local_ordinal_type
virtual ~BlockedVector()
Destructor.
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of vector.
size_t global_size_t
Global size_t object.
BlockedVector(const Teuchos::RCP< const BlockedMap > &map, bool zeroOut=true)
Constructor.
Teuchos::RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Merge() const
merge BlockedVector blocks to a single Vector
virtual Teuchos::ArrayRCP< const Scalar > getData(size_t j) const
Const view of the local values in a particular vector of this vector.
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Compute 1-norm of vector.
virtual Teuchos::ArrayRCP< Scalar > getDataNonConst(size_t j)
View of the local values in a particular vector of this vector.
virtual global_size_t getGlobalLength() const
Global number of rows in the Vector.
virtual void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
BlockedVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > & operator=(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Assignment operator: Does a deep copy.
CombineMode
Xpetra::Combine Mode enumerable type.
virtual void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm in vector.
virtual void doImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, const Import &, CombineMode)
Import.
virtual void doExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, const Import &, CombineMode)
Export.
virtual void putScalar(const Scalar &value)
Set all values in the vector with the given value.
virtual void Xpetra_randomize()
Set vector values to random numbers. XPetra implementation.
Teuchos::RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getMultiVector(size_t r) const
return partial Vector associated with block row r
virtual void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.