Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros 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>
66  const Teuchos::ArrayView<const Scalar>& A)
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>
120 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
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>
130 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
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>
140 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
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
172 describe(Teuchos::FancyOStream& out, const Teuchos::EVerbosityLevel verbLevel) const
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 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
191 TpetraVector(const Teuchos::RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>& vec)
192  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(vec)
193 {
194 }
195 
196 
197 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
198 RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
201 {
203 }
204 
205 
206 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
207 
208 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
211 getHostLocalView() const
212 {
214 }
215 
216 
217 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
219 TpetraVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
220 getDeviceLocalView() const
221 {
222  return this->TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getDeviceLocalView();
223 }
224 
225 
226 #if 0
227  template<class TargetDeviceType>
228  typename Kokkos::Impl::if_c<
229  std::is_same<
230  typename dual_view_type::t_dev_um::execution_space::memory_space,
231  typename TargetDeviceType::memory_space>::value,
232  typename dual_view_type::t_dev_um,
233  typename dual_view_type::t_host_um>::type
234 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
235  TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::getLocalView () const {
236  return this->TpetraMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
237  }
238 #endif // #if 0
239 
240 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
241 
242 
243 
244 #ifdef HAVE_XPETRA_EPETRA
245 
246 
247 
248 #if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) \
249  || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
250 
251 // specialization of TpetraVector for GO=int and NO=SerialNode
252 template<class Scalar>
253 class TpetraVector<Scalar, int, int, EpetraNode>
254  : public virtual Vector<Scalar, int, int, EpetraNode>
255  , public TpetraMultiVector<Scalar, int, int, EpetraNode>
256 {
257  typedef int LocalOrdinal;
258  typedef int GlobalOrdinal;
259  typedef EpetraNode Node;
260 
261 #undef XPETRA_TPETRAMULTIVECTOR_SHORT
262 #undef XPETRA_TPETRAVECTOR_SHORT
263 #include "Xpetra_UseShortNames.hpp"
264 #define XPETRA_TPETRAMULTIVECTOR_SHORT
265 #define XPETRA_TPETRAVECTOR_SHORT
266 
267  public:
268 
278 
280 
281 
283  TpetraVector(const Teuchos::RCP<const Map>& map, bool zeroOut = true)
284  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, 1, zeroOut)
285  {
288  "int",
289  typeid(EpetraNode).name());
290  }
291 
292 
294  TpetraVector(const Teuchos::RCP<const Map>& map, const Teuchos::ArrayView<const Scalar>& A)
295  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, A, map->getNodeNumElements(), 1)
296  {
299  "int",
300  typeid(EpetraNode).name());
301  }
302 
303 
304  virtual ~TpetraVector() {}
305 
306 
307  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar& value) {}
308 
309 
311  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar& value) {}
312 
313 
315  void replaceLocalValue(LocalOrdinal myRow, const Scalar& value) {}
316 
317 
319  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar& value) {}
320 
321 
323 
325 
326 
327 
329  typename Teuchos::ScalarTraits<Scalar>::magnitudeType norm1() const
330  {
331  return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
332  }
333 
334 
336  typename Teuchos::ScalarTraits<Scalar>::magnitudeType norm2() const
337  {
338  return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
339  }
340 
341 
343  typename Teuchos::ScalarTraits<Scalar>::magnitudeType normInf() const
344  {
345  return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
346  }
347 
348 
350  Scalar meanValue() const { return Teuchos::ScalarTraits<Scalar>::zero(); }
351 
353 
355 
356 
357 
359  std::string description() const { return std::string(""); }
360 
361 
363  void describe(Teuchos::FancyOStream& out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {}
364 
366 
367 
369  Scalar dot(const Vector& a) const { return Teuchos::ScalarTraits<Scalar>::zero(); }
370 
371 
372 
373 
375 
376 
378  TpetraVector(const Teuchos::RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>& vec)
380  {
383  "int",
384  typeid(EpetraNode).name());
385  }
386 
387 
389  RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
391  {
392  return Teuchos::null;
393  }
394 
395 
396 
397 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
398 
400 
401  typename dual_view_type::t_host_um getHostLocalView() const
402  {
403  typename dual_view_type::t_host_um ret;
404  return ret;
405  }
406 
407  typename dual_view_type::t_dev_um getDeviceLocalView() const
408  {
409  typename dual_view_type::t_dev_um ret;
410  return ret;
411  }
412 
413 
414 
425  template<class TargetDeviceType>
426  typename Kokkos::Impl::if_c<
427  std::is_same<typename dual_view_type::t_dev_um::execution_space::memory_space, typename TargetDeviceType::memory_space>::value,
428  typename dual_view_type::t_dev_um,
429  typename dual_view_type::t_host_um>::type
430  getLocalView() const
431  {
432  typename Kokkos::Impl::if_c<
433  std::is_same<typename dual_view_type::t_dev_um::execution_space::memory_space, typename TargetDeviceType::memory_space>::value,
434  typename dual_view_type::t_dev_um,
435  typename dual_view_type::t_host_um>::type ret;
436  return ret;
437  }
438 
439 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
440 
441 
443 
444 }; // TpetraVector class (specialization on GO=int, NO=EpetraNode)
445 
446 
447 #endif // #if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT)))
448  // || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
449 
450 
451 
452 #if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) \
453  || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
454 
455 // specialization of TpetraVector for GO=int and NO=SerialNode
456 template<class Scalar>
457 class TpetraVector<Scalar, int, long long, EpetraNode>
458  : public virtual Vector<Scalar, int, long long, EpetraNode>
459  , public TpetraMultiVector<Scalar, int, long long, EpetraNode>
460 {
461  typedef int LocalOrdinal;
462  typedef long long GlobalOrdinal;
463  typedef EpetraNode Node;
464 
465 #undef XPETRA_TPETRAMULTIVECTOR_SHORT
466 #undef XPETRA_TPETRAVECTOR_SHORT
467 #include "Xpetra_UseShortNames.hpp"
468 #define XPETRA_TPETRAMULTIVECTOR_SHORT
469 #define XPETRA_TPETRAVECTOR_SHORT
470 
471  public:
472  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::dot; // overloading, not hiding
473  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::norm1; // overloading, not hiding
474  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::norm2; // overloading, not hiding
475  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::normInf; // overloading, not hiding
476  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::meanValue; // overloading, not hiding
477  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::replaceGlobalValue; // overloading, not hiding
478  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::sumIntoGlobalValue; // overloading, not hiding
479  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::replaceLocalValue; // overloading, not hiding
480  using TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::sumIntoLocalValue; // overloading, not hiding
481 
483 
484 
486  TpetraVector(const Teuchos::RCP<const Map>& map, bool zeroOut = true)
487  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, 1, zeroOut)
488  {
491  "long long",
492  typeid(EpetraNode).name());
493  }
494 
496  TpetraVector(const Teuchos::RCP<const Map>& map, const Teuchos::ArrayView<const Scalar>& A)
497  : TpetraMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, A, map->getNodeNumElements(), 1)
498  {
501  "long long",
502  typeid(EpetraNode).name());
503  }
504 
506  virtual ~TpetraVector() {}
507 
509 
511 
512 
514  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar& value) {}
515 
517  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar& value) {}
518 
520  void replaceLocalValue(LocalOrdinal myRow, const Scalar& value) {}
521 
523  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar& value) {}
524 
526 
528 
529 
531  typename Teuchos::ScalarTraits<Scalar>::magnitudeType norm1() const
532  {
533  return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
534  }
535 
537  typename Teuchos::ScalarTraits<Scalar>::magnitudeType norm2() const
538  {
539  return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
540  }
541 
543  typename Teuchos::ScalarTraits<Scalar>::magnitudeType normInf() const
544  {
545  return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero());
546  }
547 
549  Scalar meanValue() const { return Teuchos::ScalarTraits<Scalar>::zero(); }
550 
552 
554 
555 
557  std::string description() const { return std::string(""); }
558 
560  void describe(Teuchos::FancyOStream& out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {}
561 
563 
565  Scalar dot(const Vector& a) const { return Teuchos::ScalarTraits<Scalar>::zero(); }
566 
568 
570 
571 
572 
574  TpetraVector(const Teuchos::RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>& vec)
575  {
578  "long long",
579  typeid(EpetraNode).name());
580  }
581 
582 
584  RCP<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
586  {
587  return Teuchos::null;
588  }
589 
590 
591 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
592 
594 
595  typename dual_view_type::t_host_um getHostLocalView() const
596  {
597  typename dual_view_type::t_host_um ret;
598  return ret;
599  }
600 
601  typename dual_view_type::t_dev_um getDeviceLocalView() const
602  {
603  typename dual_view_type::t_dev_um ret;
604  return ret;
605  }
606 
617  template<class TargetDeviceType>
618  typename Kokkos::Impl::if_c<
619  std::is_same<typename dual_view_type::t_dev_um::execution_space::memory_space, typename TargetDeviceType::memory_space>::value,
620  typename dual_view_type::t_dev_um,
621  typename dual_view_type::t_host_um>::type
622  getLocalView() const
623  {
624  typename Kokkos::Impl::if_c<
625  std::is_same<typename dual_view_type::t_dev_um::execution_space::memory_space, typename TargetDeviceType::memory_space>::value,
626  typename dual_view_type::t_dev_um,
627  typename dual_view_type::t_host_um>::type ret;
628  return ret;
629  }
630 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
631 
633 
634 }; // TpetraVector class (specialization on GO=long long, NO=EpetraNode)
635 
636 
637 #endif // #if((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))
638  // || (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
639 
640 
641 
642 #endif // HAVE_XPETRA_EPETRA
643 } // namespace Xpetra
644 
645 #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.
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.
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.