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 // ***********************************************************************
4 //
5 // Xpetra: A linear algebra interface package
6 // Copyright 2012 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact
39 // Jonathan Hu (jhu@sandia.gov)
40 // Andrey Prokopenko (aprokop@sandia.gov)
41 // Ray Tuminaro (rstumin@sandia.gov)
42 //
43 // ***********************************************************************
44 //
45 // @HEADER
46 #ifndef XPETRA_EPETRAVECTOR_HPP
47 #define XPETRA_EPETRAVECTOR_HPP
48 
49 /* this file is automatically generated - do not edit (see script/epetra.py) */
50 
52 
53 #include "Xpetra_Vector.hpp"
55 #include "Xpetra_EpetraMap.hpp" //TMP
56 #include "Xpetra_Utils.hpp"
57 #include "Xpetra_EpetraImport.hpp"
58 #include "Xpetra_EpetraExport.hpp"
59 #include "Xpetra_Exceptions.hpp"
60 
61 #include <Epetra_Vector.h>
62 
63 #if defined(XPETRA_ENABLE_DEPRECATED_CODE)
64 #ifdef __GNUC__
65 #warning "The header file Trilinos/packages/xpetra/src/Vector/Xpetra_EpetraVector.hpp is deprecated."
66 #endif
67 #else
68 #error "The header file Trilinos/packages/xpetra/src/Vector/Xpetra_EpetraVector.hpp is deprecated."
69 #endif
70 
71 namespace Xpetra {
72 
73 // TODO: move that elsewhere
74 template <class GlobalOrdinal, class Node>
75 XPETRA_DEPRECATED Epetra_Vector &toEpetra(Vector<double, int, GlobalOrdinal, Node> &);
76 
77 template <class GlobalOrdinal, class Node>
78 XPETRA_DEPRECATED const Epetra_Vector &toEpetra(const Vector<double, int, GlobalOrdinal, Node> &);
79 //
80 
81 template <class EpetraGlobalOrdinal, class Node>
82 class XPETRA_DEPRECATED EpetraVectorT
83  : public virtual Vector<double, int, EpetraGlobalOrdinal, Node>,
84  public EpetraMultiVectorT<EpetraGlobalOrdinal, Node> {
85  typedef double Scalar;
86  typedef int LocalOrdinal;
87  typedef EpetraGlobalOrdinal GlobalOrdinal;
88 
89  public:
91  void norm1(const Teuchos::ArrayView<Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
92 
94  void norm2(const Teuchos::ArrayView<Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
95 
97  void normInf(const Teuchos::ArrayView<Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
98 
100  void meanValue(const Teuchos::ArrayView<Scalar> &means) const {}
101 
103  void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {}
104 
106  void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {}
107 
109  void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {}
110 
112  void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {}
113 
115  void dot(const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const Teuchos::ArrayView<Scalar> &dots) const {}
116 
118 
119 
121  explicit EpetraVectorT(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, bool zeroOut = true)
122  : EpetraMultiVectorT<GlobalOrdinal, Node>(map, 1, zeroOut){};
123 
124  // Commenting out since no definition provided in cpp.
126  // EpetraVectorT(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
127 
129  virtual ~EpetraVectorT() {}
130 
132 
134 
135 
137  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value){};
138 
140  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value){};
141 
143  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value){};
144 
146  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value){};
147 
149 
151 
152 
154  Scalar dot(const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &a) const { return Teuchos::ScalarTraits<Scalar>::zero(); };
155 
157  Teuchos::ScalarTraits<Scalar>::magnitudeType norm1() const { return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); };
158 
160  Teuchos::ScalarTraits<Scalar>::magnitudeType norm2() const { return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); };
161 
163  Teuchos::ScalarTraits<Scalar>::magnitudeType normInf() const { return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); };
164 
166  // Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
167 
169  Scalar meanValue() const { return Teuchos::ScalarTraits<Scalar>::zero(); };
170 
172 
174 
175 
177  std::string description() const { return std::string(""); }
178 
180  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {};
181 
183 
185 
186 
188  EpetraVectorT(const Teuchos::RCP<Epetra_Vector> &vec)
189  : EpetraMultiVectorT<GlobalOrdinal, Node>(vec) { // TODO: removed const of Epetra::Vector
190  TEUCHOS_TEST_FOR_EXCEPTION(true, Xpetra::Exceptions::RuntimeError,
191  "Xpetra::EpetraVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
192  }
193 
195  Epetra_Vector *getEpetra_Vector() const { return NULL; /*return (*this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector())(0);*/ }
196  // RCP<Epetra_Vector> getEpetra_Vector() const { return this->EpetraMultiVectorT<GlobalOrdinal>::getEpetra_MultiVector()->getVectorNonConst(0); }
197 
201  EpetraVectorT(const RCP<Epetra_MultiVector> &mv, size_t j)
203 
205 
206  private:
207  // 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)
208  // TODO remove this...
209  const RCP<const Epetra_MultiVector> internalRefToBaseMV_;
210 
211 }; // EpetraVectorT class
212 
213 // specialization on GO=int and Node=Serial
214 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
215 template <>
217  : public virtual Vector<double, int, int, EpetraNode>, public EpetraMultiVectorT<int, EpetraNode> {
218  typedef double Scalar;
219  typedef int LocalOrdinal;
220  typedef int GlobalOrdinal;
221  typedef EpetraNode Node;
222 
223  public:
224  using EpetraMultiVectorT<GlobalOrdinal, Node>::dot; // overloading, not hiding
225  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm1; // overloading, not hiding
226  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm2; // overloading, not hiding
227  using EpetraMultiVectorT<GlobalOrdinal, Node>::normInf; // overloading, not hiding
228  using EpetraMultiVectorT<GlobalOrdinal, Node>::meanValue; // overloading, not hiding
229  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceGlobalValue; // overloading, not hiding
230  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoGlobalValue; // overloading, not hiding
231  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceLocalValue; // overloading, not hiding
232  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoLocalValue; // overloading, not hiding
233 
235 
236 
238  explicit EpetraVectorT(const Teuchos::RCP<const Map<int, GlobalOrdinal, Node> > &map, bool zeroOut = true)
239  : EpetraMultiVectorT<GlobalOrdinal, Node>(map, 1, zeroOut) {}
240 
241  // Commenting out since no definition provided in cpp.
243  // EpetraVectorT(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
244 
246  virtual ~EpetraVectorT() {}
247 
249 
251 
252 
254  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {
255  XPETRA_MONITOR("EpetraVectorT::replaceGlobalValue");
256  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->ReplaceGlobalValue(globalRow, 0, value);
257  }
258 
260  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {
261  XPETRA_MONITOR("EpetraVectorT::sumIntoGlobalValue");
262  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->SumIntoGlobalValue(globalRow, 0, value);
263  }
264 
266  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) {
267  XPETRA_MONITOR("EpetraVectorT::replaceLocalValue");
268  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->ReplaceMyValue(myRow, 0, value);
269  }
270 
272  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) {
273  XPETRA_MONITOR("EpetraVectorT::sumIntoLocalValue");
274  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->SumIntoMyValue(myRow, 0, value);
275  }
276 
278 
280 
281 
284  XPETRA_MONITOR("EpetraVectorT::dot");
285 
286  XPETRA_DYNAMIC_CAST(const EpetraVectorT, a, tA, "This Xpetra::EpetraVectorT method only accept Xpetra::EpetraVectorT as input arguments.");
287  // return getEpetra_Vector()->Dot(*tA.getEpetra_Vector());
288 
289  // other way: use the MultiVector Dot instead of VectorDot:
290  double r;
291  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->Epetra_MultiVector::Dot(*tA.getEpetra_MultiVector(), &r);
292  return r;
293  }
294 
296  Teuchos::ScalarTraits<Scalar>::magnitudeType norm1() const {
297  XPETRA_MONITOR("EpetraVectorT::norm1");
298  Scalar r;
300  return r;
301  }
302 
304  Teuchos::ScalarTraits<Scalar>::magnitudeType norm2() const {
305  XPETRA_MONITOR("EpetraVectorT::norm2");
306  Scalar r;
308  return r;
309  }
310 
312  Teuchos::ScalarTraits<Scalar>::magnitudeType normInf() const {
313  XPETRA_MONITOR("EpetraVectorT::normInf");
314  Scalar r;
316  return r;
317  }
318 
320  // Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
321 
323  Scalar meanValue() const {
324  XPETRA_MONITOR("EpetraVectorT::meanValue");
325  Scalar r;
327  return r;
328  }
329 
331 
333 
334 
336  std::string description() const {
337  XPETRA_MONITOR("EpetraVectorT::description");
338  // This implementation come from Epetra_Vector_def.hpp (without modification)
339  std::ostringstream oss;
340  oss << Teuchos::Describable::description();
341  oss << "{length=" << this->getGlobalLength()
342  << "}";
343  return oss.str();
344  }
345 
347  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {
348  XPETRA_MONITOR("EpetraVectorT::describe");
349 
350  if (verbLevel > Teuchos::VERB_NONE) {
351  getEpetra_Vector()->Print(out);
352  }
353  }
355 
357 
358 
360  EpetraVectorT(const Teuchos::RCP<Epetra_Vector> &vec)
361  : EpetraMultiVectorT<GlobalOrdinal, Node>(vec) {} // TODO: removed const of Epetra::Vector
362 
365  // RCP<Epetra_Vector> getEpetra_Vector() const { return this->EpetraMultiVectorT<GlobalOrdinal>::getEpetra_MultiVector()->getVectorNonConst(0); }
366 
370  EpetraVectorT(const RCP<Epetra_MultiVector> &mv, size_t j)
371  : EpetraMultiVectorT<GlobalOrdinal, Node>(rcp((*mv)(j), false))
372  , // view of the vector number j. false == I do not own the data.
373  internalRefToBaseMV_(mv) // keep an internal reference to the initial MultiVector to avoid desallocation of the view.
374  {
375  // The view of the internal data of 'mv' is only valid until the destruction of 'mv'.
376  // The new vector hold an internal reference to 'mv' in order to keep the view valid after disappearance of 'mv' references in user code.
377  // This implements the logic of subArray rcp (as required by the Tpetra interface).
378  }
379 
381 
382  private:
383  // 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)
384  const RCP<const Epetra_MultiVector> internalRefToBaseMV_;
385 };
386 #endif
387 
388 // specialization on GO=long long and Node=Serial
389 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
390 template <>
391 class EpetraVectorT<long long, EpetraNode>
392  : public virtual Vector<double, int, long long, EpetraNode>, public EpetraMultiVectorT<long long, EpetraNode> {
393  typedef double Scalar;
394  typedef int LocalOrdinal;
395  typedef long long GlobalOrdinal;
396  typedef EpetraNode Node;
397 
398  public:
399  using EpetraMultiVectorT<GlobalOrdinal, Node>::dot; // overloading, not hiding
400  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm1; // overloading, not hiding
401  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm2; // overloading, not hiding
402  using EpetraMultiVectorT<GlobalOrdinal, Node>::normInf; // overloading, not hiding
403  using EpetraMultiVectorT<GlobalOrdinal, Node>::meanValue; // overloading, not hiding
404  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceGlobalValue; // overloading, not hiding
405  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoGlobalValue; // overloading, not hiding
406  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceLocalValue; // overloading, not hiding
407  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoLocalValue; // overloading, not hiding
408 
410 
411 
413  explicit EpetraVectorT(const Teuchos::RCP<const Map<int, GlobalOrdinal, Node> > &map, bool zeroOut = true)
414  : EpetraMultiVectorT<GlobalOrdinal, Node>(map, 1, zeroOut) {}
415 
416  // Commenting out since no definition provided in cpp.
418  // EpetraVectorT(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
419 
421  virtual ~EpetraVectorT() {}
422 
424 
426 
427 
429  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {
430  XPETRA_MONITOR("EpetraVectorT::replaceGlobalValue");
431  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->ReplaceGlobalValue(globalRow, 0, value);
432  }
433 
435  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {
436  XPETRA_MONITOR("EpetraVectorT::sumIntoGlobalValue");
437  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->SumIntoGlobalValue(globalRow, 0, value);
438  }
439 
441  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) {
442  XPETRA_MONITOR("EpetraVectorT::replaceLocalValue");
443  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->ReplaceMyValue(myRow, 0, value);
444  }
445 
447  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) {
448  XPETRA_MONITOR("EpetraVectorT::sumIntoLocalValue");
449  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->SumIntoMyValue(myRow, 0, value);
450  }
451 
453 
455 
456 
459  XPETRA_MONITOR("EpetraVectorT::dot");
460 
461  XPETRA_DYNAMIC_CAST(const EpetraVectorT, a, tA, "This Xpetra::EpetraVectorT method only accept Xpetra::EpetraVectorT as input arguments.");
462  // return getEpetra_Vector()->Dot(*tA.getEpetra_Vector());
463 
464  // other way: use the MultiVector Dot instead of VectorDot:
465  double r;
466  this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector()->Epetra_MultiVector::Dot(*tA.getEpetra_MultiVector(), &r);
467  return r;
468  }
469 
471  Teuchos::ScalarTraits<Scalar>::magnitudeType norm1() const {
472  XPETRA_MONITOR("EpetraVectorT::norm1");
473  Scalar r;
475  return r;
476  }
477 
479  Teuchos::ScalarTraits<Scalar>::magnitudeType norm2() const {
480  XPETRA_MONITOR("EpetraVectorT::norm2");
481  Scalar r;
483  return r;
484  }
485 
487  Teuchos::ScalarTraits<Scalar>::magnitudeType normInf() const {
488  XPETRA_MONITOR("EpetraVectorT::normInf");
489  Scalar r;
491  return r;
492  }
493 
495  // Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
496 
498  Scalar meanValue() const {
499  XPETRA_MONITOR("EpetraVectorT::meanValue");
500  Scalar r;
502  return r;
503  }
504 
506 
508 
509 
511  std::string description() const {
512  XPETRA_MONITOR("EpetraVectorT::description");
513  // This implementation come from Epetra_Vector_def.hpp (without modification)
514  std::ostringstream oss;
515  oss << Teuchos::Describable::description();
516  oss << "{length=" << this->getGlobalLength()
517  << "}";
518  return oss.str();
519  }
520 
522  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {
523  XPETRA_MONITOR("EpetraVectorT::describe");
524 
525  if (verbLevel > Teuchos::VERB_NONE) {
526  getEpetra_Vector()->Print(out);
527  }
528  }
530 
532 
533 
535  EpetraVectorT(const Teuchos::RCP<Epetra_Vector> &vec)
536  : EpetraMultiVectorT<GlobalOrdinal, Node>(vec) {} // TODO: removed const of Epetra::Vector
537 
540  // RCP<Epetra_Vector> getEpetra_Vector() const { return this->EpetraMultiVectorT<GlobalOrdinal>::getEpetra_MultiVector()->getVectorNonConst(0); }
541 
545  EpetraVectorT(const RCP<Epetra_MultiVector> &mv, size_t j)
546  : EpetraMultiVectorT<GlobalOrdinal, Node>(rcp((*mv)(j), false))
547  , // view of the vector number j. false == I do not own the data.
548  internalRefToBaseMV_(mv) // keep an internal reference to the initial MultiVector to avoid desallocation of the view.
549  {
550  // The view of the internal data of 'mv' is only valid until the destruction of 'mv'.
551  // The new vector hold an internal reference to 'mv' in order to keep the view valid after disappearance of 'mv' references in user code.
552  // This implements the logic of subArray rcp (as required by the Tpetra interface).
553  }
554 
556 
557  private:
558  // 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)
559  const RCP<const Epetra_MultiVector> internalRefToBaseMV_;
560 };
561 #endif
562 
563 } // namespace Xpetra
564 
565 #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.