Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_TpetraMultiVector_def.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Xpetra: A linear algebra interface package
4 //
5 // Copyright 2012 NTESS and the Xpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef XPETRA_TPETRAMULTIVECTOR_DEF_HPP
11 #define XPETRA_TPETRAMULTIVECTOR_DEF_HPP
13 
14 #include "Xpetra_TpetraMap.hpp" //TMP
15 #include "Xpetra_Utils.hpp"
16 #include "Xpetra_TpetraImport.hpp"
17 #include "Xpetra_TpetraExport.hpp"
18 
20 #include "Tpetra_MultiVector.hpp"
21 #include "Tpetra_Vector.hpp"
22 #include "Tpetra_Details_Random.hpp"
23 
24 namespace Xpetra {
25 
27 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
29  : vec_(Teuchos::rcp(new Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(toTpetra(map), NumVectors, zeroOut))) {
30  // TAW 1/30/2016: even though Tpetra allows numVecs == 0, Epetra does not. Introduce exception to keep behavior of Epetra and Tpetra consistent.
31  TEUCHOS_TEST_FOR_EXCEPTION(NumVectors < 1, std::invalid_argument, "Xpetra::TpetraMultiVector(map,numVecs,zeroOut): numVecs = " << NumVectors << " < 1.");
32 }
33 
35 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
37  TpetraMultiVector(const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &source, const Teuchos::DataAccess copyOrView)
38  : vec_(Teuchos::rcp(new Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(toTpetra(source), copyOrView))) {}
39 
41 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
43  TpetraMultiVector(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, const Teuchos::ArrayView<const Scalar> &A, size_t LDA, size_t NumVectors)
44  : vec_(Teuchos::rcp(new Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(toTpetra(map), A, LDA, NumVectors))) {
45  // TAW 1/30/2016: even though Tpetra allows numVecs == 0, Epetra does not. Introduce exception to keep behavior of Epetra and Tpetra consistent.
46  TEUCHOS_TEST_FOR_EXCEPTION(NumVectors < 1, std::invalid_argument, "Xpetra::TpetraMultiVector(map,A,LDA,numVecs): numVecs = " << NumVectors << " < 1.");
47 }
48 
50 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
52  TpetraMultiVector(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, const Teuchos::ArrayView<const Teuchos::ArrayView<const Scalar> > &ArrayOfPtrs, size_t NumVectors)
53  : vec_(Teuchos::rcp(new Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(toTpetra(map), ArrayOfPtrs, NumVectors))) {
54  // TAW 1/30/2016: even though Tpetra allows numVecs == 0, Epetra does not. Introduce exception to keep behavior of Epetra and Tpetra consistent.
55  TEUCHOS_TEST_FOR_EXCEPTION(NumVectors < 1, std::invalid_argument, "Xpetra::TpetraMultiVector(map,ArrayOfPtrs,numVecs): numVecs = " << NumVectors << " < 1.");
56 }
57 
59 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
62 
64 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
66  replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {
67  XPETRA_MONITOR("TpetraMultiVector::replaceGlobalValue");
68  vec_->replaceGlobalValue(globalRow, vectorIndex, value);
69 }
70 
72 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
74  sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {
75  XPETRA_MONITOR("TpetraMultiVector::sumIntoGlobalValue");
76  vec_->sumIntoGlobalValue(globalRow, vectorIndex, value);
77 }
78 
80 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
82  replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {
83  XPETRA_MONITOR("TpetraMultiVector::replaceLocalValue");
84  vec_->replaceLocalValue(myRow, vectorIndex, value);
85 }
86 
88 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
90  sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {
91  XPETRA_MONITOR("TpetraMultiVector::sumIntoLocalValue");
92  vec_->sumIntoLocalValue(myRow, vectorIndex, value);
93 }
94 
96 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
98  putScalar(const Scalar &value) {
99  XPETRA_MONITOR("TpetraMultiVector::putScalar");
100  vec_->putScalar(value);
101 }
102 
104 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
107  XPETRA_MONITOR("TpetraMultiVector::reduce");
108  vec_->reduce();
109 }
110 
111 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
112 Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
114  getVector(size_t j) const {
115  XPETRA_MONITOR("TpetraMultiVector::getVector");
116  return toXpetra(vec_->getVector(j));
117 }
118 
120 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
121 Teuchos::RCP<Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
124  XPETRA_MONITOR("TpetraMultiVector::getVectorNonConst");
125  return toXpetra(vec_->getVectorNonConst(j));
126 }
127 
129 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
130 Teuchos::ArrayRCP<const Scalar>
132  getData(size_t j) const {
133  XPETRA_MONITOR("TpetraMultiVector::getData");
134  return vec_->getData(j);
135 }
136 
138 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
139 Teuchos::ArrayRCP<Scalar>
141  getDataNonConst(size_t j) {
142  XPETRA_MONITOR("TpetraMultiVector::getDataNonConst");
143  return vec_->getDataNonConst(j);
144 }
145 
147 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
149  get1dCopy(Teuchos::ArrayView<Scalar> A, size_t LDA) const {
150  XPETRA_MONITOR("TpetraMultiVector::get1dCopy");
151  vec_->get1dCopy(A, LDA);
152 }
153 
155 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
157  get2dCopy(Teuchos::ArrayView<const Teuchos::ArrayView<Scalar> > ArrayOfPtrs) const {
158  XPETRA_MONITOR("TpetraMultiVector::get2dCopy");
159  vec_->get2dCopy(ArrayOfPtrs);
160 }
161 
163 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
164 Teuchos::ArrayRCP<const Scalar>
166  get1dView() const {
167  XPETRA_MONITOR("TpetraMultiVector::get1dView");
168  return vec_->get1dView();
169 }
170 
172 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
173 Teuchos::ArrayRCP<Teuchos::ArrayRCP<const Scalar> >
175  get2dView() const {
176  XPETRA_MONITOR("TpetraMultiVector::get2dView");
177  return vec_->get2dView();
178 }
179 
181 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
182 Teuchos::ArrayRCP<Scalar>
185  XPETRA_MONITOR("TpetraMultiVector::get1dViewNonConst");
186  return vec_->get1dViewNonConst();
187 }
188 
190 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
191 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> >
194  XPETRA_MONITOR("TpetraMultiVector::get2dViewNonConst");
195  return vec_->get2dViewNonConst();
196 }
197 
199 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
201  dot(const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const Teuchos::ArrayView<Scalar> &dots) const {
202  XPETRA_MONITOR("TpetraMultiVector::dot");
203  vec_->dot(toTpetra(A), dots);
204 }
205 
207 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
210  XPETRA_MONITOR("TpetraMultiVector::abs");
211  vec_->abs(toTpetra(A));
212 }
213 
215 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
218  XPETRA_MONITOR("TpetraMultiVector::reciprocal");
219  vec_->reciprocal(toTpetra(A));
220 }
221 
223 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
225  scale(const Scalar &alpha) {
226  XPETRA_MONITOR("TpetraMultiVector::scale");
227  vec_->scale(alpha);
228 }
229 
231 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
233  scale(Teuchos::ArrayView<const Scalar> alpha) {
234  XPETRA_MONITOR("TpetraMultiVector::scale");
235  vec_->scale(alpha);
236 }
237 
239 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
242  XPETRA_MONITOR("TpetraMultiVector::scale");
243  vec_->scale(alpha, toTpetra(A));
244 }
245 
247 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
249  update(const Scalar &alpha, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const Scalar &beta) {
250  XPETRA_MONITOR("TpetraMultiVector::update");
251  vec_->update(alpha, toTpetra(A), beta);
252 }
253 
255 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
257  update(const Scalar &alpha, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const Scalar &beta, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &B, const Scalar &gamma) {
258  XPETRA_MONITOR("TpetraMultiVector::update");
259  vec_->update(alpha, toTpetra(A), beta, toTpetra(B), gamma);
260 }
261 
263 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
265  norm1(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {
266  XPETRA_MONITOR("TpetraMultiVector::norm1");
267  vec_->norm1(norms);
268 }
269 
271 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
273  norm2(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {
274  XPETRA_MONITOR("TpetraMultiVector::norm2");
275  vec_->norm2(norms);
276 }
277 
279 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
281  normInf(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {
282  XPETRA_MONITOR("TpetraMultiVector::normInf");
283  vec_->normInf(norms);
284 }
285 
287 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
289  meanValue(const Teuchos::ArrayView<Scalar> &means) const {
290  XPETRA_MONITOR("TpetraMultiVector::meanValue");
291  vec_->meanValue(means);
292 }
293 
295 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
297  multiply(Teuchos::ETransp transA, Teuchos::ETransp transB, const Scalar &alpha, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &B, const Scalar &beta) {
298  XPETRA_MONITOR("TpetraMultiVector::multiply");
299  vec_->multiply(transA, transB, alpha, toTpetra(A), toTpetra(B), beta);
300 }
301 
303 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
305  getNumVectors() const {
306  XPETRA_MONITOR("TpetraMultiVector::getNumVectors");
307  return vec_->getNumVectors();
308 }
309 
311 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
314  XPETRA_MONITOR("TpetraMultiVector::getLocalLength");
315  return vec_->getLocalLength();
316 }
317 
319 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
322  XPETRA_MONITOR("TpetraMultiVector::getGlobalLength");
323  return vec_->getGlobalLength();
324 }
325 
326 // \brief Checks to see if the local length, number of vectors and size of Scalar type match
327 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
330  XPETRA_MONITOR("TpetraMultiVector::isSameSize");
331  return vec_->isSameSize(toTpetra(vec));
332 }
333 
335 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
337  description() const {
338  XPETRA_MONITOR("TpetraMultiVector::description");
339  return vec_->description();
340 }
341 
343 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
345  describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const {
346  XPETRA_MONITOR("TpetraMultiVector::describe");
347  vec_->describe(out, verbLevel);
348 }
349 
351 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
353  randomize(bool bUseXpetraImplementation) {
354  XPETRA_MONITOR("TpetraMultiVector::randomize");
355 
356  if (bUseXpetraImplementation)
358  else
359  vec_->randomize();
360 }
361 
363 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
365  randomize(const Scalar &minVal, const Scalar &maxVal, bool bUseXpetraImplementation) {
366  XPETRA_MONITOR("TpetraMultiVector::randomize");
367 
368  if (bUseXpetraImplementation)
370  else
371  vec_->randomize(minVal, maxVal);
372 }
373 
374 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
375 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
377  getMap() const {
378  XPETRA_MONITOR("TpetraMultiVector::getMap");
379  return toXpetra(vec_->getMap());
380 }
381 
382 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
385  XPETRA_MONITOR("TpetraMultiVector::doImport");
386 
387  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, source, tSource, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
388  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_MultiVector();
389  this->getTpetra_MultiVector()->doImport(*v, toTpetra(importer), toTpetra(CM));
390 }
391 
392 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
395  XPETRA_MONITOR("TpetraMultiVector::beginImport");
396 
397  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, source, tSource, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
398  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_MultiVector();
399  this->getTpetra_MultiVector()->beginImport(*v, toTpetra(importer), toTpetra(CM));
400 }
401 
402 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
405  XPETRA_MONITOR("TpetraMultiVector::endImport");
406 
407  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, source, tSource, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
408  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_MultiVector();
409  this->getTpetra_MultiVector()->endImport(*v, toTpetra(importer), toTpetra(CM));
410 }
411 
412 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
415  XPETRA_MONITOR("TpetraMultiVector::doExport");
416 
417  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, dest, tDest, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
418  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tDest.getTpetra_MultiVector();
419  this->getTpetra_MultiVector()->doExport(*v, toTpetra(importer), toTpetra(CM));
420 }
421 
422 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
425  XPETRA_MONITOR("TpetraMultiVector::beginExport");
426 
427  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, dest, tDest, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
428  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tDest.getTpetra_MultiVector();
429  this->getTpetra_MultiVector()->beginExport(*v, toTpetra(importer), toTpetra(CM));
430 }
431 
432 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
435  XPETRA_MONITOR("TpetraMultiVector::endExport");
436 
437  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, dest, tDest, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
438  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tDest.getTpetra_MultiVector();
439  this->getTpetra_MultiVector()->endExport(*v, toTpetra(importer), toTpetra(CM));
440 }
441 
442 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
445  XPETRA_MONITOR("TpetraMultiVector::doImport");
446 
447  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, source, tSource, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
448  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_MultiVector();
449  this->getTpetra_MultiVector()->doImport(*v, toTpetra(exporter), toTpetra(CM));
450 }
451 
452 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
455  XPETRA_MONITOR("TpetraMultiVector::beginImport");
456 
457  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, source, tSource, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
458  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_MultiVector();
459  this->getTpetra_MultiVector()->beginImport(*v, toTpetra(exporter), toTpetra(CM));
460 }
461 
462 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
465  XPETRA_MONITOR("TpetraMultiVector::endImport");
466 
467  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, source, tSource, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
468  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_MultiVector();
469  this->getTpetra_MultiVector()->endImport(*v, toTpetra(exporter), toTpetra(CM));
470 }
471 
472 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
475  XPETRA_MONITOR("TpetraMultiVector::doExport");
476 
477  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, dest, tDest, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
478  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tDest.getTpetra_MultiVector();
479  this->getTpetra_MultiVector()->doExport(*v, toTpetra(exporter), toTpetra(CM));
480 }
481 
482 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
485  XPETRA_MONITOR("TpetraMultiVector::beginExport");
486 
487  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, dest, tDest, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
488  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tDest.getTpetra_MultiVector();
489  this->getTpetra_MultiVector()->beginExport(*v, toTpetra(exporter), toTpetra(CM));
490 }
491 
492 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
495  XPETRA_MONITOR("TpetraMultiVector::endExport");
496 
497  XPETRA_DYNAMIC_CAST(const TpetraMultiVectorClass, dest, tDest, "Xpetra::TpetraMultiVector::doImport only accept Xpetra::TpetraMultiVector as input arguments."); // TODO: remove and use toTpetra()
498  RCP<const Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > v = tDest.getTpetra_MultiVector();
499  this->getTpetra_MultiVector()->endExport(*v, toTpetra(exporter), toTpetra(CM));
500 }
501 
502 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
505  XPETRA_MONITOR("TpetraMultiVector::replaceMap");
506  this->getTpetra_MultiVector()->replaceMap(toTpetra(map));
507 }
508 
510 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
512  TpetraMultiVector(const Teuchos::RCP<Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &vec)
513  : vec_(vec) {} // TODO removed const
514 
516 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
517 RCP<Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
519  getTpetra_MultiVector() const { return vec_; }
520 
522 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
524  setSeed(unsigned int seed) {
525  XPETRA_MONITOR("TpetraMultiVector::seedrandom");
526  Teuchos::ScalarTraits<Scalar>::seedrandom(seed);
527  // Tell Tpetra to update its RNG pool for the new random seed
528  Tpetra::Details::Static_Random_XorShift64_Pool<typename Node::device_type::execution_space>::resetPool(getMap()->getComm()->getRank());
529 }
530 
531 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
535  return subview(vec_->getLocalViewHost(Tpetra::Access::ReadOnly), Kokkos::ALL(), Kokkos::ALL());
536 }
537 
538 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
542  return subview(vec_->getLocalViewDevice(Tpetra::Access::ReadOnly), Kokkos::ALL(), Kokkos::ALL());
543 }
544 
545 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
549  return subview(vec_->getLocalViewHost(Tpetra::Access::OverwriteAll), Kokkos::ALL(), Kokkos::ALL());
550 }
551 
552 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
556  return subview(vec_->getLocalViewDevice(Tpetra::Access::OverwriteAll), Kokkos::ALL(), Kokkos::ALL());
557 }
558 
559 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
563  return subview(vec_->getLocalViewHost(Tpetra::Access::ReadWrite), Kokkos::ALL(), Kokkos::ALL());
564 }
565 
566 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
570  return subview(vec_->getLocalViewDevice(Tpetra::Access::ReadWrite), Kokkos::ALL(), Kokkos::ALL());
571 }
572 
575 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
579  const this_type *rhsPtr = dynamic_cast<const this_type *>(&rhs);
580  TEUCHOS_TEST_FOR_EXCEPTION(
581  rhsPtr == NULL, std::invalid_argument,
582  "Xpetra::MultiVector::operator=:"
583  " The left-hand side (LHS) of the assignment has a different type than "
584  "the right-hand side (RHS). The LHS has type Xpetra::TpetraMultiVector"
585  " (which means it wraps a Tpetra::MultiVector), but the RHS has some "
586  "other type. This probably means that the RHS wraps an "
587  "Epetra_MultiVector. Xpetra::MultiVector does not currently implement "
588  "assignment from an Epetra object to a Tpetra object, though this could"
589  " be added with sufficient interest.");
590 
591  typedef Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> TMV;
592  RCP<const TMV> rhsImpl = rhsPtr->getTpetra_MultiVector();
593  RCP<TMV> lhsImpl = this->getTpetra_MultiVector();
594 
595  TEUCHOS_TEST_FOR_EXCEPTION(
596  rhsImpl.is_null(), std::logic_error,
597  "Xpetra::MultiVector::operator= "
598  "(in Xpetra::TpetraMultiVector::assign): *this (the right-hand side of "
599  "the assignment) has a null RCP<Tpetra::MultiVector> inside. Please "
600  "report this bug to the Xpetra developers.");
601  TEUCHOS_TEST_FOR_EXCEPTION(
602  lhsImpl.is_null(), std::logic_error,
603  "Xpetra::MultiVector::operator= "
604  "(in Xpetra::TpetraMultiVector::assign): The left-hand side of the "
605  "assignment has a null RCP<Tpetra::MultiVector> inside. Please report "
606  "this bug to the Xpetra developers.");
607 
608  Tpetra::deep_copy(*lhsImpl, *rhsImpl);
609 }
610 
611 #ifdef HAVE_XPETRA_EPETRA
612 
613 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
614  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
615 
616 // specialization for TpetraMultiVector on EpetraNode and GO=int
617 template <class Scalar>
618 class TpetraMultiVector<Scalar, int, int, EpetraNode>
619  : public virtual MultiVector<Scalar, int, int, EpetraNode> {
620  typedef int LocalOrdinal;
621  typedef int GlobalOrdinal;
622  typedef EpetraNode Node;
623 
624  // The following typedef are used by the XPETRA_DYNAMIC_CAST() macro.
626 
627  public:
629 
630 
634  }
635 
637  TpetraMultiVector(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, size_t NumVectors, bool zeroOut = true) {
639  }
640 
642  TpetraMultiVector(const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &source, const Teuchos::DataAccess copyOrView) {
644  }
645 
647  TpetraMultiVector(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, const Teuchos::ArrayView<const Scalar> &A, size_t LDA, size_t NumVectors) {
649  }
650 
652  TpetraMultiVector(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, const Teuchos::ArrayView<const Teuchos::ArrayView<const Scalar> > &ArrayOfPtrs, size_t NumVectors) {
654  }
655 
657  virtual ~TpetraMultiVector() {}
658 
660 
662 
663 
665  void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {}
666 
668  void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {}
669 
671  void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {}
672 
674  void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {}
675 
677  void putScalar(const Scalar &value) {}
678 
680  void reduce() {}
681 
683 
685 
686 
688  Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getVector(size_t j) const { return Teuchos::null; }
689 
691  Teuchos::RCP<Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getVectorNonConst(size_t j) { return Teuchos::null; }
692 
694  Teuchos::ArrayRCP<const Scalar> getData(size_t j) const { return Teuchos::ArrayRCP<const Scalar>(); }
695 
697  Teuchos::ArrayRCP<Scalar> getDataNonConst(size_t j) { return Teuchos::ArrayRCP<Scalar>(); }
698 
700  void get1dCopy(Teuchos::ArrayView<Scalar> A, size_t LDA) const {}
701 
703  void get2dCopy(Teuchos::ArrayView<const Teuchos::ArrayView<Scalar> > ArrayOfPtrs) const {}
704 
706  Teuchos::ArrayRCP<const Scalar> get1dView() const { return Teuchos::ArrayRCP<const Scalar>(); }
707 
709  Teuchos::ArrayRCP<Teuchos::ArrayRCP<const Scalar> > get2dView() const { return Teuchos::ArrayRCP<Teuchos::ArrayRCP<const Scalar> >(); }
710 
712  Teuchos::ArrayRCP<Scalar> get1dViewNonConst() { return Teuchos::ArrayRCP<Scalar>(); }
713 
715  Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> > get2dViewNonConst() { return Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> >(); }
716 
718 
720 
721 
723  void dot(const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const Teuchos::ArrayView<Scalar> &dots) const {}
724 
727 
730 
732  void scale(const Scalar &alpha) {}
733 
735  void scale(Teuchos::ArrayView<const Scalar> alpha) {}
736 
738  void scale(const Scalar &alpha, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A) {}
739 
741  void update(const Scalar &alpha, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const Scalar &beta) {}
742 
744  void update(const Scalar &alpha, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const Scalar &beta, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &B, const Scalar &gamma) {}
745 
747  void norm1(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
748 
750  void norm2(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
751 
753  void normInf(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
754 
756  void meanValue(const Teuchos::ArrayView<Scalar> &means) const {}
757 
759  void multiply(Teuchos::ETransp transA, Teuchos::ETransp transB, const Scalar &alpha, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &B, const Scalar &beta) {}
760 
762 
764 
765 
767  size_t getNumVectors() const { return 0; }
768 
770  size_t getLocalLength() const { return 0; }
771 
773  global_size_t getGlobalLength() const { return 0; }
774 
775  // \! Checks to see if the local length, number of vectors and size of Scalar type match
777 
779 
781 
782 
784  std::string description() const { return std::string(""); }
785 
787  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {}
788 
790 
793 
795  void randomize(bool bUseXpetraImplementation = false) {}
796 
798  void randomize(const Scalar &minVal, const Scalar &maxVal, bool bUseXpetraImplementation = false) {}
799 
800  //{@
801  // Implements DistObject interface
802 
803  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getMap() const { return Teuchos::null; }
804 
806 
808 
810 
812 
814 
816 
818 
820 
822 
824 
826 
828 
829  void replaceMap(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map) {}
830 
832 
834 
835 
837  TpetraMultiVector(const Teuchos::RCP<Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &vec) {
839  }
840 
842  RCP<Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_MultiVector() const { return Teuchos::null; }
843 
845  void setSeed(unsigned int seed) {}
846 
848 
849  protected:
852  virtual void
854 }; // TpetraMultiVector class (specialization GO=int, NO=EpetraNode)
855 #endif
856 
857 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
858  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
859 
860 // specialization for TpetraMultiVector on EpetraNode and GO=long long
861 template <class Scalar>
862 class TpetraMultiVector<Scalar, int, long long, EpetraNode>
863  : public virtual MultiVector<Scalar, int, long long, EpetraNode> {
864  typedef int LocalOrdinal;
865  typedef long long GlobalOrdinal;
866  typedef EpetraNode Node;
867 
868  // The following typedef are used by the XPETRA_DYNAMIC_CAST() macro.
870 
871  public:
873 
874 
876  TpetraMultiVector(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, size_t NumVectors, bool zeroOut = true) {
878  }
879 
881  TpetraMultiVector(const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &source, const Teuchos::DataAccess copyOrView) {
883  }
884 
886  TpetraMultiVector(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, const Teuchos::ArrayView<const Scalar> &A, size_t LDA, size_t NumVectors) {
888  }
889 
891  TpetraMultiVector(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, const Teuchos::ArrayView<const Teuchos::ArrayView<const Scalar> > &ArrayOfPtrs, size_t NumVectors) {
893  }
894 
896  virtual ~TpetraMultiVector() {}
897 
899 
901 
902 
904  void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {}
905 
907  void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {}
908 
910  void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {}
911 
913  void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {}
914 
916  void putScalar(const Scalar &value) {}
917 
919  void reduce() {}
920 
922 
924 
925 
927  Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getVector(size_t j) const { return Teuchos::null; }
928 
930  Teuchos::RCP<Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getVectorNonConst(size_t j) { return Teuchos::null; }
931 
933  Teuchos::ArrayRCP<const Scalar> getData(size_t j) const { return Teuchos::ArrayRCP<const Scalar>(); }
934 
936  Teuchos::ArrayRCP<Scalar> getDataNonConst(size_t j) { return Teuchos::ArrayRCP<Scalar>(); }
937 
939  void get1dCopy(Teuchos::ArrayView<Scalar> A, size_t LDA) const {}
940 
942  void get2dCopy(Teuchos::ArrayView<const Teuchos::ArrayView<Scalar> > ArrayOfPtrs) const {}
943 
945  Teuchos::ArrayRCP<const Scalar> get1dView() const { return Teuchos::ArrayRCP<const Scalar>(); }
946 
948  Teuchos::ArrayRCP<Teuchos::ArrayRCP<const Scalar> > get2dView() const { return Teuchos::ArrayRCP<Teuchos::ArrayRCP<const Scalar> >(); }
949 
951  Teuchos::ArrayRCP<Scalar> get1dViewNonConst() { return Teuchos::ArrayRCP<Scalar>(); }
952 
954  Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> > get2dViewNonConst() { return Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> >(); }
955 
957 
959 
960 
962  void dot(const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const Teuchos::ArrayView<Scalar> &dots) const {}
963 
966 
969 
971  void scale(const Scalar &alpha) {}
972 
974  void scale(Teuchos::ArrayView<const Scalar> alpha) {}
975 
977  void scale(const Scalar &alpha, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A) {}
978 
980  void update(const Scalar &alpha, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const Scalar &beta) {}
981 
983  void update(const Scalar &alpha, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const Scalar &beta, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &B, const Scalar &gamma) {}
984 
986  void norm1(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
987 
989  void norm2(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
990 
992  void normInf(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const {}
993 
995  void meanValue(const Teuchos::ArrayView<Scalar> &means) const {}
996 
998  void multiply(Teuchos::ETransp transA, Teuchos::ETransp transB, const Scalar &alpha, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &A, const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &B, const Scalar &beta) {}
999 
1001 
1003 
1004 
1006  size_t getNumVectors() const { return 0; }
1007 
1009  size_t getLocalLength() const { return 0; }
1010 
1012  global_size_t getGlobalLength() const { return 0; }
1013 
1014  // \! Checks to see if the local length, number of vectors and size of Scalar type match
1016 
1018 
1020 
1021 
1023  std::string description() const { return std::string(""); }
1024 
1026  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {}
1027 
1029 
1032 
1034  void randomize(bool bUseXpetraImplementation = false) {}
1035 
1037  void randomize(const Scalar &minVal, const Scalar &maxVal, bool bUseXpetraImplementation = false) {}
1038 
1039  //{@
1040  // Implements DistObject interface
1041 
1042  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getMap() const { return Teuchos::null; }
1043 
1045 
1047 
1049 
1051 
1053 
1055 
1057 
1059 
1061 
1063 
1065 
1067 
1068  void replaceMap(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map) {}
1069 
1071 
1073 
1074 
1076  TpetraMultiVector(const Teuchos::RCP<Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &vec) {
1078  }
1079 
1081  RCP<Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_MultiVector() const { return Teuchos::null; }
1082 
1084  void setSeed(unsigned int seed) {}
1085 
1087 
1088  protected:
1091  virtual void
1093 }; // TpetraMultiVector class (specialization GO=int, NO=EpetraNode)
1094 
1095 #endif // TpetraMultiVector class (specialization GO=long long, NO=EpetraNode)
1096 
1097 #endif // HAVE_XPETRA_EPETRA
1098 
1099 } // namespace Xpetra
1100 
1101 // Following header file inculsion is needed for the dynamic_cast to TpetraVector in
1102 // elementWiseMultiply (because we cannot dynamic_cast if target is not a complete type)
1103 // It is included here to avoid circular dependency between Vector and MultiVector
1104 // TODO: there is certainly a more elegant solution...
1105 #include "Xpetra_TpetraVector.hpp"
1106 
1107 namespace Xpetra {
1108 
1109 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
1111  elementWiseMultiply(Scalar scalarAB,
1114  Scalar scalarThis) {
1115  XPETRA_MONITOR("TpetraMultiVector::elementWiseMultiply");
1116 
1117  // XPETRA_DYNAMIC_CAST won't take TpetraVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>
1118  // as an argument, hence the following typedef.
1120  XPETRA_DYNAMIC_CAST(const tpv, A, tA, "Xpetra::TpetraMultiVectorMatrix->multiply() only accept Xpetra::TpetraMultiVector as input arguments.");
1121  XPETRA_DYNAMIC_CAST(const TpetraMultiVector, B, tB, "Xpetra::TpetraMultiVectorMatrix->multiply() only accept Xpetra::TpetraMultiVector as input arguments.");
1122  vec_->elementWiseMultiply(scalarAB, *tA.getTpetra_Vector(), *tB.getTpetra_MultiVector(), scalarThis);
1123 }
1124 
1125 } // namespace Xpetra
1126 
1127 #define XPETRA_TPETRAMULTIVECTOR_SHORT
1128 #endif // XPETRA_TPETRAMULTIVECTOR_HPP
void replaceMap(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
size_t getLocalLength() const
Local number of rows on the calling process.
Teuchos::ArrayRCP< Teuchos::ArrayRCP< const Scalar > > get2dView() const
Return const persisting pointers to values.
RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_MultiVector() const
Get the underlying Tpetra multivector.
void update(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
void norm1(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
Teuchos::ArrayRCP< const Scalar > get1dView() const
Const persisting (1-D) view of this multivector&#39;s local values.
Teuchos::ArrayRCP< Teuchos::ArrayRCP< const Scalar > > get2dView() const
Return const persisting pointers to values.
void doExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
void beginImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
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 endExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
void scale(const Scalar &alpha)
Scale the current values of a multi-vector, this = alpha*this.
TpetraMultiVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Basic constuctor.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void setSeed(unsigned int seed)
Set seed for Random function.
void beginExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with the given verbosity level to a FancyOStream.
Teuchos::ArrayRCP< Teuchos::ArrayRCP< Scalar > > get2dViewNonConst()
Return non-const persisting pointers to values.
void reduce()
Sum values of a locally replicated multivector across all processes.
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 normInf(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
Teuchos::ArrayRCP< Teuchos::ArrayRCP< Scalar > > get2dViewNonConst()
Return non-const persisting pointers to values.
std::string description() const
A simple one-line description of this object.
TpetraMultiVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const Teuchos::ArrayView< const Teuchos::ArrayView< const Scalar > > &ArrayOfPtrs, size_t NumVectors)
Create multivector by copying array of views of local data.
void reciprocal(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
Teuchos::ArrayRCP< Scalar > getDataNonConst(size_t j)
View of the local values in a particular vector of this multivector.
void doExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
constexpr struct ReadOnlyStruct ReadOnly
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
virtual ~TpetraMultiVector()
Destructor (virtual for memory safety of derived classes).
void setSeed(unsigned int seed)
Set seed for Random function.
Teuchos::ArrayRCP< Scalar > getDataNonConst(size_t j)
View of the local values in a particular vector of this multivector.
void elementWiseMultiply(Scalar scalarAB, const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, Scalar scalarThis)
Element-wise multiply of a Vector A with a TpetraMultiVector B.
TpetraMultiVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Basic constuctor.
void doExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
size_t getNumVectors() const
Number of columns in the multivector.
Teuchos::ArrayRCP< const Scalar > getData(size_t j) const
Const view of the local values in a particular vector of this multivector.
void norm2(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
void elementWiseMultiply(Scalar scalarAB, const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, Scalar scalarThis)
Element-wise multiply of a Vector A with a TpetraMultiVector B.
TpetraMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraMultiVectorClass
std::string description() const
A simple one-line description of this object.
void normInf(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
size_t getNumVectors() const
Number of columns in the multivector.
void setSeed(unsigned int seed)
Set seed for Random function.
void scale(const Scalar &alpha)
Scale the current values of a multi-vector, this = alpha*this.
void doImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
void endImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
void randomize(bool bUseXpetraImplementation=false)
Set multi-vector values to random numbers.
void scale(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Replace multi-vector values with scaled values of A, this = alpha*A.
void replaceMap(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
virtual void Xpetra_randomize()
Set multi-vector values to random numbers. XPetra implementation.
void reduce()
Sum values of a locally replicated multivector across all processes.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void beginImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import data into this object using an Import object (&quot;forward mode&quot;).
void beginExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export data into this object using an Import object (&quot;reverse mode&quot;).
void randomize(const Scalar &minVal, const Scalar &maxVal, bool bUseXpetraImplementation=false)
Set multi-vector values to random numbers.
void beginImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Teuchos::ArrayRCP< Scalar > get1dViewNonConst()
Nonconst persisting (1-D) view of this multivector&#39;s local values.
void randomize(const Scalar &minVal, const Scalar &maxVal, bool bUseXpetraImplementation=false)
Set multi-vector values to random numbers.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
void endImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
void get2dCopy(Teuchos::ArrayView< const Teuchos::ArrayView< Scalar > > ArrayOfPtrs) const
Fill the given array with a copy of this multivector&#39;s local values.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void doImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import data into this object using an Import object (&quot;forward mode&quot;).
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...
TpetraMultiVector(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Teuchos::DataAccess copyOrView)
Copy constructor (performs a deep copy).
Teuchos::ArrayRCP< Teuchos::ArrayRCP< Scalar > > get2dViewNonConst()
Return non-const persisting pointers to values.
TpetraMultiVector(const Teuchos::RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &vec)
TpetraMultiVector constructor to wrap a Tpetra::MultiVector object.
void endImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import data into this object using an Import object (&quot;forward mode&quot;).
void get1dCopy(Teuchos::ArrayView< Scalar > A, size_t LDA) const
Fill the given array with a copy of this multivector&#39;s local values.
void elementWiseMultiply(Scalar scalarAB, const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, Scalar scalarThis)
Element-wise multiply of a Vector A with a TpetraMultiVector B.
void norm2(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
void multiply(Teuchos::ETransp transA, Teuchos::ETransp transB, const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, const Scalar &beta)
Matrix-matrix multiplication: this = beta*this + alpha*op(A)*op(B).
TpetraMultiVector(const Teuchos::RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &vec)
TpetraMultiVector constructor to wrap a Tpetra::MultiVector object.
void update(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, const Scalar &gamma)
Update multi-vector with scaled values of A and B, this = gamma*this + alpha*A + beta*B.
void abs(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise absolute values of input Multi-vector in target: A = abs(this).
void putScalar(const Scalar &value)
Set all values in the multivector with the given value.
size_t getLocalLength() const
Local number of rows on the calling process.
void multiply(Teuchos::ETransp transA, Teuchos::ETransp transB, const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, const Scalar &beta)
Matrix-matrix multiplication: this = beta*this + alpha*op(A)*op(B).
void putScalar(const Scalar &value)
Set all values in the multivector with the given value.
void endExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export data into this object using an Import object (&quot;reverse mode&quot;).
void beginImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
void get2dCopy(Teuchos::ArrayView< const Teuchos::ArrayView< Scalar > > ArrayOfPtrs) const
Fill the given array with a copy of this multivector&#39;s local values.
Teuchos::ArrayRCP< const Scalar > getData(size_t j) const
Const view of the local values in a particular vector of this multivector.
void multiply(Teuchos::ETransp transA, Teuchos::ETransp transB, const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, const Scalar &beta)
Matrix-matrix multiplication: this = beta*this + alpha*op(A)*op(B).
void norm1(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
std::string description() const
A simple one-line description of this object.
Teuchos::ArrayRCP< Scalar > get1dViewNonConst()
Nonconst persisting (1-D) view of this multivector&#39;s local values.
void scale(Teuchos::ArrayView< const Scalar > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
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]).
size_t getNumVectors() const
Number of columns in the multivector.
Teuchos::ArrayRCP< Scalar > get1dViewNonConst()
Nonconst persisting (1-D) view of this multivector&#39;s local values.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
void update(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
void reduce()
Sum values of a locally replicated multivector across all processes.
bool isSameSize(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &vec) const
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
void get2dCopy(Teuchos::ArrayView< const Teuchos::ArrayView< Scalar > > ArrayOfPtrs) const
Fill the given array with a copy of this multivector&#39;s local values.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
void doImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
void beginExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
TpetraMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraMultiVectorClass
void scale(const Scalar &alpha)
Scale the current values of a multi-vector, this = alpha*this.
void endExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
void reciprocal(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
void beginImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
virtual ~TpetraMultiVector()
Destructor (virtual for memory safety of derived classes).
Teuchos::ArrayRCP< const Scalar > get1dView() const
Const persisting (1-D) view of this multivector&#39;s local values.
bool isSameSize(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &vec) const
Teuchos::ArrayRCP< Scalar > getDataNonConst(size_t j)
View of the local values in a particular vector of this multivector.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
size_t global_size_t
Global size_t object.
TpetraMultiVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Basic constuctor.
void update(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, const Scalar &gamma)
Update multi-vector with scaled values of A and B, this = gamma*this + alpha*A + beta*B.
void doExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
void abs(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise absolute values of input Multi-vector in target: A = abs(this).
TpetraMultiVector(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Teuchos::DataAccess copyOrView)
Copy constructor (performs a deep copy).
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
void doImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
virtual dual_view_type::t_dev_const_um getDeviceLocalView(Access::ReadOnlyStruct) const
void get1dCopy(Teuchos::ArrayView< Scalar > A, size_t LDA) const
Fill the given array with a copy of this multivector&#39;s local values.
void get1dCopy(Teuchos::ArrayView< Scalar > A, size_t LDA) const
Fill the given array with a copy of this multivector&#39;s local values.
void reciprocal(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
global_size_t getGlobalLength() const
Global number of rows in the multivector.
virtual ~TpetraMultiVector()
Destructor (virtual for memory safety of derived classes).
constexpr struct OverwriteAllStruct OverwriteAll
void norm2(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_MultiVector() const
Get the underlying Tpetra multivector.
Teuchos::ArrayRCP< Teuchos::ArrayRCP< const Scalar > > get2dView() const
Return const persisting pointers to values.
TpetraMultiVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const Teuchos::ArrayView< const Teuchos::ArrayView< const Scalar > > &ArrayOfPtrs, size_t NumVectors)
Create multivector by copying array of views of local data.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
void putScalar(const Scalar &value)
Set all values in the multivector with the given value.
bool isSameSize(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &vec) const
size_t getLocalLength() const
Local number of rows on the calling process.
void scale(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Replace multi-vector values with scaled values of A, this = alpha*A.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
TpetraMultiVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const Teuchos::ArrayView< const Scalar > &A, size_t LDA, size_t NumVectors)
Create multivector by copying two-dimensional array of local data.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
TpetraMultiVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const Teuchos::ArrayView< const Scalar > &A, size_t LDA, size_t NumVectors)
Create multivector by copying two-dimensional array of local data.
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...
void endExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
void normInf(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
void endImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
void scale(Teuchos::ArrayView< const Scalar > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
Teuchos::ArrayRCP< const Scalar > get1dView() const
Const persisting (1-D) view of this multivector&#39;s local values.
void doExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export data into this object using an Import object (&quot;reverse mode&quot;).
CombineMode
Xpetra::Combine Mode enumerable type.
void doImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_MultiVector() const
Get the underlying Tpetra multivector.
void beginExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
constexpr struct ReadWriteStruct ReadWrite
#define XPETRA_MONITOR(funcName)
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...
global_size_t getGlobalLength() const
Global number of rows in the multivector.
void beginExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with the given verbosity level to a FancyOStream.
void abs(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise absolute values of input Multi-vector in target: A = abs(this).
void randomize(bool bUseXpetraImplementation=false)
Set multi-vector values to random numbers.
void endExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
void norm1(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
virtual dual_view_type::t_host_const_um getHostLocalView(Access::ReadOnlyStruct) const
void endImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
void randomize(bool bUseXpetraImplementation=false)
Set multi-vector values to random numbers.
Teuchos::ArrayRCP< const Scalar > getData(size_t j) const
Const view of the local values in a particular vector of this multivector.
void update(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
global_size_t getGlobalLength() const
Global number of rows in the multivector.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with the given verbosity level to a FancyOStream.
void replaceMap(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)