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 namespace Xpetra {
64 
65 // TODO: move that elsewhere
66 template<class GlobalOrdinal, class Node>
67 Epetra_Vector & toEpetra(Vector<double, int, GlobalOrdinal, Node> &);
68 
69 template<class GlobalOrdinal, class Node>
70 const Epetra_Vector & toEpetra(const Vector<double, int, GlobalOrdinal, Node> &);
71 //
72 
73 template<class EpetraGlobalOrdinal, class Node>
74 class EpetraVectorT
75  : public virtual Vector<double,int,EpetraGlobalOrdinal, Node>, public EpetraMultiVectorT<EpetraGlobalOrdinal, Node>
76 {
77 
78  typedef double Scalar;
79  typedef int LocalOrdinal;
80  typedef EpetraGlobalOrdinal GlobalOrdinal;
81 
82 public:
83 
86 
89 
92 
94  void meanValue(const Teuchos::ArrayView< Scalar > &means) const { }
95 
97  void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) { }
98 
100  void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) { }
101 
103  void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) { }
104 
106  void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) { }
107 
110 
112 
113 
115  explicit EpetraVectorT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true) : EpetraMultiVectorT<GlobalOrdinal, Node>(map,1,zeroOut) {};
116 
117  // Commenting out since no definition provided in cpp.
119  // EpetraVectorT(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
120 
122  virtual ~EpetraVectorT() { }
123 
125 
127 
128 
130  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {};
131 
133  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {};
134 
136  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) {};
137 
139  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) {};
140 
142 
144 
145 
148 
151 
154 
157 
159  //Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
160 
162  Scalar meanValue() const {return Teuchos::ScalarTraits<Scalar>::zero();};
163 
165 
167 
168 
170  std::string description() const { return std::string(""); }
171 
174 
176 
178 
179 
181  EpetraVectorT(const Teuchos::RCP<Epetra_Vector> &vec) : EpetraMultiVectorT<GlobalOrdinal, Node>(vec) { // TODO: removed const of Epetra::Vector
183  "Xpetra::EpetraVector only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
184  }
185 
187  Epetra_Vector * getEpetra_Vector() const { return NULL; /*return (*this->EpetraMultiVectorT<GlobalOrdinal, Node>::getEpetra_MultiVector())(0);*/ }
188  //RCP<Epetra_Vector> getEpetra_Vector() const { return this->EpetraMultiVectorT<GlobalOrdinal>::getEpetra_MultiVector()->getVectorNonConst(0); }
189 
193  EpetraVectorT(const RCP<Epetra_MultiVector> &mv, size_t j) : EpetraMultiVectorT<GlobalOrdinal, Node>(mv) {};
194 
195 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
197 
198  typename dual_view_type::t_host_um getHostLocalView () const {
200  }
201 
202  typename dual_view_type::t_dev_um getDeviceLocalView() const {
203  throw std::runtime_error("Epetra does not support device views!");
204  typename dual_view_type::t_dev ret;
205  return ret; // make compiler happy
206  }
207 
218  template<class TargetDeviceType>
219  typename Kokkos::Impl::if_c<
220  Kokkos::Impl::is_same<
221  typename dual_view_type::t_dev_um::execution_space::memory_space,
222  typename TargetDeviceType::memory_space>::value,
223  typename dual_view_type::t_dev_um,
224  typename dual_view_type::t_host_um>::type
225  getLocalView () const {
226  return this->MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
227  }
228 #endif
229 
231 
232 private:
233 
234  // 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)
235  // TODO remove this...
237 
238 }; // EpetraVectorT class
239 
240 // specialization on GO=int and Node=Serial
241 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
242 template<>
244 : public virtual Vector<double,int,int,EpetraNode>, public EpetraMultiVectorT<int,EpetraNode>
245 {
246  typedef double Scalar;
247  typedef int LocalOrdinal;
248  typedef int GlobalOrdinal;
249  typedef EpetraNode Node;
250 
251 public:
252 
253  using EpetraMultiVectorT<GlobalOrdinal, Node>::dot; // overloading, not hiding
254  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm1; // overloading, not hiding
255  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm2; // overloading, not hiding
256  using EpetraMultiVectorT<GlobalOrdinal, Node>::normInf; // overloading, not hiding
257  using EpetraMultiVectorT<GlobalOrdinal, Node>::meanValue; // overloading, not hiding
258  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceGlobalValue; // overloading, not hiding
259  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoGlobalValue; // overloading, not hiding
260  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceLocalValue; // overloading, not hiding
261  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoLocalValue; // overloading, not hiding
262 
263 
264 
266 
267 
269  explicit EpetraVectorT(const Teuchos::RCP<const Map<int,GlobalOrdinal,Node> > &map, bool zeroOut=true) : EpetraMultiVectorT<GlobalOrdinal, Node>(map,1,zeroOut) { }
270 
271  // Commenting out since no definition provided in cpp.
273  // EpetraVectorT(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
274 
276  virtual ~EpetraVectorT() { }
277 
279 
281 
282 
284  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::replaceGlobalValue"); this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->ReplaceGlobalValue(globalRow, 0, value); }
285 
287  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::sumIntoGlobalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->SumIntoGlobalValue(globalRow, 0, value); }
288 
290  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::replaceLocalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->ReplaceMyValue(myRow, 0, value); }
291 
293  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::sumIntoLocalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->SumIntoMyValue(myRow, 0, value); }
294 
296 
298 
299 
302  XPETRA_MONITOR("EpetraVectorT::dot");
303 
304  XPETRA_DYNAMIC_CAST(const EpetraVectorT, a, tA, "This Xpetra::EpetraVectorT method only accept Xpetra::EpetraVectorT as input arguments.");
305  // return getEpetra_Vector()->Dot(*tA.getEpetra_Vector());
306 
307  // other way: use the MultiVector Dot instead of VectorDot:
308  double r;
309  this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->Epetra_MultiVector::Dot(*tA.getEpetra_MultiVector(), &r);
310  return r;
311  }
312 
315 
318 
321 
323  //Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
324 
326  Scalar meanValue() const {
327  XPETRA_MONITOR("EpetraVectorT::meanValue");
328  Scalar r;
330  return r;
331  }
332 
334 
336 
337 
339  std::string description() const {
340  XPETRA_MONITOR("EpetraVectorT::description");
341  // This implementation come from Epetra_Vector_def.hpp (without modification)
342  std::ostringstream oss;
344  oss << "{length="<<this->getGlobalLength()
345  << "}";
346  return oss.str();
347  }
348 
351  XPETRA_MONITOR("EpetraVectorT::describe");
352 
353  if (verbLevel > Teuchos::VERB_NONE) {
354  getEpetra_Vector()->Print (out);
355  }
356  }
358 
360 
361 
363  EpetraVectorT(const Teuchos::RCP<Epetra_Vector> &vec) : EpetraMultiVectorT<GlobalOrdinal, Node>(vec) { } // TODO: removed const of Epetra::Vector
364 
367  //RCP<Epetra_Vector> getEpetra_Vector() const { return this->EpetraMultiVectorT<GlobalOrdinal>::getEpetra_MultiVector()->getVectorNonConst(0); }
368 
373  : EpetraMultiVectorT<GlobalOrdinal,Node>(rcp((*mv)(j), false)), // view of the vector number j. false == I do not own the data.
374  internalRefToBaseMV_(mv) // keep an internal reference to the initial MultiVector to avoid desallocation of the view.
375  {
376  // The view of the internal data of 'mv' is only valid until the destruction of 'mv'.
377  // The new vector hold an internal reference to 'mv' in order to keep the view valid after disappearance of 'mv' references in user code.
378  // This implements the logic of subArray rcp (as required by the Tpetra interface).
379  }
380 
381 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
383 
384  typename dual_view_type::t_host_um getHostLocalView () const {
386  }
387 
388  typename dual_view_type::t_dev_um getDeviceLocalView() const {
389  throw std::runtime_error("Epetra does not support device views!");
390  typename dual_view_type::t_dev ret;
391  return ret; // make compiler happy
392  }
393 
404  template<class TargetDeviceType>
405  typename Kokkos::Impl::if_c<
406  Kokkos::Impl::is_same<
407  typename dual_view_type::t_dev_um::execution_space::memory_space,
408  typename TargetDeviceType::memory_space>::value,
409  typename dual_view_type::t_dev_um,
410  typename dual_view_type::t_host_um>::type
411  getLocalView () const {
412  return this->MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
413  }
414 #endif
415 
417 
418 private:
419 
420  // 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)
422 };
423 #endif
424 
425 // specialization on GO=long long and Node=Serial
426 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
427 template<>
428 class EpetraVectorT<long long, EpetraNode>
429 : public virtual Vector<double,int,long long,EpetraNode>, public EpetraMultiVectorT<long long,EpetraNode>
430 {
431  typedef double Scalar;
432  typedef int LocalOrdinal;
433  typedef long long GlobalOrdinal;
434  typedef EpetraNode Node;
435 
436 public:
437 
438  using EpetraMultiVectorT<GlobalOrdinal, Node>::dot; // overloading, not hiding
439  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm1; // overloading, not hiding
440  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm2; // overloading, not hiding
441  using EpetraMultiVectorT<GlobalOrdinal, Node>::normInf; // overloading, not hiding
442  using EpetraMultiVectorT<GlobalOrdinal, Node>::meanValue; // overloading, not hiding
443  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceGlobalValue; // overloading, not hiding
444  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoGlobalValue; // overloading, not hiding
445  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceLocalValue; // overloading, not hiding
446  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoLocalValue; // overloading, not hiding
447 
449 
450 
452  explicit EpetraVectorT(const Teuchos::RCP<const Map<int,GlobalOrdinal,Node> > &map, bool zeroOut=true) : EpetraMultiVectorT<GlobalOrdinal, Node>(map,1,zeroOut) { }
453 
454  // Commenting out since no definition provided in cpp.
456  // EpetraVectorT(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
457 
459  virtual ~EpetraVectorT() { }
460 
462 
464 
465 
467  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::replaceGlobalValue"); this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->ReplaceGlobalValue(globalRow, 0, value); }
468 
470  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::sumIntoGlobalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->SumIntoGlobalValue(globalRow, 0, value); }
471 
473  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::replaceLocalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->ReplaceMyValue(myRow, 0, value); }
474 
476  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::sumIntoLocalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->SumIntoMyValue(myRow, 0, value); }
477 
479 
481 
482 
485  XPETRA_MONITOR("EpetraVectorT::dot");
486 
487  XPETRA_DYNAMIC_CAST(const EpetraVectorT, a, tA, "This Xpetra::EpetraVectorT method only accept Xpetra::EpetraVectorT as input arguments.");
488  // return getEpetra_Vector()->Dot(*tA.getEpetra_Vector());
489 
490  // other way: use the MultiVector Dot instead of VectorDot:
491  double r;
492  this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->Epetra_MultiVector::Dot(*tA.getEpetra_MultiVector(), &r);
493  return r;
494  }
495 
498 
501 
504 
506  //Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
507 
509  Scalar meanValue() const {
510  XPETRA_MONITOR("EpetraVectorT::meanValue");
511  Scalar r;
513  return r;
514  }
515 
517 
519 
520 
522  std::string description() const {
523  XPETRA_MONITOR("EpetraVectorT::description");
524  // This implementation come from Epetra_Vector_def.hpp (without modification)
525  std::ostringstream oss;
527  oss << "{length="<<this->getGlobalLength()
528  << "}";
529  return oss.str();
530  }
531 
534  XPETRA_MONITOR("EpetraVectorT::describe");
535 
536  if (verbLevel > Teuchos::VERB_NONE) {
537  getEpetra_Vector()->Print (out);
538  }
539  }
541 
543 
544 
546  EpetraVectorT(const Teuchos::RCP<Epetra_Vector> &vec) : EpetraMultiVectorT<GlobalOrdinal, Node>(vec) { } // TODO: removed const of Epetra::Vector
547 
550  //RCP<Epetra_Vector> getEpetra_Vector() const { return this->EpetraMultiVectorT<GlobalOrdinal>::getEpetra_MultiVector()->getVectorNonConst(0); }
551 
556  : EpetraMultiVectorT<GlobalOrdinal,Node>(rcp((*mv)(j), false)), // view of the vector number j. false == I do not own the data.
557  internalRefToBaseMV_(mv) // keep an internal reference to the initial MultiVector to avoid desallocation of the view.
558  {
559  // The view of the internal data of 'mv' is only valid until the destruction of 'mv'.
560  // The new vector hold an internal reference to 'mv' in order to keep the view valid after disappearance of 'mv' references in user code.
561  // This implements the logic of subArray rcp (as required by the Tpetra interface).
562  }
563 
564 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
566 
567  typename dual_view_type::t_host_um getHostLocalView () const {
569  }
570 
571  typename dual_view_type::t_dev_um getDeviceLocalView() const {
572  throw std::runtime_error("Epetra does not support device views!");
573  typename dual_view_type::t_dev ret;
574  return ret; // make compiler happy
575  }
576 
587  template<class TargetDeviceType>
588  typename Kokkos::Impl::if_c<
589  Kokkos::Impl::is_same<
590  typename dual_view_type::t_dev_um::execution_space::memory_space,
591  typename TargetDeviceType::memory_space>::value,
592  typename dual_view_type::t_dev_um,
593  typename dual_view_type::t_host_um>::type
594  getLocalView () const {
595  return this->MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
596  }
597 #endif
598 
600 
601 private:
602 
603  // 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)
605 };
606 #endif
607 
608 } // Xpetra namespace
609 
610 #endif // XPETRA_EPETRAVECTOR_HPP
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.
EpetraVectorT(const Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
Scalar dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
Computes dot product of this Vector against input Vector x.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
Scalar meanValue() const
Compute Weighted 2-norm (RMS 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.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
Xpetra namespace
void sumIntoLocalValue(LocalOrdinal myRow, 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.
Exception throws to report errors in the internal logical of the program.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
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.
EpetraGlobalOrdinal GlobalOrdinal
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
const RCP< const Epetra_MultiVector > internalRefToBaseMV_
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
virtual ~EpetraVectorT()
Vector copy constructor.
Epetra_Vector * getEpetra_Vector() const
Get the underlying Epetra vector.
virtual ~EpetraVectorT()
Vector copy constructor.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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...
virtual ~EpetraVectorT()
Vector copy constructor.
EpetraVectorT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
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.
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 normInf() const
Compute Inf-norm of this Vector.
virtual std::string description() const
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
EpetraVectorT(const Teuchos::RCP< Epetra_Vector > &vec)
EpetraMultiVectorT constructor to wrap a Epetra_Vector object.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
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)
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
static const EVerbosityLevel verbLevel_default
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.
static magnitudeType magnitude(T a)
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.
EpetraVectorT(const Teuchos::RCP< Epetra_Vector > &vec)
EpetraMultiVectorT constructor to wrap a Epetra_Vector object.
const RCP< const Epetra_MultiVector > internalRefToBaseMV_
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
EpetraVectorT(const Teuchos::RCP< Epetra_Vector > &vec)
EpetraMultiVectorT constructor to wrap a Epetra_Vector object.
void sumIntoLocalValue(LocalOrdinal myRow, 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.
const RCP< const Epetra_MultiVector > internalRefToBaseMV_
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
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)
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
Scalar meanValue() const
Compute Weighted 2-norm (RMS Norm) of this Vector.