Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_BlockedVector_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Xpetra: A linear algebra interface package
4 //
5 // Copyright 2012 NTESS and the Xpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef XPETRA_BLOCKEDVECTOR_DECL_HPP
11 #define XPETRA_BLOCKEDVECTOR_DECL_HPP
12 
13 /* this file is automatically generated - do not edit (see script/interfaces.py) */
14 
15 #include "Xpetra_ConfigDefs.hpp"
16 
19 #include "Xpetra_Map_decl.hpp"
20 #include "Xpetra_Vector.hpp"
21 
22 namespace Xpetra {
23 
24 template <class Scalar,
25  class LocalOrdinal,
26  class GlobalOrdinal,
27  class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
29  : public virtual Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>,
30  public virtual Xpetra::BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
31  public:
32  using scalar_type = Scalar;
33  using local_ordinal_type = LocalOrdinal;
34  using global_ordinal_type = GlobalOrdinal;
35  using node_type = Node;
36 
46 
47  private:
48 #undef XPETRA_BLOCKEDVECTOR_SHORT
49 #include "Xpetra_UseShortNames.hpp"
50 
51  public:
53 
54 
56 
64  BlockedVector(const Teuchos::RCP<const BlockedMap>& map, bool zeroOut = true);
65 
79 
93 
95  virtual ~BlockedVector();
96 
106 
108 
110 
112  virtual void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar& value);
113 
115  virtual void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar& value);
116 
118  virtual void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar& value);
119 
121  virtual void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar& value);
122 
124  virtual void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar& value);
125 
127  virtual void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar& value);
128 
130  virtual void replaceLocalValue(LocalOrdinal myRow, const Scalar& value);
131 
133  virtual void sumIntoLocalValue(LocalOrdinal myRow, const Scalar& value);
134 
136  virtual void putScalar(const Scalar& value);
137 
139 
141 
142 
144  virtual Teuchos::RCP<const Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
145  getVector(size_t j) const;
146 
148  virtual Teuchos::RCP<Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
149  getVectorNonConst(size_t j);
150 
152  virtual Teuchos::ArrayRCP<const Scalar> getData(size_t j) const;
153 
155  virtual Teuchos::ArrayRCP<Scalar> getDataNonConst(size_t j);
156 
158 
160 
161 
164  const Teuchos::ArrayView<Scalar>& dots) const;
165 
166  virtual Scalar dot(const Xpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A) const;
167 
170 
173 
175  virtual void scale(const Scalar& alpha);
176 
178  virtual void scale(Teuchos::ArrayView<const Scalar> alpha);
179 
180  virtual void update(const Scalar& alpha,
182  const Scalar& beta);
183 
185  virtual void update(const Scalar& alpha,
187  const Scalar& beta,
189  const Scalar& gamma);
190 
192  virtual typename Teuchos::ScalarTraits<Scalar>::magnitudeType norm1() const;
193 
195  virtual typename Teuchos::ScalarTraits<Scalar>::magnitudeType norm2() const;
196 
198  virtual typename Teuchos::ScalarTraits<Scalar>::magnitudeType normInf() const;
199 
201  virtual void norm1(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType>& norms) const;
202 
204  virtual void norm2(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType>& norms) const;
205 
207  virtual void normInf(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType>& norms) const;
208 
211  virtual void meanValue(const Teuchos::ArrayView<Scalar>& /* means */) const;
212 
213  virtual Scalar meanValue() const;
214 
216  virtual void multiply(Teuchos::ETransp /* transA */,
217  Teuchos::ETransp /* transB */,
218  const Scalar& /* alpha */,
221  const Scalar& /* beta */);
222 
223  virtual void multiply(Teuchos::ETransp /* transA */,
224  Teuchos::ETransp /* transB */,
225  const Scalar& /* alpha */,
228  const Scalar& /* beta */);
229 
230  virtual void elementWiseMultiply(Scalar /* scalarAB */,
233  Scalar /* scalarThis */);
234 
236  virtual void elementWiseMultiply(Scalar /* scalarAB */,
239  Scalar /* scalarThis */);
240 
242 
244 
245 
247  virtual size_t getNumVectors() const;
248 
250  virtual size_t getLocalLength() const;
251 
253  virtual global_size_t getGlobalLength() const;
254 
257 
259 
261 
262 
264  virtual std::string description() const;
265 
267  virtual void describe(Teuchos::FancyOStream& out,
268  const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const;
269 
270  virtual void replaceMap(const RCP<const Map>& map);
271 
273  virtual void doImport(const DistObject<Scalar, LocalOrdinal, GlobalOrdinal, Node>& /* source */,
274  const Import& /* importer */,
275  CombineMode /* CM */);
276 
279  const Import& /* importer */,
280  CombineMode /* CM */);
281 
283  virtual void doImport(const DistObject<Scalar, LocalOrdinal, GlobalOrdinal, Node>& /* source */,
284  const Export& /* exporter */,
285  CombineMode /* CM */);
286 
289  const Export& /* exporter */,
290  CombineMode /* CM */);
291 
293 
295 
296 
298  virtual void setSeed(unsigned int seed);
299 
300  virtual void randomize(bool bUseXpetraImplementation = false);
301 
302  virtual void randomize(const Scalar& minVal, const Scalar& maxVal, bool bUseXpetraImplementation = false);
303 
305  virtual void Xpetra_randomize();
306 
308  virtual void Xpetra_randomize(const Scalar& minVal, const Scalar& maxVal);
309 
311 
313  Teuchos::RCP<const Map> getMap() const;
314 
316  Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
317  getMultiVector(size_t r) const;
318 
320  Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
321  getMultiVector(size_t r, bool bThyraMode) const;
322 
324  void
325  setMultiVector(size_t r,
327  bool bThyraMode);
328 
330  Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
331  Merge() const;
332 
333  protected:
341 
342  // virtual void assign (const MultiVector& rhs);
343 
344  // private:
345  // Teuchos::RCP<const BlockedMap> map_; ///< blocked map containing the sub block maps (either thyra or xpetra mode)
346  // std::vector<Teuchos::RCP<Vector> > vv_; ///< array containing RCPs of the partial vectors
347 
348 }; // BlockedVector class
349 
350 } // namespace Xpetra
351 
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.
virtual void randomize(bool bUseXpetraImplementation=false)
Set multi-vector values to random numbers.
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.