Xpetra  Version of the Day
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>
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 
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 
194 
195 
197 
198 private:
199 
200  // 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)
201  // TODO remove this...
203 
204 }; // EpetraVectorT class
205 
206 // specialization on GO=int and Node=Serial
207 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
208 template<>
210 : public virtual Vector<double,int,int,EpetraNode>, public EpetraMultiVectorT<int,EpetraNode>
211 {
212  typedef double Scalar;
213  typedef int LocalOrdinal;
214  typedef int GlobalOrdinal;
215  typedef EpetraNode Node;
216 
217 public:
218 
219  using EpetraMultiVectorT<GlobalOrdinal, Node>::dot; // overloading, not hiding
220  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm1; // overloading, not hiding
221  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm2; // overloading, not hiding
222  using EpetraMultiVectorT<GlobalOrdinal, Node>::normInf; // overloading, not hiding
223  using EpetraMultiVectorT<GlobalOrdinal, Node>::meanValue; // overloading, not hiding
224  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceGlobalValue; // overloading, not hiding
225  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoGlobalValue; // overloading, not hiding
226  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceLocalValue; // overloading, not hiding
227  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoLocalValue; // overloading, not hiding
228 
229 
230 
232 
233 
235  explicit EpetraVectorT(const Teuchos::RCP<const Map<int,GlobalOrdinal,Node> > &map, bool zeroOut=true) : EpetraMultiVectorT<GlobalOrdinal, Node>(map,1,zeroOut) { }
236 
237  // Commenting out since no definition provided in cpp.
239  // EpetraVectorT(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
240 
242  virtual ~EpetraVectorT() { }
243 
245 
247 
248 
250  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::replaceGlobalValue"); this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->ReplaceGlobalValue(globalRow, 0, value); }
251 
253  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::sumIntoGlobalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->SumIntoGlobalValue(globalRow, 0, value); }
254 
256  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::replaceLocalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->ReplaceMyValue(myRow, 0, value); }
257 
259  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::sumIntoLocalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->SumIntoMyValue(myRow, 0, value); }
260 
262 
264 
265 
268  XPETRA_MONITOR("EpetraVectorT::dot");
269 
270  XPETRA_DYNAMIC_CAST(const EpetraVectorT, a, tA, "This Xpetra::EpetraVectorT method only accept Xpetra::EpetraVectorT as input arguments.");
271  // return getEpetra_Vector()->Dot(*tA.getEpetra_Vector());
272 
273  // other way: use the MultiVector Dot instead of VectorDot:
274  double r;
275  this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->Epetra_MultiVector::Dot(*tA.getEpetra_MultiVector(), &r);
276  return r;
277  }
278 
281 
284 
287 
289  //Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
290 
292  Scalar meanValue() const {
293  XPETRA_MONITOR("EpetraVectorT::meanValue");
294  Scalar r;
296  return r;
297  }
298 
300 
302 
303 
305  std::string description() const {
306  XPETRA_MONITOR("EpetraVectorT::description");
307  // This implementation come from Epetra_Vector_def.hpp (without modification)
308  std::ostringstream oss;
310  oss << "{length="<<this->getGlobalLength()
311  << "}";
312  return oss.str();
313  }
314 
317  XPETRA_MONITOR("EpetraVectorT::describe");
318 
319  if (verbLevel > Teuchos::VERB_NONE) {
320  getEpetra_Vector()->Print (out);
321  }
322  }
324 
326 
327 
329  EpetraVectorT(const Teuchos::RCP<Epetra_Vector> &vec) : EpetraMultiVectorT<GlobalOrdinal, Node>(vec) { } // TODO: removed const of Epetra::Vector
330 
333  //RCP<Epetra_Vector> getEpetra_Vector() const { return this->EpetraMultiVectorT<GlobalOrdinal>::getEpetra_MultiVector()->getVectorNonConst(0); }
334 
339  : EpetraMultiVectorT<GlobalOrdinal,Node>(rcp((*mv)(j), false)), // view of the vector number j. false == I do not own the data.
340  internalRefToBaseMV_(mv) // keep an internal reference to the initial MultiVector to avoid desallocation of the view.
341  {
342  // The view of the internal data of 'mv' is only valid until the destruction of 'mv'.
343  // The new vector hold an internal reference to 'mv' in order to keep the view valid after disappearance of 'mv' references in user code.
344  // This implements the logic of subArray rcp (as required by the Tpetra interface).
345  }
346 
348 
349 private:
350 
351  // 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)
353 };
354 #endif
355 
356 // specialization on GO=long long and Node=Serial
357 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
358 template<>
359 class EpetraVectorT<long long, EpetraNode>
360 : public virtual Vector<double,int,long long,EpetraNode>, public EpetraMultiVectorT<long long,EpetraNode>
361 {
362  typedef double Scalar;
363  typedef int LocalOrdinal;
364  typedef long long GlobalOrdinal;
365  typedef EpetraNode Node;
366 
367 public:
368 
369  using EpetraMultiVectorT<GlobalOrdinal, Node>::dot; // overloading, not hiding
370  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm1; // overloading, not hiding
371  using EpetraMultiVectorT<GlobalOrdinal, Node>::norm2; // overloading, not hiding
372  using EpetraMultiVectorT<GlobalOrdinal, Node>::normInf; // overloading, not hiding
373  using EpetraMultiVectorT<GlobalOrdinal, Node>::meanValue; // overloading, not hiding
374  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceGlobalValue; // overloading, not hiding
375  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoGlobalValue; // overloading, not hiding
376  using EpetraMultiVectorT<GlobalOrdinal, Node>::replaceLocalValue; // overloading, not hiding
377  using EpetraMultiVectorT<GlobalOrdinal, Node>::sumIntoLocalValue; // overloading, not hiding
378 
380 
381 
383  explicit EpetraVectorT(const Teuchos::RCP<const Map<int,GlobalOrdinal,Node> > &map, bool zeroOut=true) : EpetraMultiVectorT<GlobalOrdinal, Node>(map,1,zeroOut) { }
384 
385  // Commenting out since no definition provided in cpp.
387  // EpetraVectorT(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source);
388 
390  virtual ~EpetraVectorT() { }
391 
393 
395 
396 
398  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::replaceGlobalValue"); this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->ReplaceGlobalValue(globalRow, 0, value); }
399 
401  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::sumIntoGlobalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->SumIntoGlobalValue(globalRow, 0, value); }
402 
404  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::replaceLocalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->ReplaceMyValue(myRow, 0, value); }
405 
407  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraVectorT::sumIntoLocalValue");this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->SumIntoMyValue(myRow, 0, value); }
408 
410 
412 
413 
416  XPETRA_MONITOR("EpetraVectorT::dot");
417 
418  XPETRA_DYNAMIC_CAST(const EpetraVectorT, a, tA, "This Xpetra::EpetraVectorT method only accept Xpetra::EpetraVectorT as input arguments.");
419  // return getEpetra_Vector()->Dot(*tA.getEpetra_Vector());
420 
421  // other way: use the MultiVector Dot instead of VectorDot:
422  double r;
423  this->EpetraMultiVectorT<GlobalOrdinal,Node>::getEpetra_MultiVector()->Epetra_MultiVector::Dot(*tA.getEpetra_MultiVector(), &r);
424  return r;
425  }
426 
429 
432 
435 
437  //Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights) const;
438 
440  Scalar meanValue() const {
441  XPETRA_MONITOR("EpetraVectorT::meanValue");
442  Scalar r;
444  return r;
445  }
446 
448 
450 
451 
453  std::string description() const {
454  XPETRA_MONITOR("EpetraVectorT::description");
455  // This implementation come from Epetra_Vector_def.hpp (without modification)
456  std::ostringstream oss;
458  oss << "{length="<<this->getGlobalLength()
459  << "}";
460  return oss.str();
461  }
462 
465  XPETRA_MONITOR("EpetraVectorT::describe");
466 
467  if (verbLevel > Teuchos::VERB_NONE) {
468  getEpetra_Vector()->Print (out);
469  }
470  }
472 
474 
475 
477  EpetraVectorT(const Teuchos::RCP<Epetra_Vector> &vec) : EpetraMultiVectorT<GlobalOrdinal, Node>(vec) { } // TODO: removed const of Epetra::Vector
478 
481  //RCP<Epetra_Vector> getEpetra_Vector() const { return this->EpetraMultiVectorT<GlobalOrdinal>::getEpetra_MultiVector()->getVectorNonConst(0); }
482 
487  : EpetraMultiVectorT<GlobalOrdinal,Node>(rcp((*mv)(j), false)), // view of the vector number j. false == I do not own the data.
488  internalRefToBaseMV_(mv) // keep an internal reference to the initial MultiVector to avoid desallocation of the view.
489  {
490  // The view of the internal data of 'mv' is only valid until the destruction of 'mv'.
491  // The new vector hold an internal reference to 'mv' in order to keep the view valid after disappearance of 'mv' references in user code.
492  // This implements the logic of subArray rcp (as required by the Tpetra interface).
493  }
494 
496 
497 private:
498 
499  // 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)
501 };
502 #endif
503 
504 } // Xpetra namespace
505 
506 #endif // XPETRA_EPETRAVECTOR_HPP
#define XPETRA_MONITOR(funcName)
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
virtual void Print(std::ostream &os) const
static const EVerbosityLevel verbLevel_default
virtual std::string description() const
RCP< Epetra_MultiVector > getEpetra_MultiVector() const
Get the underlying Epetra multivector.
global_size_t getGlobalLength() const
Global number of rows in the multivector.
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.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
std::string description() const
Return a simple one-line description of this object.
Scalar meanValue() const
Compute Weighted 2-norm (RMS Norm) of this Vector.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
Scalar dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
Computes dot product of this Vector against input Vector x.
Epetra_Vector * getEpetra_Vector() const
Get the underlying Epetra 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.
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.
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< const Map< int, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
EpetraVectorT(const RCP< Epetra_MultiVector > &mv, size_t j)
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
EpetraVectorT(const RCP< Epetra_MultiVector > &mv, size_t j)
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.
const RCP< const Epetra_MultiVector > internalRefToBaseMV_
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.
std::string description() const
Return a simple one-line description of this 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.
Scalar meanValue() const
Compute Weighted 2-norm (RMS Norm) of this Vector.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
virtual ~EpetraVectorT()
Vector copy constructor.
EpetraVectorT(const Teuchos::RCP< Epetra_Vector > &vec)
EpetraMultiVectorT constructor to wrap a Epetra_Vector object.
Scalar dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
Computes dot product of this Vector against input Vector x.
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
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.
Scalar dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
Computes dot product of this Vector against input Vector x.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
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...
EpetraGlobalOrdinal GlobalOrdinal
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
EpetraVectorT(const Teuchos::RCP< Epetra_Vector > &vec)
EpetraMultiVectorT constructor to wrap a Epetra_Vector object.
Epetra_Vector * getEpetra_Vector() const
Get the underlying Epetra vector.
Scalar meanValue() const
Compute Weighted 2-norm (RMS Norm) of this Vector.
void sumIntoLocalValue(LocalOrdinal myRow, 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.
EpetraVectorT(const RCP< Epetra_MultiVector > &mv, size_t j)
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
std::string description() const
Return a simple one-line description of this object.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
const RCP< const Epetra_MultiVector > internalRefToBaseMV_
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
EpetraVectorT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
virtual ~EpetraVectorT()
Vector copy constructor.
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.
Exception throws to report errors in the internal logical of the program.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Xpetra namespace
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
static magnitudeType magnitude(T a)