All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Xpetra_TpetraVector_def.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_DEF_HPP
47 #define XPETRA_TPETRAVECTOR_DEF_HPP
49 
50 
51 namespace Xpetra {
52 
53 
54 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
57  bool zeroOut)
58  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, 1, zeroOut)
59 {
60 }
61 
62 
63 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
67  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, A, map->getNodeNumElements(), 1)
68 {
69 }
70 
71 
72 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
75 {
76 }
77 
78 
79 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
80 void
82 replaceGlobalValue(GlobalOrdinal globalRow, const Scalar& value)
83 {
84  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::replaceGlobalValue");
85  getTpetra_Vector()->replaceGlobalValue(globalRow, value);
86 }
87 
88 
89 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
90 void
92 sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar& value)
93 {
94  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::sumIntoGlobalValue");
95  getTpetra_Vector()->sumIntoGlobalValue(globalRow, value);
96 }
97 
98 
99 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
100 void
102 replaceLocalValue(LocalOrdinal myRow, const Scalar& value)
103 {
104  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::replaceLocalValue");
105  getTpetra_Vector()->replaceLocalValue(myRow, value);
106 }
107 
108 
109 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
110 void
112 sumIntoLocalValue(LocalOrdinal myRow, const Scalar& value)
113 {
114  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::sumIntoLocalValue");
115  getTpetra_Vector()->sumIntoLocalValue(myRow, value);
116 }
117 
118 
119 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
122 norm1() const
123 {
124  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm1");
125  return getTpetra_Vector()->norm1();
126 }
127 
128 
129 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
132 norm2() const
133 {
134  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm2");
135  return getTpetra_Vector()->norm2();
136 }
137 
138 
139 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
142 normInf() const
143 {
144  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::normInf");
145  return getTpetra_Vector()->normInf();
146 }
147 
148 
149 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
150 Scalar
152 meanValue() const
153 {
154  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::meanValue");
155  return getTpetra_Vector()->meanValue();
156 }
157 
158 
159 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
160 std::string
162 description() const
163 {
164  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::description");
165  return getTpetra_Vector()->description();
166 }
167 
168 
169 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
170 void
173 {
174  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::describe");
175  getTpetra_Vector()->describe(out, verbLevel);
176 }
177 
178 
179 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
180 Scalar
183 {
184  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::dot");
185  return getTpetra_Vector()->dot(*toTpetra(a));
186 }
187 
188 
189 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
190 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
191 TPETRA_DEPRECATED typename Teuchos::ScalarTraits<Scalar>::magnitudeType
194 {
195  XPETRA_MONITOR("TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::normWeighted");
196  return getTpetra_Vector()->normWeighted(*toTpetra(weights));
197 }
198 #endif
199 
200 
201 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
203 TpetraVector(const Teuchos::RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>& vec)
204  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(vec)
205 {
206 }
207 
208 
209 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
213 {
215 }
216 
217 
218 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
219 
220 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
223 getHostLocalView() const
224 {
226 }
227 
228 
229 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
231 TpetraVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
232 getDeviceLocalView() const
233 {
234  return this->TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getDeviceLocalView();
235 }
236 
237 
238 #if 0
239  template<class TargetDeviceType>
240  typename Kokkos::Impl::if_c<
241  Kokkos::Impl::is_same<
242  typename dual_view_type::t_dev_um::execution_space::memory_space,
243  typename TargetDeviceType::memory_space>::value,
244  typename dual_view_type::t_dev_um,
245  typename dual_view_type::t_host_um>::type
246 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
247  TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::getLocalView () const {
248  return this->TpetraMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
249  }
250 #endif // #if 0
251 
252 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
253 
254 
255 
256 #ifdef HAVE_XPETRA_EPETRA
257 
258 
259 
260 #if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) \
261  || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
262 
263 // specialization of TpetraVector for GO=int and NO=SerialNode
264 template<class Scalar>
265 class TpetraVector<Scalar, int, int, EpetraNode>
266  : public virtual Vector<Scalar, int, int, EpetraNode>
267  , public TpetraMultiVector<Scalar, int, int, EpetraNode>
268 {
269  typedef int LocalOrdinal;
270  typedef int GlobalOrdinal;
271  typedef EpetraNode Node;
272 
273 #undef XPETRA_TPETRAMULTIVECTOR_SHORT
274 #undef XPETRA_TPETRAVECTOR_SHORT
275 #include "Xpetra_UseShortNames.hpp"
276 #define XPETRA_TPETRAMULTIVECTOR_SHORT
277 #define XPETRA_TPETRAVECTOR_SHORT
278 
279  public:
280 
290 
292 
293 
295  TpetraVector(const Teuchos::RCP<const Map>& map, bool zeroOut = true)
296  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, 1, zeroOut)
297  {
300  "int",
301  typeid(EpetraNode).name());
302  }
303 
304 
307  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, A, map->getNodeNumElements(), 1)
308  {
311  "int",
312  typeid(EpetraNode).name());
313  }
314 
315 
316  virtual ~TpetraVector() {}
317 
318 
319  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar& value) {}
320 
321 
323  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar& value) {}
324 
325 
327  void replaceLocalValue(LocalOrdinal myRow, const Scalar& value) {}
328 
329 
331  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar& value) {}
332 
333 
335 
337 
338 
339 
342  {
344  }
345 
346 
349  {
351  }
352 
353 
356  {
358  }
359 
360 
362  Scalar meanValue() const { return Teuchos::ScalarTraits<Scalar>::zero(); }
363 
365 
367 
368 
369 
371  std::string description() const { return std::string(""); }
372 
373 
376 
378 
379 
381  Scalar dot(const Vector& a) const { return Teuchos::ScalarTraits<Scalar>::zero(); }
382 
383 
384 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
385  TPETRA_DEPRECATED typename Teuchos::ScalarTraits<Scalar>::magnitudeType normWeighted(const Vector& weights) const
387  {
389  }
390 #endif // TPETRA_ENABLE_DEPRECATED_CODE
391 
392 
394 
395 
397  TpetraVector(const Teuchos::RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>& vec)
399  {
402  "int",
403  typeid(EpetraNode).name());
404  }
405 
406 
410  {
411  return Teuchos::null;
412  }
413 
414 
415 
416 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
417 
419 
420  typename dual_view_type::t_host_um getHostLocalView() const
421  {
422  typename dual_view_type::t_host_um ret;
423  return ret;
424  }
425 
426  typename dual_view_type::t_dev_um getDeviceLocalView() const
427  {
428  typename dual_view_type::t_dev_um ret;
429  return ret;
430  }
431 
432 
433 
444  template<class TargetDeviceType>
445  typename Kokkos::Impl::if_c<
446  Kokkos::Impl::is_same<typename dual_view_type::t_dev_um::execution_space::memory_space, typename TargetDeviceType::memory_space>::value,
447  typename dual_view_type::t_dev_um,
448  typename dual_view_type::t_host_um>::type
449  getLocalView() const
450  {
451  typename Kokkos::Impl::if_c<
452  Kokkos::Impl::is_same<typename dual_view_type::t_dev_um::execution_space::memory_space, typename TargetDeviceType::memory_space>::value,
453  typename dual_view_type::t_dev_um,
454  typename dual_view_type::t_host_um>::type ret;
455  return ret;
456  }
457 
458 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
459 
460 
462 
463 }; // TpetraVector class (specialization on GO=int, NO=EpetraNode)
464 
465 
466 #endif // #if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT)))
467  // || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
468 
469 
470 
471 #if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) \
472  || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
473 
474 // specialization of TpetraVector for GO=int and NO=SerialNode
475 template<class Scalar>
476 class TpetraVector<Scalar, int, long long, EpetraNode>
477  : public virtual Vector<Scalar, int, long long, EpetraNode>
478  , public TpetraMultiVector<Scalar, int, long long, EpetraNode>
479 {
480  typedef int LocalOrdinal;
481  typedef long long GlobalOrdinal;
482  typedef EpetraNode Node;
483 
484 #undef XPETRA_TPETRAMULTIVECTOR_SHORT
485 #undef XPETRA_TPETRAVECTOR_SHORT
486 #include "Xpetra_UseShortNames.hpp"
487 #define XPETRA_TPETRAMULTIVECTOR_SHORT
488 #define XPETRA_TPETRAVECTOR_SHORT
489 
490  public:
491  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::dot; // overloading, not hiding
492  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::norm1; // overloading, not hiding
493  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::norm2; // overloading, not hiding
494  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::normInf; // overloading, not hiding
495  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::meanValue; // overloading, not hiding
496  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::replaceGlobalValue; // overloading, not hiding
497  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::sumIntoGlobalValue; // overloading, not hiding
498  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::replaceLocalValue; // overloading, not hiding
499  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::sumIntoLocalValue; // overloading, not hiding
500 
502 
503 
505  TpetraVector(const Teuchos::RCP<const Map>& map, bool zeroOut = true)
506  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, 1, zeroOut)
507  {
510  "long long",
511  typeid(EpetraNode).name());
512  }
513 
516  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, A, map->getNodeNumElements(), 1)
517  {
520  "long long",
521  typeid(EpetraNode).name());
522  }
523 
525  virtual ~TpetraVector() {}
526 
528 
530 
531 
533  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar& value) {}
534 
536  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar& value) {}
537 
539  void replaceLocalValue(LocalOrdinal myRow, const Scalar& value) {}
540 
542  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar& value) {}
543 
545 
547 
548 
551  {
553  }
554 
557  {
559  }
560 
563  {
565  }
566 
568  Scalar meanValue() const { return Teuchos::ScalarTraits<Scalar>::zero(); }
569 
571 
573 
574 
576  std::string description() const { return std::string(""); }
577 
580 
582 
584  Scalar dot(const Vector& a) const { return Teuchos::ScalarTraits<Scalar>::zero(); }
585 
587 #ifdef TPETRA_ENABLE_DEPRECATED_CODE
588  TPETRA_DEPRECATED typename Teuchos::ScalarTraits<Scalar>::magnitudeType normWeighted(const Vector& weights) const
589  {
591  }
592 #endif // TPETRA_ENABLE_DEPRECATED_CODE
593 
595 
596 
597 
599  TpetraVector(const Teuchos::RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>& vec)
600  {
603  "long long",
604  typeid(EpetraNode).name());
605  }
606 
607 
611  {
612  return Teuchos::null;
613  }
614 
615 
616 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
617 
619 
620  typename dual_view_type::t_host_um getHostLocalView() const
621  {
622  typename dual_view_type::t_host_um ret;
623  return ret;
624  }
625 
626  typename dual_view_type::t_dev_um getDeviceLocalView() const
627  {
628  typename dual_view_type::t_dev_um ret;
629  return ret;
630  }
631 
642  template<class TargetDeviceType>
643  typename Kokkos::Impl::if_c<
644  Kokkos::Impl::is_same<typename dual_view_type::t_dev_um::execution_space::memory_space, typename TargetDeviceType::memory_space>::value,
645  typename dual_view_type::t_dev_um,
646  typename dual_view_type::t_host_um>::type
647  getLocalView() const
648  {
649  typename Kokkos::Impl::if_c<
650  Kokkos::Impl::is_same<typename dual_view_type::t_dev_um::execution_space::memory_space, typename TargetDeviceType::memory_space>::value,
651  typename dual_view_type::t_dev_um,
652  typename dual_view_type::t_host_um>::type ret;
653  return ret;
654  }
655 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
656 
658 
659 }; // TpetraVector class (specialization on GO=long long, NO=EpetraNode)
660 
661 
662 #endif // #if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))
663  // || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
664 
665 
666 
667 #endif // HAVE_XPETRA_EPETRA
668 } // namespace Xpetra
669 
670 #endif
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
std::string description() const
Return a simple one-line description of this object.
virtual ~TpetraVector()
Destructor.
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 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.
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
Scalar meanValue() const
Compute mean (average) value of this Vector.
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.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
TpetraVector(const Teuchos::RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >> &vec)
TpetraMultiVector constructor to wrap a Tpetra::MultiVector object.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
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 replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
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.
std::string description() const
Return a simple one-line description of this object.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
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.
static const EVerbosityLevel verbLevel_default
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
TpetraVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &map, bool zeroOut=true)
Sets all vector entries to zero.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
static magnitudeType magnitude(T a)
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
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.
void sumIntoLocalValue(LocalOrdinal myRow, 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< 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.
RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_MultiVector() const
Get the underlying Tpetra multivector.
#define XPETRA_MONITOR(funcName)
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) ...
Scalar dot(const Vector &a) const
Computes dot product of this Vector against input Vector x.
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.
TpetraVector(const Teuchos::RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >> &vec)
TpetraMultiVector constructor to wrap a Tpetra::MultiVector object.
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.
TpetraVector(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
Sets all vector entries to zero.
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.
TpetraVector(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
Sets all vector entries to zero.