Xpetra_TpetraVector.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_TPETRAVECTOR_HPP
47 #define XPETRA_TPETRAVECTOR_HPP
48 
49 /* this file is automatically generated - do not edit (see script/tpetra.py) */
50 
52 
53 #include "Xpetra_Vector.hpp"
54 #include "Xpetra_MultiVector.hpp"
56 
57 #include "Xpetra_TpetraMap.hpp" //TMP
58 #include "Xpetra_Utils.hpp"
59 #include "Xpetra_TpetraImport.hpp"
60 #include "Xpetra_TpetraExport.hpp"
61 
62 #include "Tpetra_Vector.hpp"
63 
64 namespace Xpetra {
65 
66  // TODO: move that elsewhere
67  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
68  RCP<Tpetra::Vector<Scalar,LocalOrdinal, GlobalOrdinal, Node> > toTpetra(Vector<Scalar,LocalOrdinal, GlobalOrdinal, Node> &);
69 
70  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
71  RCP<Tpetra::Vector<Scalar,LocalOrdinal, GlobalOrdinal, Node> > toTpetra(const Vector<Scalar,LocalOrdinal, GlobalOrdinal, Node> &);
72 
73  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
74  RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node > > toXpetra(RCP<const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > vec);
75 
76  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
77  RCP<Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node > > toXpetra(RCP<Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > vec);
78 
79  //
80  //
81 
82  template <class Scalar = Vector<>::scalar_type,
83  class LocalOrdinal = typename Vector<Scalar>::local_ordinal_type,
84  class GlobalOrdinal = typename Vector<Scalar, LocalOrdinal>::global_ordinal_type,
86  class TpetraVector
87  : public virtual Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node>,
88  public TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>
89  {
90 #undef XPETRA_TPETRAMULTIVECTOR_SHORT
91 #include "Xpetra_UseShortNames.hpp"
92 
93  public:
94 
104 
106 
107 
109  TpetraVector(const Teuchos::RCP<const Map> &map, bool zeroOut=true)
110  : TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> (map,1,zeroOut) { }
111 
113  TpetraVector(const Teuchos::RCP<const Map> &map, const Teuchos::ArrayView< const Scalar > &A)
114  : TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> (map,A,map->getNodeNumElements(),1) { }
115 
117  virtual ~TpetraVector() { }
118 
120 
122 
123 
125  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("TpetraVector::replaceGlobalValue"); getTpetra_Vector()->replaceGlobalValue(globalRow, value); }
126 
128  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("TpetraVector::sumIntoGlobalValue"); getTpetra_Vector()->sumIntoGlobalValue(globalRow, value); }
129 
131  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("TpetraVector::replaceLocalValue"); getTpetra_Vector()->replaceLocalValue(myRow, value); }
132 
134  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("TpetraVector::sumIntoLocalValue"); getTpetra_Vector()->sumIntoLocalValue(myRow, value); }
135 
137 
139 
140 
142  typename Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const { XPETRA_MONITOR("TpetraVector::norm1"); return getTpetra_Vector()->norm1(); }
143 
145  typename Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const { XPETRA_MONITOR("TpetraVector::norm2"); return getTpetra_Vector()->norm2(); }
146 
148  typename Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const { XPETRA_MONITOR("TpetraVector::normInf"); return getTpetra_Vector()->normInf(); }
149 
151  Scalar meanValue() const { XPETRA_MONITOR("TpetraVector::meanValue"); return getTpetra_Vector()->meanValue(); }
152 
154 
156 
157 
159  std::string description() const { XPETRA_MONITOR("TpetraVector::description"); return getTpetra_Vector()->description(); }
160 
162  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const { XPETRA_MONITOR("TpetraVector::describe"); getTpetra_Vector()->describe(out, verbLevel); }
163 
165 
167  Scalar dot(const Vector &a) const { XPETRA_MONITOR("TpetraVector::dot"); return getTpetra_Vector()->dot(*toTpetra(a)); }
168 
170  typename Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector &weights) const { XPETRA_MONITOR("TpetraVector::normWeighted"); return getTpetra_Vector()->normWeighted(*toTpetra(weights)); }
171 
172 
174 
175 
177  TpetraVector(const Teuchos::RCP<Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &vec) : TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> (vec) { }
178 
180  RCP<Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > getTpetra_Vector() const { return this->TpetraMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getTpetra_MultiVector()->getVectorNonConst(0); }
181 
182 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
183 
185 
186  typename dual_view_type::t_host_um getHostLocalView () const {
188  }
189 
190  typename dual_view_type::t_dev_um getDeviceLocalView() const {
191  return this->TpetraMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getDeviceLocalView();
192  }
193 
204  template<class TargetDeviceType>
205  typename Kokkos::Impl::if_c<
206  Kokkos::Impl::is_same<
207  typename dual_view_type::t_dev_um::execution_space::memory_space,
208  typename TargetDeviceType::memory_space>::value,
209  typename dual_view_type::t_dev_um,
210  typename dual_view_type::t_host_um>::type
211  getLocalView () const {
212  return this->TpetraMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
213  }
214 #endif
215 
217 
218  }; // TpetraVector class
219 
220 #ifdef HAVE_XPETRA_EPETRA
221 
222 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
223  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
224 
225  // specialization of TpetraVector for GO=int and NO=SerialNode
226  template <class Scalar>
227  class TpetraVector<Scalar, int, int, EpetraNode>
228  : public virtual Vector<Scalar,int,int,EpetraNode>,
229  public TpetraMultiVector<Scalar,int,int,EpetraNode>
230  {
231  typedef int LocalOrdinal;
232  typedef int GlobalOrdinal;
233  typedef EpetraNode Node;
234 
235 #undef XPETRA_TPETRAMULTIVECTOR_SHORT
236 #include "Xpetra_UseShortNames.hpp"
237 
238  public:
239 
249 
251 
252 
254  TpetraVector(const Teuchos::RCP<const Map> &map, bool zeroOut=true)
255  : TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> (map,1,zeroOut) {
257  }
258 
260  TpetraVector(const Teuchos::RCP<const Map> &map, const Teuchos::ArrayView< const Scalar > &A)
261  : TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> (map,A,map->getNodeNumElements(),1) {
263  }
264 
266  virtual ~TpetraVector() { }
267 
269 
271 
272 
274  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { }
275 
277  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { }
278 
280  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { }
281 
283  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { }
284 
286 
288 
289 
291  typename Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const { return Teuchos::ScalarTraits< Scalar >::magnitude(Teuchos::ScalarTraits< Scalar >::zero()); }
292 
294  typename Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const { return Teuchos::ScalarTraits< Scalar >::magnitude(Teuchos::ScalarTraits< Scalar >::zero()); }
295 
297  typename Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const { return Teuchos::ScalarTraits< Scalar >::magnitude(Teuchos::ScalarTraits< Scalar >::zero()); }
298 
300  Scalar meanValue() const { return Teuchos::ScalarTraits< Scalar >::zero(); }
301 
303 
305 
306 
308  std::string description() const { return std::string(""); }
309 
311  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const { }
312 
314 
316  Scalar dot(const Vector &a) const { return Teuchos::ScalarTraits< Scalar >::zero(); }
317 
319  typename Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector &weights) const { return Teuchos::ScalarTraits< Scalar >::magnitude(Teuchos::ScalarTraits< Scalar >::zero()); }
320 
321 
323 
324 
326  TpetraVector(const Teuchos::RCP<Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &vec) {
328  }
329 
331  RCP<Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > getTpetra_Vector() const { return Teuchos::null; }
332 
333 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
334 
336 
337  typename dual_view_type::t_host_um getHostLocalView () const {
338  typename dual_view_type::t_host_um ret;
339  return ret;
340  }
341 
342  typename dual_view_type::t_dev_um getDeviceLocalView() const {
343  typename dual_view_type::t_dev_um ret;
344  return ret;
345  }
346 
357  template<class TargetDeviceType>
358  typename Kokkos::Impl::if_c<
359  Kokkos::Impl::is_same<
360  typename dual_view_type::t_dev_um::execution_space::memory_space,
361  typename TargetDeviceType::memory_space>::value,
362  typename dual_view_type::t_dev_um,
363  typename dual_view_type::t_host_um>::type
364  getLocalView () const {
365  typename Kokkos::Impl::if_c<
366  Kokkos::Impl::is_same<
367  typename dual_view_type::t_dev_um::execution_space::memory_space,
368  typename TargetDeviceType::memory_space>::value,
369  typename dual_view_type::t_dev_um,
370  typename dual_view_type::t_host_um>::type ret;
371  return ret;
372  }
373 #endif
374 
376 
377  }; // TpetraVector class (specialization on GO=int, NO=EpetraNode)
378 #endif
379 
380 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
381  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
382 
383  // specialization of TpetraVector for GO=int and NO=SerialNode
384  template <class Scalar>
385  class TpetraVector<Scalar, int, long long, EpetraNode>
386  : public virtual Vector<Scalar,int,long long,EpetraNode>,
387  public TpetraMultiVector<Scalar,int,long long,EpetraNode>
388  {
389  typedef int LocalOrdinal;
390  typedef long long GlobalOrdinal;
391  typedef EpetraNode Node;
392 
393 #undef XPETRA_TPETRAMULTIVECTOR_SHORT
394 #include "Xpetra_UseShortNames.hpp"
395 
396  public:
397 
407 
409 
410 
412  TpetraVector(const Teuchos::RCP<const Map> &map, bool zeroOut=true)
413  : TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> (map,1,zeroOut) {
415  }
416 
418  TpetraVector(const Teuchos::RCP<const Map> &map, const Teuchos::ArrayView< const Scalar > &A)
419  : TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> (map,A,map->getNodeNumElements(),1) {
421  }
422 
424  virtual ~TpetraVector() { }
425 
427 
429 
430 
432  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { }
433 
435  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { }
436 
438  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { }
439 
441  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { }
442 
444 
446 
447 
449  typename Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const { return Teuchos::ScalarTraits< Scalar >::magnitude(Teuchos::ScalarTraits< Scalar >::zero()); }
450 
452  typename Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const { return Teuchos::ScalarTraits< Scalar >::magnitude(Teuchos::ScalarTraits< Scalar >::zero()); }
453 
455  typename Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const { return Teuchos::ScalarTraits< Scalar >::magnitude(Teuchos::ScalarTraits< Scalar >::zero()); }
456 
458  Scalar meanValue() const { return Teuchos::ScalarTraits< Scalar >::zero(); }
459 
461 
463 
464 
466  std::string description() const { return std::string(""); }
467 
469  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const { }
470 
472 
474  Scalar dot(const Vector &a) const { return Teuchos::ScalarTraits< Scalar >::zero(); }
475 
477  typename Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector &weights) const { return Teuchos::ScalarTraits< Scalar >::magnitude(Teuchos::ScalarTraits< Scalar >::zero()); }
478 
479 
481 
482 
484  TpetraVector(const Teuchos::RCP<Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > &vec) {
486  }
487 
489  RCP<Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > getTpetra_Vector() const { return Teuchos::null; }
490 
491 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
492 
494 
495  typename dual_view_type::t_host_um getHostLocalView () const {
496  typename dual_view_type::t_host_um ret;
497  return ret;
498  }
499 
500  typename dual_view_type::t_dev_um getDeviceLocalView() const {
501  typename dual_view_type::t_dev_um ret;
502  return ret;
503  }
504 
515  template<class TargetDeviceType>
516  typename Kokkos::Impl::if_c<
517  Kokkos::Impl::is_same<
518  typename dual_view_type::t_dev_um::execution_space::memory_space,
519  typename TargetDeviceType::memory_space>::value,
520  typename dual_view_type::t_dev_um,
521  typename dual_view_type::t_host_um>::type
522  getLocalView () const {
523  typename Kokkos::Impl::if_c<
524  Kokkos::Impl::is_same<
525  typename dual_view_type::t_dev_um::execution_space::memory_space,
526  typename TargetDeviceType::memory_space>::value,
527  typename dual_view_type::t_dev_um,
528  typename dual_view_type::t_host_um>::type ret;
529  return ret;
530  }
531 #endif
532 
533 
534  }; // TpetraVector class (specialization on GO=long long, NO=EpetraNode)
535 #endif
536 
537 #endif // HAVE_XPETRA_EPETRA
538 
539  // TODO: move that elsewhere
540  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
541  RCP<Tpetra::Vector< Scalar,LocalOrdinal, GlobalOrdinal, Node> > toTpetra(Vector< Scalar,LocalOrdinal, GlobalOrdinal, Node> &x) {
543  XPETRA_DYNAMIC_CAST( TpetraVectorClass, x, tX, "toTpetra");
544  return tX.getTpetra_Vector();
545  }
546 
547  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
548  RCP<Tpetra::Vector< Scalar,LocalOrdinal, GlobalOrdinal, Node> > toTpetra(const Vector< Scalar,LocalOrdinal, GlobalOrdinal, Node> &x) {
550  XPETRA_DYNAMIC_CAST(const TpetraVectorClass, x, tX, "toTpetra");
551  return tX.getTpetra_Vector();
552  }
553 
554  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
555  RCP<Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node > > toXpetra(RCP<Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > vec) {
556  if (!vec.is_null())
558 
559  return Teuchos::null;
560  }
561 
562  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
563  RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node > > toXpetra(RCP<const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > vec) {
564  // We cast away the const to wrap the Tpetra vector into an Xpetra object. But it's OK because the Xpetra vector is returned as const.
565  return toXpetra(Teuchos::rcp_const_cast<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node > > (vec));
566  }
567 
568  //
569 
570 } // Xpetra namespace
571 
572 #define XPETRA_TPETRAVECTOR_SHORT
573 #endif // XPETRA_TPETRAVECTOR_HPP
RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Vector() const
Get the underlying Tpetra multivector.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-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 mean (average) value of this Vector.
RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Vector() const
Get the underlying Tpetra multivector.
Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector &weights) const
Compute Weighted 2-norm (RMS Norm) of this Vector.
TpetraVector(const Teuchos::RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &vec)
TpetraMultiVector constructor to wrap a Tpetra::MultiVector object.
TpetraVector(const Teuchos::RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &vec)
TpetraMultiVector constructor to wrap a Tpetra::MultiVector object.
LocalOrdinal local_ordinal_type
void sumIntoGlobalValue(GlobalOrdinal globalRow, 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.
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 norm2() const
Compute 2-norm of this Vector.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
Xpetra namespace
std::string description() const
Return a simple one-line description of this object.
Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector &weights) const
Compute Weighted 2-norm (RMS Norm) of this Vector.
GlobalOrdinal global_ordinal_type
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void dot(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Teuchos::ArrayView< Scalar > &dots) const
Compute dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i]).
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.
TpetraVector(const Teuchos::RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &vec)
TpetraMultiVector constructor to wrap a Tpetra::MultiVector object.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Scalar meanValue() const
Compute mean (average) value of this Vector.
TpetraVector(const Teuchos::RCP< const Map > &map, const Teuchos::ArrayView< const Scalar > &A)
Set multi-vector values from an array using Teuchos memory management classes. (copy) ...
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void norm2(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
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.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
void normInf(const Teuchos::ArrayView< typename 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 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...
virtual ~TpetraVector()
Destructor.
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.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
void norm1(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
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.
RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Vector() const
Get the underlying Tpetra multivector.
std::string description() const
Return a simple one-line description of this object.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Scalar dot(const Vector &a) const
Computes dot product of this Vector against input Vector x.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
Scalar meanValue() const
Compute mean (average) value of this Vector.
TpetraVector(const Teuchos::RCP< const Map > &map, const Teuchos::ArrayView< const Scalar > &A)
Set multi-vector values from an array using Teuchos memory management classes. (copy) ...
#define XPETRA_MONITOR(funcName)
Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector &weights) const
Compute Weighted 2-norm (RMS Norm) of this Vector.
TpetraVector(const Teuchos::RCP< const Map > &map, const Teuchos::ArrayView< const Scalar > &A)
Set multi-vector values from an array using Teuchos memory management classes. (copy) ...
RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_MultiVector() const
Get the underlying Tpetra multivector.
TpetraVector(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
Sets all vector entries to zero.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
Scalar dot(const Vector &a) const
Computes dot product of this Vector against input Vector x.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
TpetraVector(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
Sets all vector entries to zero.
Scalar dot(const Vector &a) const
Computes dot product of this Vector against input Vector x.
TpetraVector(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
Sets all vector entries to zero.