Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_EpetraIntVector.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_EPETRAINTVECTOR_HPP
11 #define XPETRA_EPETRAINTVECTOR_HPP
12 
14 
15 #include "Xpetra_ConfigDefs.hpp"
16 #include "Xpetra_MultiVector.hpp"
17 #include "Xpetra_Vector.hpp"
18 #include "Xpetra_Exceptions.hpp"
19 
20 #include "Xpetra_EpetraMap.hpp"
22 #include "Epetra_IntVector.h"
23 
24 #if defined(XPETRA_ENABLE_DEPRECATED_CODE)
25 #ifdef __GNUC__
26 #if defined(Xpetra_SHOW_DEPRECATED_WARNINGS)
27 #warning "The header file Trilinos/packages/xpetra/src/Vector/Xpetra_EpetraIntVector.hpp is deprecated."
28 #endif
29 #endif
30 #else
31 #error "The header file Trilinos/packages/xpetra/src/Vector/Xpetra_EpetraIntVector.hpp is deprecated."
32 #endif
33 
34 namespace Xpetra {
35 
36 // TODO: move that elsewhere
37 template <class GlobalOrdinal, class Node>
38 XPETRA_DEPRECATED Epetra_IntVector &toEpetra(Vector<int, int, GlobalOrdinal, Node> &);
39 
40 template <class GlobalOrdinal, class Node>
41 const XPETRA_DEPRECATED Epetra_IntVector &toEpetra(const Vector<int, int, GlobalOrdinal, Node> &);
42 //
43 
44 // stub implementation for EpetraIntVectorT
45 template <class EpetraGlobalOrdinal, class Node>
46 class XPETRA_DEPRECATED EpetraIntVectorT
47  : public Vector<int, int, EpetraGlobalOrdinal, Node> {
48  typedef int Scalar;
49  typedef int LocalOrdinal;
50  typedef EpetraGlobalOrdinal GlobalOrdinal;
51 
52  public:
54 
55 
57  explicit EpetraIntVectorT(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, bool zeroOut = true) {}
58 
61 
63 
65 
66 
69  XPETRA_MONITOR("EpetraIntVectorT::dot");
70  TEUCHOS_TEST_FOR_EXCEPTION(-1, Xpetra::Exceptions::NotImplemented, "TODO");
71  TEUCHOS_UNREACHABLE_RETURN(-1);
72  }
73 
75  Teuchos::ScalarTraits<int>::magnitudeType norm1() const {
76  XPETRA_MONITOR("EpetraIntVectorT::norm1");
77  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
78  TEUCHOS_UNREACHABLE_RETURN(-1);
79  }
80 
82  Teuchos::ScalarTraits<int>::magnitudeType norm2() const {
83  XPETRA_MONITOR("EpetraIntVectorT::norm2");
84  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
85  TEUCHOS_UNREACHABLE_RETURN(-1);
86  }
87 
89  Teuchos::ScalarTraits<int>::magnitudeType normInf() const {
90  XPETRA_MONITOR("EpetraIntVectorT::normInf");
91  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
92  TEUCHOS_UNREACHABLE_RETURN(-1);
93  }
94 
96  int meanValue() const {
97  XPETRA_MONITOR("EpetraIntVectorT::meanValue");
98  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
99  TEUCHOS_UNREACHABLE_RETURN(-1);
100  }
101 
103  int maxValue() const {
104  XPETRA_MONITOR("EpetraIntVectorT::maxValue");
105  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
106  TEUCHOS_UNREACHABLE_RETURN(-1);
107  }
108 
110 
112 
113 
115  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {
116  XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue");
117  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
118  }
119 
121  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) {
122  XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue");
123  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
124  }
125 
127  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) {
128  XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue");
129  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
130  }
131 
133  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) {
134  XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue");
135  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
136  }
137 
139  void putScalar(const int &value) {}
140 
142  void randomize(bool bUseXpetraImplementation = true) {
143  XPETRA_MONITOR("EpetraIntVectorT::randomize");
144  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::randomize(): Functionnality not available in Epetra");
145  }
146 
148  void randomize(const Scalar & /*minVal*/, const Scalar & /*maxVal*/, bool bUseXpetraImplementation = true) {
149  XPETRA_MONITOR("EpetraIntVectorT::randomize");
150  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::randomize(): Functionnality not available in Epetra");
151  }
152 
154 
155  void setSeed(unsigned int seed) {
156  XPETRA_MONITOR("EpetraIntVectorT::setSeed");
157  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::setSeed(): Functionnality not available in Epetra");
158  }
159 
161 
163 
164 
166  Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getVector(size_t j) const {
167  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
168  }
169 
171  Teuchos::RCP<Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getVectorNonConst(size_t j) {
172  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
173  }
174 
177  Teuchos::ArrayRCP<const int> getData(size_t j) const { return Teuchos::ArrayRCP<const int>(); }
178 
181  Teuchos::ArrayRCP<int> getDataNonConst(size_t j) { return Teuchos::ArrayRCP<int>(); }
182 
184 
186 
187  void dot(const MultiVector<int, int, GlobalOrdinal, Node> &A, const Teuchos::ArrayView<int> &dots) const {}
189 
192 
195 
197  void scale(const int &alpha) {}
198 
200  void scale(Teuchos::ArrayView<const int> alpha) {
201  XPETRA_MONITOR("EpetraIntVectorT::scale");
202  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
203  }
204 
206  void update(const int &alpha, const MultiVector<int, int, GlobalOrdinal, Node> &A, const int &beta) {
207  XPETRA_MONITOR("EpetraIntVectorT::update");
208 
209  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
210  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
211  }
212 
214  void update(const int &alpha, const MultiVector<int, int, GlobalOrdinal, Node> &A, const int &beta, const MultiVector<int, int, GlobalOrdinal, Node> &B, const int &gamma) {
215  XPETRA_MONITOR("EpetraIntVectorT::update");
216 
217  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
218  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, B, eB, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
219  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
220  }
221 
223  void norm1(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const {
224  XPETRA_MONITOR("EpetraIntVectorT::norm1");
225  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
226  }
227 
229  void norm2(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const {
230  XPETRA_MONITOR("EpetraIntVectorT::norm2");
231  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
232  }
233 
235  void normInf(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const {
236  XPETRA_MONITOR("EpetraIntVectorT::normInf");
237  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
238  }
239 
241  void meanValue(const Teuchos::ArrayView<int> &means) const {
242  XPETRA_MONITOR("EpetraIntVectorT::meanValue");
243  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
244  }
245 
247  void maxValue(const Teuchos::ArrayView<int> &maxs) const {
248  XPETRA_MONITOR("EpetraIntVectorT::maxValue");
249  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
250  }
251 
253  void multiply(Teuchos::ETransp transA, Teuchos::ETransp transB, const int &alpha, const MultiVector<int, int, GlobalOrdinal, Node> &A, const MultiVector<int, int, GlobalOrdinal, Node> &B, const int &beta) {
254  XPETRA_MONITOR("EpetraIntVectorT::multiply");
255  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Not available in Epetra");
256  }
257 
260  XPETRA_MONITOR("EpetraIntVectorT::elementWiseMultiply");
261  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
262  }
263 
265 
267 
268 
270  void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {
271  XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue");
272  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
273  }
274 
276  void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) {
277  XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue");
278  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
279  }
280 
282  void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {
283  XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue");
284  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
285  }
286 
288  void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) {
289  XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue");
290  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
291  }
292 
294 
296 
297 
299  size_t getNumVectors() const {
300  XPETRA_MONITOR("EpetraIntVectorT::getNumVectors");
301  return 1;
302  }
303 
305  size_t getLocalLength() const { return 0; }
306 
308  global_size_t getGlobalLength() const { return 0; }
309 
312 
314 
316 
317 
319  std::string description() const {
320  return std::string("");
321  }
322 
324  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {}
325 
327 
328  RCP<Epetra_IntVector> getEpetra_IntVector() const { return Teuchos::null; }
329 
330  const RCP<const Comm<int> > getComm() const {
331  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO getComm Epetra MultiVector not implemented");
332  }
333 
334  // Implementing DistObject
335  Teuchos::RCP<const Map<int, GlobalOrdinal, Node> > getMap() const {
336  return Teuchos::null;
337  }
338 
340  const Import<int, GlobalOrdinal, Node> &importer, CombineMode CM) {}
341 
343  const Import<int, GlobalOrdinal, Node> &importer, CombineMode CM) {}
344 
346  const Export<int, GlobalOrdinal, Node> &exporter, CombineMode CM) {}
347 
349  const Export<int, GlobalOrdinal, Node> &exporter, CombineMode CM) {}
350 
351  void replaceMap(const RCP<const Map<int, GlobalOrdinal, Node> > &map) {
352  // do nothing
353  }
354 
355  protected:
358  virtual void
360 
361  private:
363  // RCP< Epetra_IntVector > vec_;
364 
365 }; // class EpetraIntVectorT
366 
367 // specialization on GO=int and Node=Serial
368 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
369 template <>
371  : public virtual Vector<int, int, int, EpetraNode> {
372  typedef int Scalar;
373  typedef int LocalOrdinal;
374  typedef int GlobalOrdinal;
375  typedef EpetraNode Node;
376 
377  public:
379 
380 
382  explicit EpetraIntVectorT(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, bool zeroOut = true) {
383  vec_ = rcp(new Epetra_IntVector(toEpetra<GlobalOrdinal, Node>(map), zeroOut));
384  }
385 
388 
390 
392 
393 
396  XPETRA_MONITOR("EpetraIntVectorT::dot");
397  TEUCHOS_TEST_FOR_EXCEPTION(-1, Xpetra::Exceptions::NotImplemented, "TODO");
398  TEUCHOS_UNREACHABLE_RETURN(-1);
399  }
400 
402  Teuchos::ScalarTraits<int>::magnitudeType norm1() const {
403  XPETRA_MONITOR("EpetraIntVectorT::norm1");
404  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
405  TEUCHOS_UNREACHABLE_RETURN(-1);
406  }
407 
409  Teuchos::ScalarTraits<int>::magnitudeType norm2() const {
410  XPETRA_MONITOR("EpetraIntVectorT::norm2");
411  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
412  TEUCHOS_UNREACHABLE_RETURN(-1);
413  }
414 
416  Teuchos::ScalarTraits<int>::magnitudeType normInf() const {
417  XPETRA_MONITOR("EpetraIntVectorT::normInf");
418  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
419  TEUCHOS_UNREACHABLE_RETURN(-1);
420  }
421 
423  int meanValue() const {
424  XPETRA_MONITOR("EpetraIntVectorT::meanValue");
425  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
426  TEUCHOS_UNREACHABLE_RETURN(-1);
427  }
428 
430  int maxValue() const {
431  XPETRA_MONITOR("EpetraIntVectorT::maxValue");
432  return vec_->MaxValue();
433  }
434 
436 
438 
439 
441  void replaceGlobalValue(GlobalOrdinal /* globalRow */, const Scalar & /* value */) {
442  XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue");
443  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
444  }
445 
447  void sumIntoGlobalValue(GlobalOrdinal /* globalRow */, const Scalar & /* value */) {
448  XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue");
449  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
450  }
451 
453  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) {
454  XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue");
455  (*vec_)[myRow] = value;
456  }
457 
459  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) {
460  XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue");
461  (*vec_)[myRow] += value;
462  }
463 
465  void putScalar(const int &value) { vec_->PutValue(value); }
466 
468  void randomize(bool /* bUseXpetraImplementation */ = true) {
469  XPETRA_MONITOR("EpetraIntVectorT::randomize");
470  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::randomize(): Functionnality not available in Epetra");
471  }
472 
474  void randomize(const Scalar & /*minVal*/, const Scalar & /*maxVal*/, bool /* bUseXpetraImplementation */ = true) {
475  XPETRA_MONITOR("EpetraIntVectorT::randomize");
476  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::randomize(): Functionnality not available in Epetra");
477  }
478 
480 
481  void setSeed(unsigned int /* seed */) {
482  XPETRA_MONITOR("EpetraIntVectorT::setSeed");
483  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::setSeed(): Functionnality not available in Epetra");
484  }
485 
487 
488  typename dual_view_type::t_host_const_um getHostLocalView(Access::ReadOnlyStruct) const override { return getHostLocalView(Access::ReadWrite); }
489 
490  typename dual_view_type::t_dev_const_um getDeviceLocalView(Access::ReadOnlyStruct) const override { return getDeviceLocalView(Access::ReadWrite); }
491 
492  typename dual_view_type::t_host_um getHostLocalView(Access::OverwriteAllStruct) const override { return getHostLocalView(Access::ReadWrite); }
493 
494  typename dual_view_type::t_dev_um getDeviceLocalView(Access::OverwriteAllStruct) const override { return getDeviceLocalView(Access::ReadWrite); }
495 
496  typename dual_view_type::t_host_um getHostLocalView(Access::ReadWriteStruct) const override {
497  typedef Kokkos::View<typename dual_view_type::t_host::data_type,
498  Kokkos::LayoutLeft,
499  typename dual_view_type::t_host::device_type,
500  Kokkos::MemoryUnmanaged>
501  epetra_view_type;
502  // access Epetra vector data
503  Scalar *data = NULL;
504  vec_->ExtractView(&data);
505  int localLength = vec_->MyLength();
506 
507  // create view
508  epetra_view_type test = epetra_view_type(data, localLength, 1);
509  typename dual_view_type::t_host_um ret = subview(test, Kokkos::ALL(), Kokkos::ALL());
510  return ret;
511  }
512 
513  typename dual_view_type::t_dev_um getDeviceLocalView(Access::ReadWriteStruct) const override { return getHostLocalView(Access::ReadWrite); }
514 
516 
518 
519 
521  Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getVector(size_t /* j */) const {
522  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
523  }
524 
526  Teuchos::RCP<Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getVectorNonConst(size_t /* j */) {
527  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
528  }
529 
532  Teuchos::ArrayRCP<const int> getData(size_t /* j */) const {
533  XPETRA_MONITOR("EpetraIntVectorT::getData");
534 
535  int *data = vec_->Values();
536  int localLength = vec_->MyLength();
537 
538  return ArrayRCP<int>(data, 0, localLength, false); // not ownership
539  }
540 
543  Teuchos::ArrayRCP<int> getDataNonConst(size_t /* j */) {
544  XPETRA_MONITOR("EpetraIntVectorT::getDataNonConst");
545 
546  int *data = vec_->Values();
547  int localLength = vec_->MyLength();
548 
549  return ArrayRCP<int>(data, 0, localLength, false); // not ownership
550  }
551 
553 
555 
556  void dot(const MultiVector<int, int, GlobalOrdinal, Node> & /* A */, const Teuchos::ArrayView<int> & /* dots */) const {
558  XPETRA_MONITOR("EpetraIntVectorT::dot");
559 
560  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
561  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
562  }
563 
566  XPETRA_MONITOR("EpetraIntVectorT::abs");
567 
568  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
569  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
570  }
571 
574  XPETRA_MONITOR("EpetraIntVectorT::reciprocal");
575 
576  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
577  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
578  }
579 
581  void scale(const int & /* alpha */) {
582  XPETRA_MONITOR("EpetraIntVectorT::scale");
583  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
584  }
585 
587  void scale(Teuchos::ArrayView<const int> /* alpha */) {
588  XPETRA_MONITOR("EpetraIntVectorT::scale");
589  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
590  }
591 
593  void update(const int & /* alpha */, const MultiVector<int, int, GlobalOrdinal, Node> & /* A */, const int & /* beta */) {
594  XPETRA_MONITOR("EpetraIntVectorT::update");
595 
596  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
597  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
598  }
599 
601  void update(const int & /* alpha */, const MultiVector<int, int, GlobalOrdinal, Node> & /* A */, const int & /* beta */, const MultiVector<int, int, GlobalOrdinal, Node> & /* B */, const int & /* gamma */) {
602  XPETRA_MONITOR("EpetraIntVectorT::update");
603 
604  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
605  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, B, eB, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
606  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
607  }
608 
610  void norm1(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & /* norms */) const {
611  XPETRA_MONITOR("EpetraIntVectorT::norm1");
612  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
613  }
614 
616  void norm2(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & /* norms */) const {
617  XPETRA_MONITOR("EpetraIntVectorT::norm2");
618  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
619  }
620 
622  void normInf(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & /* norms */) const {
623  XPETRA_MONITOR("EpetraIntVectorT::normInf");
624  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
625  }
626 
628  void meanValue(const Teuchos::ArrayView<int> & /* means */) const {
629  XPETRA_MONITOR("EpetraIntVectorT::meanValue");
630  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
631  }
632 
634  void maxValue(const Teuchos::ArrayView<int> & /* maxs */) const {
635  XPETRA_MONITOR("EpetraIntVectorT::maxValue");
636  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
637  }
638 
640  void multiply(Teuchos::ETransp /* transA */, Teuchos::ETransp /* transB */, const int & /* alpha */, const MultiVector<int, int, GlobalOrdinal, Node> & /* A */, const MultiVector<int, int, GlobalOrdinal, Node> & /* B */, const int & /* beta */) {
641  XPETRA_MONITOR("EpetraIntVectorT::multiply");
642  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Not available in Epetra");
643  }
644 
646  void elementWiseMultiply(int /* scalarAB */, const Vector<int, int, GlobalOrdinal, Node> & /* A */, const MultiVector<int, int, GlobalOrdinal, Node> & /* B */, int /* scalarThis */) {
647  XPETRA_MONITOR("EpetraIntVectorT::elementWiseMultiply");
648  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
649  }
650 
652 
654 
655 
657  void replaceGlobalValue(GlobalOrdinal /* globalRow */, size_t /* vectorIndex */, const Scalar & /* value */) {
658  XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue");
659  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
660  }
661 
663  void sumIntoGlobalValue(GlobalOrdinal /* globalRow */, size_t /* vectorIndex */, const Scalar & /* value */) {
664  XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue");
665  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
666  }
667 
669  void replaceLocalValue(LocalOrdinal /* myRow */, size_t /* vectorIndex */, const Scalar & /* value */) {
670  XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue");
671  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
672  }
673 
675  void sumIntoLocalValue(LocalOrdinal /* myRow */, size_t /* vectorIndex */, const Scalar & /* value */) {
676  XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue");
677  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
678  }
679 
681 
683 
684 
686  size_t getNumVectors() const {
687  XPETRA_MONITOR("EpetraIntVectorT::getNumVectors");
688  return 1;
689  }
690 
692  size_t getLocalLength() const { return vec_->MyLength(); }
693 
695  global_size_t getGlobalLength() const { return vec_->GlobalLength64(); }
696 
699  XPETRA_MONITOR("EpetraIntVectorT::isSameSize");
701  if (!asvec) return false;
702  auto vv = toEpetra(*asvec);
703  return ((vec_->MyLength() == vv.MyLength()) && (getNumVectors() == vec.getNumVectors()));
704  }
705 
707 
709 
710 
712  std::string description() const {
713  XPETRA_MONITOR("EpetraIntVectorT::description");
714 
715  // This implementation come from Epetra_Vector_def.hpp (without modification)
716  std::ostringstream oss;
717  oss << Teuchos::Describable::description();
718  oss << "{length=" << this->getGlobalLength()
719  << "}";
720  return oss.str();
721  }
722 
724  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {
725  XPETRA_MONITOR("EpetraIntVectorT::describe");
726 
727  // This implementation come from Tpetra_Vector_def.hpp (without modification) // JG: true?
728  using std::endl;
729  using std::setw;
730  using Teuchos::VERB_DEFAULT;
731  using Teuchos::VERB_EXTREME;
732  using Teuchos::VERB_HIGH;
733  using Teuchos::VERB_LOW;
734  using Teuchos::VERB_MEDIUM;
735  using Teuchos::VERB_NONE;
736 
737  if (verbLevel > Teuchos::VERB_NONE)
738  vec_->Print(out);
739  }
740 
742 
743  RCP<Epetra_IntVector> getEpetra_IntVector() const { return vec_; }
744 
745  const RCP<const Comm<int> > getComm() const {
746  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO getComm Epetra MultiVector not implemented");
747  }
748 
749  // Implementing DistObject
750  Teuchos::RCP<const Map<int, GlobalOrdinal, Node> > getMap() const {
751  RCP<const Epetra_BlockMap> map = rcp(new Epetra_BlockMap(vec_->Map()));
752  return rcp(new Xpetra::EpetraMapT<GlobalOrdinal, Node>(map));
753  }
754 
756  const Import<int, GlobalOrdinal, Node> &importer, CombineMode CM) {
757  XPETRA_MONITOR("EpetraIntVectorT::doImport");
758 
759  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
760  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
761 
762  const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
763  int err = vec_->Import(v, *tImporter.getEpetra_Import(), toEpetra(CM));
764  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
765  }
766 
768  const Import<int, GlobalOrdinal, Node> &importer, CombineMode CM) {
769  XPETRA_MONITOR("EpetraIntVectorT::doExport");
770 
771  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
772  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
773 
774  const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
775  int err = vec_->Import(v, *tImporter.getEpetra_Import(), toEpetra(CM));
776  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
777  }
778 
780  const Export<int, GlobalOrdinal, Node> &exporter, CombineMode CM) {
781  XPETRA_MONITOR("EpetraIntVectorT::doImport");
782 
783  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
784  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
785 
786  const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
787  int err = vec_->Import(v, *tExporter.getEpetra_Export(), toEpetra(CM));
788  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
789  }
790 
792  const Export<int, GlobalOrdinal, Node> &exporter, CombineMode CM) {
793  XPETRA_MONITOR("EpetraIntVectorT::doExport");
794 
795  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
796  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
797 
798  const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
799  int err = vec_->Export(v, *tExporter.getEpetra_Export(), toEpetra(CM));
800  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
801  }
802 
803  void replaceMap(const RCP<const Map<int, GlobalOrdinal, Node> > & /* map */) {
804  // do nothing
805  }
806 
807  protected:
810  virtual void
812  typedef EpetraIntVectorT<GlobalOrdinal, Node> this_type;
813  const this_type *rhsPtr = dynamic_cast<const this_type *>(&rhs);
814  TEUCHOS_TEST_FOR_EXCEPTION(
815  rhsPtr == NULL, std::invalid_argument,
816  "Xpetra::MultiVector::operator=: "
817  "The left-hand side (LHS) of the assignment has a different type than "
818  "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT "
819  "(which means it wraps an Epetra_IntVector), but the RHS has some "
820  "other type. This probably means that the RHS wraps either an "
821  "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
822  "does not currently implement assignment from a Tpetra object to an "
823  "Epetra object, though this could be added with sufficient interest.");
824 
825  RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector();
826  RCP<Epetra_IntVector> lhsImpl = this->getEpetra_IntVector();
827 
828  TEUCHOS_TEST_FOR_EXCEPTION(
829  rhsImpl.is_null(), std::logic_error,
830  "Xpetra::MultiVector::operator= "
831  "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of "
832  "the assignment) has a null RCP<Epetra_IntVector> inside. Please "
833  "report this bug to the Xpetra developers.");
834  TEUCHOS_TEST_FOR_EXCEPTION(
835  lhsImpl.is_null(), std::logic_error,
836  "Xpetra::MultiVector::operator= "
837  "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the "
838  "assignment has a null RCP<Epetra_IntVector> inside. Please report "
839  "this bug to the Xpetra developers.");
840 
841  // Epetra_IntVector's assignment operator does a deep copy.
842  *lhsImpl = *rhsImpl;
843  }
844 
845  private:
847  RCP<Epetra_IntVector> vec_;
848 };
849 #endif
850 
851 // specialization on GO=long long and Node=Serial
852 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
853 template <>
854 class EpetraIntVectorT<long long, EpetraNode>
855  : public virtual Vector<int, int, long long, EpetraNode> {
856  typedef int Scalar;
857  typedef int LocalOrdinal;
858  typedef long long GlobalOrdinal;
859  typedef EpetraNode Node;
860 
861  public:
863 
864 
866  explicit EpetraIntVectorT(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, bool zeroOut = true) {
867  vec_ = rcp(new Epetra_IntVector(toEpetra<GlobalOrdinal, Node>(map), zeroOut));
868  }
869 
872 
874 
876 
877 
880  XPETRA_MONITOR("EpetraIntVectorT::dot");
881  TEUCHOS_TEST_FOR_EXCEPTION(true, Xpetra::Exceptions::NotImplemented, "TODO"); /* return -1; */
882  }
883 
885  Teuchos::ScalarTraits<int>::magnitudeType norm1() const {
886  XPETRA_MONITOR("EpetraIntVectorT::norm1");
887  TEUCHOS_TEST_FOR_EXCEPTION(true, Xpetra::Exceptions::NotImplemented, "TODO"); /* return -1; */
888  }
889 
891  Teuchos::ScalarTraits<int>::magnitudeType norm2() const {
892  XPETRA_MONITOR("EpetraIntVectorT::norm2");
893  TEUCHOS_TEST_FOR_EXCEPTION(true, Xpetra::Exceptions::NotImplemented, "TODO"); /* return -1; */
894  }
895 
897  Teuchos::ScalarTraits<int>::magnitudeType normInf() const {
898  XPETRA_MONITOR("EpetraIntVectorT::normInf");
899  TEUCHOS_TEST_FOR_EXCEPTION(true, Xpetra::Exceptions::NotImplemented, "TODO"); /* return -1; */
900  }
901 
903  int meanValue() const {
904  XPETRA_MONITOR("EpetraIntVectorT::meanValue");
905  TEUCHOS_TEST_FOR_EXCEPTION(true, Xpetra::Exceptions::NotImplemented, "TODO"); /* return -1; */
906  }
907 
909  int maxValue() const {
910  XPETRA_MONITOR("EpetraIntVectorT::maxValue");
911  return Teuchos::as<int>(vec_->MaxValue());
912  }
913 
915 
917 
918 
920  void replaceGlobalValue(GlobalOrdinal /* globalRow */, const Scalar & /* value */) {
921  XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue");
922  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
923  }
924 
926  void sumIntoGlobalValue(GlobalOrdinal /* globalRow */, const Scalar & /* value */) {
927  XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue");
928  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
929  }
930 
932  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) {
933  XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue");
934  (*vec_)[myRow] = value;
935  }
936 
938  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) {
939  XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue");
940  (*vec_)[myRow] += value;
941  }
942 
944  void putScalar(const int &value) { vec_->PutValue(value); }
945 
947  void randomize(bool /* bUseXpetraImplementation */ = true) {
948  XPETRA_MONITOR("EpetraIntVectorT::randomize");
949  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::randomize(): Functionnality not available in Epetra");
950  }
951 
953  void randomize(const Scalar & /*minVal*/, const Scalar & /*maxVal*/, bool /* bUseXpetraImplementation */ = true) {
954  XPETRA_MONITOR("EpetraIntVectorT::randomize");
955  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::randomize(): Functionnality not available in Epetra");
956  }
957 
959 
960  void setSeed(unsigned int /* seed */) {
961  XPETRA_MONITOR("EpetraIntVectorT::setSeed");
962  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::setSeed(): Functionnality not available in Epetra");
963  }
964 
966 
968 
969 
971  Teuchos::RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getVector(size_t /* j */) const {
972  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
973  }
974 
976  Teuchos::RCP<Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getVectorNonConst(size_t /* j */) {
977  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
978  }
979 
982  Teuchos::ArrayRCP<const int> getData(size_t /* j */) const {
983  XPETRA_MONITOR("EpetraIntVectorT::getData");
984 
985  int *data = vec_->Values();
986  int localLength = vec_->MyLength();
987 
988  return ArrayRCP<int>(data, 0, localLength, false); // not ownership
989  }
990 
993  Teuchos::ArrayRCP<int> getDataNonConst(size_t /* j */) {
994  XPETRA_MONITOR("EpetraIntVectorT::getDataNonConst");
995 
996  int *data = vec_->Values();
997  int localLength = vec_->MyLength();
998 
999  return ArrayRCP<int>(data, 0, localLength, false); // not ownership
1000  }
1001 
1003 
1005 
1006  void dot(const MultiVector<int, int, GlobalOrdinal, Node> & /* A */, const Teuchos::ArrayView<int> & /* dots */) const {
1008  XPETRA_MONITOR("EpetraIntVectorT::dot");
1009 
1010  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
1011  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1012  }
1013 
1016  XPETRA_MONITOR("EpetraIntVectorT::abs");
1017 
1018  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
1019  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1020  }
1021 
1024  XPETRA_MONITOR("EpetraIntVectorT::reciprocal");
1025 
1026  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
1027  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1028  }
1029 
1031  void scale(const int & /* alpha */) {
1032  XPETRA_MONITOR("EpetraIntVectorT::scale");
1033  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1034  }
1035 
1037  void scale(Teuchos::ArrayView<const int> /* alpha */) {
1038  XPETRA_MONITOR("EpetraIntVectorT::scale");
1039  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1040  }
1041 
1043  void update(const int & /* alpha */, const MultiVector<int, int, GlobalOrdinal, Node> & /* A */, const int & /* beta */) {
1044  XPETRA_MONITOR("EpetraIntVectorT::update");
1045 
1046  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
1047  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1048  }
1049 
1051  void update(const int & /* alpha */, const MultiVector<int, int, GlobalOrdinal, Node> & /* A */, const int & /* beta */, const MultiVector<int, int, GlobalOrdinal, Node> & /* B */, const int & /* gamma */) {
1052  XPETRA_MONITOR("EpetraIntVectorT::update");
1053 
1054  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
1055  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, B, eB, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
1056  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1057  }
1058 
1060  void norm1(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & /* norms */) const {
1061  XPETRA_MONITOR("EpetraIntVectorT::norm1");
1062  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1063  }
1064 
1066  void norm2(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & /* norms */) const {
1067  XPETRA_MONITOR("EpetraIntVectorT::norm2");
1068  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1069  }
1070 
1072  void normInf(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> & /* norms */) const {
1073  XPETRA_MONITOR("EpetraIntVectorT::normInf");
1074  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1075  }
1076 
1078  void meanValue(const Teuchos::ArrayView<int> & /* means */) const {
1079  XPETRA_MONITOR("EpetraIntVectorT::meanValue");
1080  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1081  }
1082 
1084  void maxValue(const Teuchos::ArrayView<int> & /* maxs */) const {
1085  XPETRA_MONITOR("EpetraIntVectorT::maxValue");
1086  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1087  }
1088 
1090  void multiply(Teuchos::ETransp /* transA */, Teuchos::ETransp /* transB */, const int & /* alpha */, const MultiVector<int, int, GlobalOrdinal, Node> & /* A */, const MultiVector<int, int, GlobalOrdinal, Node> & /* B */, const int & /* beta */) {
1091  XPETRA_MONITOR("EpetraIntVectorT::multiply");
1092  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Not available in Epetra");
1093  }
1094 
1096  void elementWiseMultiply(int /* scalarAB */, const Vector<int, int, GlobalOrdinal, Node> & /* A */, const MultiVector<int, int, GlobalOrdinal, Node> & /* B */, int /* scalarThis */) {
1097  XPETRA_MONITOR("EpetraIntVectorT::elementWiseMultiply");
1098  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
1099  }
1100 
1102 
1104 
1105 
1107  void replaceGlobalValue(GlobalOrdinal /* globalRow */, size_t /* vectorIndex */, const Scalar & /* value */) {
1108  XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue");
1109  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1110  }
1111 
1113  void sumIntoGlobalValue(GlobalOrdinal /* globalRow */, size_t /* vectorIndex */, const Scalar & /* value */) {
1114  XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue");
1115  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1116  }
1117 
1119  void replaceLocalValue(LocalOrdinal /* myRow */, size_t /* vectorIndex */, const Scalar & /* value */) {
1120  XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue");
1121  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1122  }
1123 
1125  void sumIntoLocalValue(LocalOrdinal /* myRow */, size_t /* vectorIndex */, const Scalar & /* value */) {
1126  XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue");
1127  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
1128  }
1129 
1131 
1133 
1134 
1136  size_t getNumVectors() const {
1137  XPETRA_MONITOR("EpetraIntVectorT::getNumVectors");
1138  return 1;
1139  }
1140 
1142  size_t getLocalLength() const { return vec_->MyLength(); }
1143 
1145  global_size_t getGlobalLength() const { return vec_->GlobalLength64(); }
1146 
1149  XPETRA_MONITOR("EpetraIntVectorT::isSameSize");
1151  if (!asvec) return false;
1152  auto vv = toEpetra(*asvec);
1153  return ((vec_->MyLength() == vv.MyLength()) && (getNumVectors() == vec.getNumVectors()));
1154  }
1156 
1158 
1159 
1161  std::string description() const {
1162  XPETRA_MONITOR("EpetraIntVectorT::description");
1163 
1164  // This implementation come from Epetra_Vector_def.hpp (without modification)
1165  std::ostringstream oss;
1166  oss << Teuchos::Describable::description();
1167  oss << "{length=" << this->getGlobalLength()
1168  << "}";
1169  return oss.str();
1170  }
1171 
1173  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {
1174  XPETRA_MONITOR("EpetraIntVectorT::describe");
1175 
1176  // This implementation come from Tpetra_Vector_def.hpp (without modification) // JG: true?
1177  using std::endl;
1178  using std::setw;
1179  using Teuchos::VERB_DEFAULT;
1180  using Teuchos::VERB_EXTREME;
1181  using Teuchos::VERB_HIGH;
1182  using Teuchos::VERB_LOW;
1183  using Teuchos::VERB_MEDIUM;
1184  using Teuchos::VERB_NONE;
1185 
1186  if (verbLevel > Teuchos::VERB_NONE)
1187  vec_->Print(out);
1188  }
1189 
1191 
1192  RCP<Epetra_IntVector> getEpetra_IntVector() const { return vec_; }
1193 
1194  const RCP<const Comm<int> > getComm() const {
1195  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO getComm Epetra MultiVector not implemented");
1196  }
1197 
1198  // Implementing DistObject
1199  Teuchos::RCP<const Map<int, GlobalOrdinal, Node> > getMap() const {
1200  RCP<const Epetra_BlockMap> map = rcp(new Epetra_BlockMap(vec_->Map()));
1201  return rcp(new Xpetra::EpetraMapT<GlobalOrdinal, Node>(map));
1202  }
1203 
1205  const Import<int, GlobalOrdinal, Node> &importer, CombineMode CM) {
1206  XPETRA_MONITOR("EpetraIntVectorT::doImport");
1207 
1208  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1209  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1210 
1211  const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
1212  int err = vec_->Import(v, *tImporter.getEpetra_Import(), toEpetra(CM));
1213  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1214  }
1215 
1217  const Import<int, GlobalOrdinal, Node> &importer, CombineMode CM) {
1218  XPETRA_MONITOR("EpetraIntVectorT::doExport");
1219 
1220  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1221  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1222 
1223  const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
1224  int err = vec_->Import(v, *tImporter.getEpetra_Import(), toEpetra(CM));
1225  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1226  }
1227 
1229  const Export<int, GlobalOrdinal, Node> &exporter, CombineMode CM) {
1230  XPETRA_MONITOR("EpetraIntVectorT::doImport");
1231 
1232  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1233  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1234 
1235  const Epetra_IntVector &v = *tSource.getEpetra_IntVector();
1236  int err = vec_->Import(v, *tExporter.getEpetra_Export(), toEpetra(CM));
1237  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1238  }
1239 
1241  const Export<int, GlobalOrdinal, Node> &exporter, CombineMode CM) {
1242  XPETRA_MONITOR("EpetraIntVectorT::doExport");
1243 
1244  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1245  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1246 
1247  const Epetra_IntVector &v = *tDest.getEpetra_IntVector();
1248  int err = vec_->Export(v, *tExporter.getEpetra_Export(), toEpetra(CM));
1249  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1250  }
1251 
1252  void replaceMap(const RCP<const Map<int, GlobalOrdinal, Node> > & /* map */) {
1253  // do nothing
1254  }
1255 
1256  protected:
1259  virtual void
1261  typedef EpetraIntVectorT<GlobalOrdinal, Node> this_type;
1262  const this_type *rhsPtr = dynamic_cast<const this_type *>(&rhs);
1263  TEUCHOS_TEST_FOR_EXCEPTION(
1264  rhsPtr == NULL, std::invalid_argument,
1265  "Xpetra::MultiVector::operator=: "
1266  "The left-hand side (LHS) of the assignment has a different type than "
1267  "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT "
1268  "(which means it wraps an Epetra_IntVector), but the RHS has some "
1269  "other type. This probably means that the RHS wraps either an "
1270  "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
1271  "does not currently implement assignment from a Tpetra object to an "
1272  "Epetra object, though this could be added with sufficient interest.");
1273 
1274  RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector();
1275  RCP<Epetra_IntVector> lhsImpl = this->getEpetra_IntVector();
1276 
1277  TEUCHOS_TEST_FOR_EXCEPTION(
1278  rhsImpl.is_null(), std::logic_error,
1279  "Xpetra::MultiVector::operator= "
1280  "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of "
1281  "the assignment) has a null RCP<Epetra_IntVector> inside. Please "
1282  "report this bug to the Xpetra developers.");
1283  TEUCHOS_TEST_FOR_EXCEPTION(
1284  lhsImpl.is_null(), std::logic_error,
1285  "Xpetra::MultiVector::operator= "
1286  "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the "
1287  "assignment has a null RCP<Epetra_IntVector> inside. Please report "
1288  "this bug to the Xpetra developers.");
1289 
1290  // Epetra_IntVector's assignment operator does a deep copy.
1291  *lhsImpl = *rhsImpl;
1292  }
1293 
1294  private:
1296  RCP<Epetra_IntVector> vec_;
1297 };
1298 #endif
1299 
1300 } // namespace Xpetra
1301 
1302 #endif // XPETRA_EPETRAINTVECTOR_HPP
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
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.
void replaceGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Replace value, using global (row) index.
std::string description() const
Return a simple one-line description of this object.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &) const
TODO missing comment.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
Teuchos::ArrayRCP< const int > getData(size_t j) const
void scale(Teuchos::ArrayView< const int > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
void meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 2-norm of each vector in multi-vector.
void replaceLocalValue(LocalOrdinal, size_t, const Scalar &)
Replace value, using local (row) index.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
int meanValue() const
Compute mean (average) value of this Vector.
RCP< Epetra_IntVector > getEpetra_IntVector() const
Teuchos::ArrayRCP< const int > getData(size_t) const
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void scale(const int &)
Scale the current values of a multi-vector, this = alpha*this.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void update(const int &alpha, const MultiVector< int, int, GlobalOrdinal, Node > &A, const int &beta, const MultiVector< int, int, GlobalOrdinal, Node > &B, const int &gamma)
Update multi-vector with scaled values of A and B, this = gamma*this + alpha*A + beta*B.
Teuchos::ArrayRCP< int > getDataNonConst(size_t)
void randomize(bool=true)
Set multi-vector values to random numbers.
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
bool isSameSize(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &vec) const
Checks to see if the local length, number of vectors and size of Scalar type match.
void update(const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
const RCP< const Comm< int > > getComm() const
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
bool isSameSize(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &vec) const
Checks to see if the local length, number of vectors and size of Scalar type match.
RCP< Epetra_IntVector > vec_
The Epetra_IntVector which this class wraps.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute Inf-norm of each vector in multi-vector.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
RCP< Epetra_IntVector > vec_
The Epetra_IntVector which this class wraps.
void setSeed(unsigned int)
Set seed for Random function.
void randomize(bool=true)
Set multi-vector values to random numbers.
void replaceLocalValue(LocalOrdinal, size_t, const Scalar &)
Replace value, using local (row) index.
void update(const int &alpha, const MultiVector< int, int, GlobalOrdinal, Node > &A, const int &beta)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
void meanValue(const Teuchos::ArrayView< int > &) const
Compute mean (average) value of each vector in multi-vector.
void elementWiseMultiply(int scalarAB, const Vector< int, int, GlobalOrdinal, Node > &A, const MultiVector< int, int, GlobalOrdinal, Node > &B, int scalarThis)
Element-wise multiply of a Vector A with a EpetraMultiVector B.
int meanValue() const
Compute mean (average) value of this Vector.
dual_view_type::t_host_um getHostLocalView(Access::OverwriteAllStruct) const override
dual_view_type::t_dev_const_um getDeviceLocalView(Access::ReadOnlyStruct) const override
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &)
void sumIntoGlobalValue(GlobalOrdinal, const Scalar &)
Adds specified value to existing value at the specified location.
void update(const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Update multi-vector with scaled values of A and B, this = gamma*this + alpha*A + beta*B.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
int meanValue() const
Compute mean (average) value of this Vector.
dual_view_type::t_host_const_um getHostLocalView(Access::ReadOnlyStruct) const override
void meanValue(const Teuchos::ArrayView< int > &) const
Compute mean (average) value of each vector in multi-vector.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
int maxValue() const
Compute max value of this Vector.
Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::dual_view_type dual_view_type
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
EpetraIntVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
void reciprocal(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
void randomize(const Scalar &, const Scalar &, bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t) const
Return a Vector which is a const view of column j.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void replaceGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Replace value, using global (row) index.
const RCP< const Comm< int > > getComm() const
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void reciprocal(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
std::string description() const
Return a simple one-line description of this object.
void maxValue(const Teuchos::ArrayView< int > &) const
Compute max value of each vector in multi-vector.
void reciprocal(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
void scale(Teuchos::ArrayView< const int >)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
dual_view_type::t_dev_um getDeviceLocalView(Access::ReadWriteStruct) const override
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 1-norm of each vector in multi-vector.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t)
Return a Vector which is a nonconst view of column j.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void scale(Teuchos::ArrayView< const int >)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
dual_view_type::t_host_um getHostLocalView(Access::ReadWriteStruct) const override
Teuchos::ArrayRCP< const int > getData(size_t) const
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void update(const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Update multi-vector with scaled values of A and B, this = gamma*this + alpha*A + beta*B.
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
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 norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 1-norm of each vector in multi-vector.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
Exception throws when you call an unimplemented method of Xpetra.
void randomize(const Scalar &, const Scalar &, bool=true)
Set multi-vector values to random numbers.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &) const
TODO missing comment.
void replaceGlobalValue(GlobalOrdinal, const Scalar &)
Replace current value at the specified location with specified value.
void sumIntoGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Add value to existing value, using global (row) index.
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &)
size_t global_size_t
Global size_t object.
int maxValue() const
Compute max value of this Vector.
void multiply(Teuchos::ETransp transA, Teuchos::ETransp transB, const int &alpha, const MultiVector< int, int, GlobalOrdinal, Node > &A, const MultiVector< int, int, GlobalOrdinal, Node > &B, const int &beta)
Matrix-Matrix multiplication, this = beta*this + alpha*op(A)*op(B).
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
void setSeed(unsigned int)
Set seed for Random function.
void multiply(Teuchos::ETransp, Teuchos::ETransp, const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Matrix-Matrix multiplication, this = beta*this + alpha*op(A)*op(B).
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.
int maxValue() const
Compute max value of this Vector.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
bool isSameSize(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &vec) const
Checks to see if the local length, number of vectors and size of Scalar type match.
void setSeed(unsigned int seed)
Set seed for Random function.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void replaceGlobalValue(GlobalOrdinal, const Scalar &)
Replace current value at the specified location with specified value.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void randomize(const Scalar &, const Scalar &, bool=true)
Set multi-vector values to random numbers.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
dual_view_type::t_dev_um getDeviceLocalView(Access::OverwriteAllStruct) const override
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::dual_view_type dual_view_type
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 sumIntoGlobalValue(GlobalOrdinal, const Scalar &)
Adds specified value to existing value at the specified location.
void elementWiseMultiply(int, const Vector< int, int, GlobalOrdinal, Node > &, const MultiVector< int, int, GlobalOrdinal, Node > &, int)
Element-wise multiply of a Vector A with a EpetraMultiVector B.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
CombineMode
Xpetra::Combine Mode enumerable type.
void sumIntoGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Add value to existing value, using global (row) index.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
void sumIntoLocalValue(LocalOrdinal, size_t, const Scalar &)
Add value to existing value, using local (row) index.
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.
constexpr struct ReadWriteStruct ReadWrite
#define XPETRA_MONITOR(funcName)
virtual dual_view_type::t_host_const_um getHostLocalView(Access::ReadOnlyStruct) const
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
void sumIntoLocalValue(LocalOrdinal, size_t, const Scalar &)
Add value to existing value, using local (row) index.
void elementWiseMultiply(int, const Vector< int, int, GlobalOrdinal, Node > &, const MultiVector< int, int, GlobalOrdinal, Node > &, int)
Element-wise multiply of a Vector A with a EpetraMultiVector B.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
virtual size_t getNumVectors() const =0
Number of columns in the multivector.
void scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
EpetraIntVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
void maxValue(const Teuchos::ArrayView< int > &) const
Compute max value of each vector in multi-vector.
void multiply(Teuchos::ETransp, Teuchos::ETransp, const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Matrix-Matrix multiplication, this = beta*this + alpha*op(A)*op(B).
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute 2-norm of each vector in multi-vector.
EpetraIntVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
void scale(const int &)
Scale the current values of a multi-vector, this = alpha*this.
RCP< Epetra_IntVector > getEpetra_IntVector() const
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &) const
Compute Inf-norm of each vector in multi-vector.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t) const
Return a Vector which is a const view of column j.
void update(const int &, const MultiVector< int, int, GlobalOrdinal, Node > &, const int &)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
std::string description() const
Return a simple one-line description of this object.