Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_EpetraVector.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_EPETRAVECTOR_HPP
11 #define XPETRA_EPETRAVECTOR_HPP
12 
13 /* this file is automatically generated - do not edit (see script/epetra.py) */
14 
16 
17 #include "Xpetra_Vector.hpp"
19 #include "Xpetra_EpetraMap.hpp" //TMP
20 #include "Xpetra_Utils.hpp"
21 #include "Xpetra_EpetraImport.hpp"
22 #include "Xpetra_EpetraExport.hpp"
23 #include "Xpetra_Exceptions.hpp"
24 
25 #include <Epetra_Vector.h>
26 
27 #if defined(XPETRA_ENABLE_DEPRECATED_CODE)
28 #ifdef __GNUC__
29 #if defined(Xpetra_SHOW_DEPRECATED_WARNINGS)
30 #warning "The header file Trilinos/packages/xpetra/src/Vector/Xpetra_EpetraVector.hpp is deprecated."
31 #endif
32 #endif
33 #else
34 #error "The header file Trilinos/packages/xpetra/src/Vector/Xpetra_EpetraVector.hpp is deprecated."
35 #endif
36 
37 namespace Xpetra {
38 
39 // TODO: move that elsewhere
40 template <class GlobalOrdinal, class Node>
41 XPETRA_DEPRECATED Epetra_Vector &toEpetra(Vector<double, int, GlobalOrdinal, Node> &);
42 
43 template <class GlobalOrdinal, class Node>
44 XPETRA_DEPRECATED const Epetra_Vector &toEpetra(const Vector<double, int, GlobalOrdinal, Node> &);
45 //
46 
47 template <class EpetraGlobalOrdinal, class Node>
48 class XPETRA_DEPRECATED EpetraVectorT
49  : public virtual Vector<double, int, EpetraGlobalOrdinal, Node>,
50  public EpetraMultiVectorT<EpetraGlobalOrdinal, Node> {
51  typedef double Scalar;
52  typedef int LocalOrdinal;
53  typedef EpetraGlobalOrdinal GlobalOrdinal;
54 
55  public:
57  void norm1(const Teuchos::ArrayView<Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
58 
60  void norm2(const Teuchos::ArrayView<Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
61 
63  void normInf(const Teuchos::ArrayView<Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
64 
66  void meanValue(const Teuchos::ArrayView<Scalar> &means) const {}
67 
69  void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {}
70 
72  void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {}
73 
75  void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {}
76 
78  void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {}
79 
81  void dot(const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const Teuchos::ArrayView<Scalar> &dots) const {}
82 
84 
85 
87  explicit EpetraVectorT(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, bool zeroOut = true)
88  : EpetraMultiVectorT<GlobalOrdinal, Node>(map, 1, zeroOut){};
89 
90  // Commenting out since no definition provided in cpp.
92  // EpetraVectorT(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
93 
95  virtual ~EpetraVectorT() {}
96 
98 
100 
101 
103  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value){};
104 
106  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value){};
107 
109  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value){};
110 
112  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value){};
113 
115 
117 
118 
120  Scalar dot(const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &a) const { return Teuchos::ScalarTraits<Scalar>::zero(); };
121 
123  Teuchos::ScalarTraits<Scalar>::magnitudeType norm1() const { return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); };
124 
126  Teuchos::ScalarTraits<Scalar>::magnitudeType norm2() const { return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); };
127 
129  Teuchos::ScalarTraits<Scalar>::magnitudeType normInf() const { return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); };
130 
132  // Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
133 
135  Scalar meanValue() const { return Teuchos::ScalarTraits<Scalar>::zero(); };
136 
138 
140 
141 
143  std::string description() const { return std::string(""); }
144 
146  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {};
147 
149 
151 
152 
154  EpetraVectorT(const Teuchos::RCP<Epetra_Vector> &vec)
155  : EpetraMultiVectorT<GlobalOrdinal, Node>(vec) { // TODO: removed const of Epetra::Vector
156  TEUCHOS_TEST_FOR_EXCEPTION(true, Xpetra::Exceptions::RuntimeError,
157  "Xpetra::EpetraVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
158  }
159 
161  Epetra_Vector *getEpetra_Vector() const { return NULL; /*return (*this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector())(0);*/ }
162  // RCP<Epetra_Vector> getEpetra_Vector() const { return this->EpetraMultiVectorT<GlobalOrdinal>::getEpetra_MultiVector()->getVectorNonConst(0); }
163 
167  EpetraVectorT(const RCP<Epetra_MultiVector> &mv, size_t j)
169 
171 
172  private:
173  // This private member is only used by the constructor EpetraVectorT(const RCP<EpetraMultiVectorT<GlobalOrdinal> > &mv, size_t j). The actual private member holding the Epetra vector (vec_) is in the base class (Xpetra:EpetraMultiVectorT)
174  // TODO remove this...
175  const RCP<const Epetra_MultiVector> internalRefToBaseMV_;
176 
177 }; // EpetraVectorT class
178 
179 // specialization on GO=int and Node=Serial
180 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
181 template <>
183  : public virtual Vector<double, int, int, EpetraNode>, public EpetraMultiVectorT<int, EpetraNode> {
184  typedef double Scalar;
185  typedef int LocalOrdinal;
186  typedef int GlobalOrdinal;
187  typedef EpetraNode Node;
188 
189  public:
190  using EpetraMultiVectorT<GlobalOrdinal, Node>::dot; // overloading, not hiding
191  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm1; // overloading, not hiding
192  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm2; // overloading, not hiding
193  using EpetraMultiVectorT<GlobalOrdinal, Node>::normInf; // overloading, not hiding
194  using EpetraMultiVectorT<GlobalOrdinal, Node>::meanValue; // overloading, not hiding
195  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceGlobalValue; // overloading, not hiding
196  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoGlobalValue; // overloading, not hiding
197  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceLocalValue; // overloading, not hiding
198  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoLocalValue; // overloading, not hiding
199 
201 
202 
204  explicit EpetraVectorT(const Teuchos::RCP<const Map<int, GlobalOrdinal, Node> > &map, bool zeroOut = true)
205  : EpetraMultiVectorT<GlobalOrdinal, Node>(map, 1, zeroOut) {}
206 
207  // Commenting out since no definition provided in cpp.
209  // EpetraVectorT(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
210 
212  virtual ~EpetraVectorT() {}
213 
215 
217 
218 
220  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {
221  XPETRA_MONITOR("EpetraVectorT::replaceGlobalValue");
222  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->ReplaceGlobalValue(globalRow, 0, value);
223  }
224 
226  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {
227  XPETRA_MONITOR("EpetraVectorT::sumIntoGlobalValue");
228  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->SumIntoGlobalValue(globalRow, 0, value);
229  }
230 
232  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) {
233  XPETRA_MONITOR("EpetraVectorT::replaceLocalValue");
234  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->ReplaceMyValue(myRow, 0, value);
235  }
236 
238  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) {
239  XPETRA_MONITOR("EpetraVectorT::sumIntoLocalValue");
240  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->SumIntoMyValue(myRow, 0, value);
241  }
242 
244 
246 
247 
250  XPETRA_MONITOR("EpetraVectorT::dot");
251 
252  XPETRA_DYNAMIC_CAST(const EpetraVectorT, a, tA, "This Xpetra::EpetraVectorT method only accept Xpetra::EpetraVectorT as input arguments.");
253  // return getEpetra_Vector()->Dot(*tA.getEpetra_Vector());
254 
255  // other way: use the MultiVector Dot instead of VectorDot:
256  double r;
257  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->Epetra_MultiVector::Dot(*tA.getEpetra_MultiVector(), &r);
258  return r;
259  }
260 
262  Teuchos::ScalarTraits<Scalar>::magnitudeType norm1() const {
263  XPETRA_MONITOR("EpetraVectorT::norm1");
264  Scalar r;
266  return r;
267  }
268 
270  Teuchos::ScalarTraits<Scalar>::magnitudeType norm2() const {
271  XPETRA_MONITOR("EpetraVectorT::norm2");
272  Scalar r;
274  return r;
275  }
276 
278  Teuchos::ScalarTraits<Scalar>::magnitudeType normInf() const {
279  XPETRA_MONITOR("EpetraVectorT::normInf");
280  Scalar r;
282  return r;
283  }
284 
286  // Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
287 
289  Scalar meanValue() const {
290  XPETRA_MONITOR("EpetraVectorT::meanValue");
291  Scalar r;
293  return r;
294  }
295 
297 
299 
300 
302  std::string description() const {
303  XPETRA_MONITOR("EpetraVectorT::description");
304  // This implementation come from Epetra_Vector_def.hpp (without modification)
305  std::ostringstream oss;
306  oss << Teuchos::Describable::description();
307  oss << "{length=" << this->getGlobalLength()
308  << "}";
309  return oss.str();
310  }
311 
313  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {
314  XPETRA_MONITOR("EpetraVectorT::describe");
315 
316  if (verbLevel > Teuchos::VERB_NONE) {
317  getEpetra_Vector()->Print(out);
318  }
319  }
321 
323 
324 
326  EpetraVectorT(const Teuchos::RCP<Epetra_Vector> &vec)
327  : EpetraMultiVectorT<GlobalOrdinal, Node>(vec) {} // TODO: removed const of Epetra::Vector
328 
331  // RCP<Epetra_Vector> getEpetra_Vector() const { return this->EpetraMultiVectorT<GlobalOrdinal>::getEpetra_MultiVector()->getVectorNonConst(0); }
332 
336  EpetraVectorT(const RCP<Epetra_MultiVector> &mv, size_t j)
337  : EpetraMultiVectorT<GlobalOrdinal, Node>(rcp((*mv)(j), false))
338  , // view of the vector number j. false == I do not own the data.
339  internalRefToBaseMV_(mv) // keep an internal reference to the initial MultiVector to avoid desallocation of the view.
340  {
341  // The view of the internal data of 'mv' is only valid until the destruction of 'mv'.
342  // The new vector hold an internal reference to 'mv' in order to keep the view valid after disappearance of 'mv' references in user code.
343  // This implements the logic of subArray rcp (as required by the Tpetra interface).
344  }
345 
347 
348  private:
349  // This private member is only used by the constructor EpetraVectorT(const RCP<EpetraMultiVectorT<GlobalOrdinal> > &mv, size_t j). The actual private member holding the Epetra vector (vec_) is in the base class (Xpetra:EpetraMultiVectorT)
350  const RCP<const Epetra_MultiVector> internalRefToBaseMV_;
351 };
352 #endif
353 
354 // specialization on GO=long long and Node=Serial
355 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
356 template <>
357 class EpetraVectorT<long long, EpetraNode>
358  : public virtual Vector<double, int, long long, EpetraNode>, public EpetraMultiVectorT<long long, EpetraNode> {
359  typedef double Scalar;
360  typedef int LocalOrdinal;
361  typedef long long GlobalOrdinal;
362  typedef EpetraNode Node;
363 
364  public:
365  using EpetraMultiVectorT<GlobalOrdinal, Node>::dot; // overloading, not hiding
366  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm1; // overloading, not hiding
367  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm2; // overloading, not hiding
368  using EpetraMultiVectorT<GlobalOrdinal, Node>::normInf; // overloading, not hiding
369  using EpetraMultiVectorT<GlobalOrdinal, Node>::meanValue; // overloading, not hiding
370  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceGlobalValue; // overloading, not hiding
371  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoGlobalValue; // overloading, not hiding
372  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceLocalValue; // overloading, not hiding
373  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoLocalValue; // overloading, not hiding
374 
376 
377 
379  explicit EpetraVectorT(const Teuchos::RCP<const Map<int, GlobalOrdinal, Node> > &map, bool zeroOut = true)
380  : EpetraMultiVectorT<GlobalOrdinal, Node>(map, 1, zeroOut) {}
381 
382  // Commenting out since no definition provided in cpp.
384  // EpetraVectorT(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
385 
387  virtual ~EpetraVectorT() {}
388 
390 
392 
393 
395  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {
396  XPETRA_MONITOR("EpetraVectorT::replaceGlobalValue");
397  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->ReplaceGlobalValue(globalRow, 0, value);
398  }
399 
401  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {
402  XPETRA_MONITOR("EpetraVectorT::sumIntoGlobalValue");
403  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->SumIntoGlobalValue(globalRow, 0, value);
404  }
405 
407  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) {
408  XPETRA_MONITOR("EpetraVectorT::replaceLocalValue");
409  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->ReplaceMyValue(myRow, 0, value);
410  }
411 
413  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) {
414  XPETRA_MONITOR("EpetraVectorT::sumIntoLocalValue");
415  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->SumIntoMyValue(myRow, 0, value);
416  }
417 
419 
421 
422 
425  XPETRA_MONITOR("EpetraVectorT::dot");
426 
427  XPETRA_DYNAMIC_CAST(const EpetraVectorT, a, tA, "This Xpetra::EpetraVectorT method only accept Xpetra::EpetraVectorT as input arguments.");
428  // return getEpetra_Vector()->Dot(*tA.getEpetra_Vector());
429 
430  // other way: use the MultiVector Dot instead of VectorDot:
431  double r;
432  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->Epetra_MultiVector::Dot(*tA.getEpetra_MultiVector(), &r);
433  return r;
434  }
435 
437  Teuchos::ScalarTraits<Scalar>::magnitudeType norm1() const {
438  XPETRA_MONITOR("EpetraVectorT::norm1");
439  Scalar r;
441  return r;
442  }
443 
445  Teuchos::ScalarTraits<Scalar>::magnitudeType norm2() const {
446  XPETRA_MONITOR("EpetraVectorT::norm2");
447  Scalar r;
449  return r;
450  }
451 
453  Teuchos::ScalarTraits<Scalar>::magnitudeType normInf() const {
454  XPETRA_MONITOR("EpetraVectorT::normInf");
455  Scalar r;
457  return r;
458  }
459 
461  // Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
462 
464  Scalar meanValue() const {
465  XPETRA_MONITOR("EpetraVectorT::meanValue");
466  Scalar r;
468  return r;
469  }
470 
472 
474 
475 
477  std::string description() const {
478  XPETRA_MONITOR("EpetraVectorT::description");
479  // This implementation come from Epetra_Vector_def.hpp (without modification)
480  std::ostringstream oss;
481  oss << Teuchos::Describable::description();
482  oss << "{length=" << this->getGlobalLength()
483  << "}";
484  return oss.str();
485  }
486 
488  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {
489  XPETRA_MONITOR("EpetraVectorT::describe");
490 
491  if (verbLevel > Teuchos::VERB_NONE) {
492  getEpetra_Vector()->Print(out);
493  }
494  }
496 
498 
499 
501  EpetraVectorT(const Teuchos::RCP<Epetra_Vector> &vec)
502  : EpetraMultiVectorT<GlobalOrdinal, Node>(vec) {} // TODO: removed const of Epetra::Vector
503 
506  // RCP<Epetra_Vector> getEpetra_Vector() const { return this->EpetraMultiVectorT<GlobalOrdinal>::getEpetra_MultiVector()->getVectorNonConst(0); }
507 
511  EpetraVectorT(const RCP<Epetra_MultiVector> &mv, size_t j)
512  : EpetraMultiVectorT<GlobalOrdinal, Node>(rcp((*mv)(j), false))
513  , // view of the vector number j. false == I do not own the data.
514  internalRefToBaseMV_(mv) // keep an internal reference to the initial MultiVector to avoid desallocation of the view.
515  {
516  // The view of the internal data of 'mv' is only valid until the destruction of 'mv'.
517  // The new vector hold an internal reference to 'mv' in order to keep the view valid after disappearance of 'mv' references in user code.
518  // This implements the logic of subArray rcp (as required by the Tpetra interface).
519  }
520 
522 
523  private:
524  // This private member is only used by the constructor EpetraVectorT(const RCP<EpetraMultiVectorT<GlobalOrdinal> > &mv, size_t j). The actual private member holding the Epetra vector (vec_) is in the base class (Xpetra:EpetraMultiVectorT)
525  const RCP<const Epetra_MultiVector> internalRefToBaseMV_;
526 };
527 #endif
528 
529 } // namespace Xpetra
530 
531 #endif // XPETRA_EPETRAVECTOR_HPP
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
EpetraVectorT(const Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
Scalar dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
Computes dot product of this Vector against input Vector x.
Scalar meanValue() const
Compute Weighted 2-norm (RMS Norm) of this Vector.
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Exception throws to report errors in the internal logical of the program.
EpetraVectorT(const RCP< Epetra_MultiVector > &mv, size_t j)
global_size_t getGlobalLength() const
Global number of rows in the multivector.
EpetraVectorT(const Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
std::string description() const
Return a simple one-line description of this object.
std::string description() const
Return a simple one-line description of this object.
Epetra_Vector * getEpetra_Vector() const
Get the underlying Epetra vector.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
virtual ~EpetraVectorT()
Vector copy constructor.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
const RCP< const Epetra_MultiVector > internalRefToBaseMV_
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
virtual ~EpetraVectorT()
Vector copy constructor.
Epetra_Vector * getEpetra_Vector() const
Get the underlying Epetra vector.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
EpetraGlobalOrdinal GlobalOrdinal
EpetraVectorT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
void dot(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Teuchos::ArrayView< Scalar > &dots) const
Compute the dot product of each corresponding pair of vectors (columns) in A and B.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
EpetraVectorT(const Teuchos::RCP< Epetra_Vector > &vec)
EpetraMultiVectorT constructor to wrap a Epetra_Vector object.
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.
EpetraVectorT(const RCP< Epetra_MultiVector > &mv, size_t j)
Scalar dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
Computes dot product of this Vector against input Vector x.
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 sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Scalar dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
Computes dot product of this Vector against input Vector x.
EpetraVectorT(const Teuchos::RCP< Epetra_Vector > &vec)
EpetraMultiVectorT constructor to wrap a Epetra_Vector object.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
const RCP< const Epetra_MultiVector > internalRefToBaseMV_
virtual ~EpetraVectorT()
Vector copy constructor.
EpetraVectorT(const Teuchos::RCP< Epetra_Vector > &vec)
EpetraMultiVectorT constructor to wrap a Epetra_Vector object.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Scalar meanValue() const
Compute Weighted 2-norm (RMS Norm) of this Vector.
Epetra_Vector * getEpetra_Vector() const
Get the underlying Epetra vector.
const RCP< const Epetra_MultiVector > internalRefToBaseMV_
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
RCP< Epetra_MultiVector > getEpetra_MultiVector() const
Get the underlying Epetra multivector.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
#define XPETRA_MONITOR(funcName)
std::string description() const
Return a simple one-line description of this object.
EpetraVectorT(const RCP< Epetra_MultiVector > &mv, size_t j)
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void meanValue(const Teuchos::ArrayView< Scalar > &means) const
Compute mean (average) value of each vector in multi-vector. The outcome of this routine is undefined...
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
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::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
Scalar meanValue() const
Compute Weighted 2-norm (RMS Norm) of this Vector.
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.