Xpetra_EpetraIntVector.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // Xpetra: A linear algebra interface package
6 // Copyright 2012 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact
39 // Jonathan Hu (jhu@sandia.gov)
40 // Andrey Prokopenko (aprokop@sandia.gov)
41 // Ray Tuminaro (rstumin@sandia.gov)
42 //
43 // ***********************************************************************
44 //
45 // @HEADER
46 #ifndef XPETRA_EPETRAINTVECTOR_HPP
47 #define XPETRA_EPETRAINTVECTOR_HPP
48 
50 
51 #include "Xpetra_ConfigDefs.hpp"
52 #include "Xpetra_MultiVector.hpp"
53 #include "Xpetra_Vector.hpp"
54 #include "Xpetra_Exceptions.hpp"
55 
56 #include "Xpetra_EpetraMap.hpp"
58 #include "Epetra_IntVector.h"
59 
60 namespace Xpetra {
61 
62  // stub implementation for EpetraIntVectorT
63  template<class EpetraGlobalOrdinal, class Node>
64  class EpetraIntVectorT
65  : public Vector<int,int,EpetraGlobalOrdinal, Node>
66  {
67  typedef int Scalar;
68  typedef int LocalOrdinal;
69  typedef EpetraGlobalOrdinal GlobalOrdinal;
70 
71  public:
72 
74 
75 
77  explicit EpetraIntVectorT(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, bool zeroOut=true) { }
78 
81 
83 
85 
86 
88  int dot(const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &a) const { XPETRA_MONITOR("EpetraIntVectorT::dot"); TEUCHOS_TEST_FOR_EXCEPTION(-1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
89 
90 
92  Teuchos::ScalarTraits<int>::magnitudeType norm1() const { XPETRA_MONITOR("EpetraIntVectorT::norm1"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
93 
94 
96  Teuchos::ScalarTraits<int>::magnitudeType norm2() const { XPETRA_MONITOR("EpetraIntVectorT::norm2"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
97 
99  Teuchos::ScalarTraits<int>::magnitudeType normInf() const { XPETRA_MONITOR("EpetraIntVectorT::normInf"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
100 
102  int meanValue() const { XPETRA_MONITOR("EpetraIntVectorT::meanValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
103 
105  int maxValue() const { XPETRA_MONITOR("EpetraIntVectorT::maxValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
106 
107 
109 
111 
112 
114  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
115 
117  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
118 
120  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
121 
123  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
124 
126  void putScalar(const int &value) { }
127 
129  void randomize(bool bUseXpetraImplementation = true) { XPETRA_MONITOR("EpetraIntVectorT::randomize"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::randomize(): Functionnality not available in Epetra"); }
130 
131 
133 
134  void setSeed(unsigned int seed) { XPETRA_MONITOR("EpetraIntVectorT::setSeed"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::setSeed(): Functionnality not available in Epetra"); }
135 
136 
138 
140 
141 
143  Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const {
144  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
145  }
146 
148  Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j) {
149  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
150  }
151 
154  Teuchos::ArrayRCP<const int> getData(size_t j) const { return Teuchos::ArrayRCP<const int>(); }
155 
158  Teuchos::ArrayRCP<int> getDataNonConst(size_t j) { return Teuchos::ArrayRCP<int>(); }
159 
161 
163 
164  void dot(const MultiVector<int,int,GlobalOrdinal,Node> &A, const Teuchos::ArrayView<int> &dots) const { }
166 
169 
172 
174  void scale(const int &alpha) { }
175 
177  void scale (Teuchos::ArrayView< const int > alpha) {
178  XPETRA_MONITOR("EpetraIntVectorT::scale");
179  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
180  }
181 
183  void update(const int &alpha, const MultiVector<int,int,GlobalOrdinal,Node> &A, const int &beta) {
184  XPETRA_MONITOR("EpetraIntVectorT::update");
185 
186  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
187  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
188  }
189 
191  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) {
192  XPETRA_MONITOR("EpetraIntVectorT::update");
193 
194  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
195  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, B, eB, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
196  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
197  }
198 
200  void norm1(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const { XPETRA_MONITOR("EpetraIntVectorT::norm1"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
201 
203  void norm2(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const { XPETRA_MONITOR("EpetraIntVectorT::norm2"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
204 
206  void normInf(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const { XPETRA_MONITOR("EpetraIntVectorT::normInf"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
207 
209  void meanValue(const Teuchos::ArrayView<int> &means) const { XPETRA_MONITOR("EpetraIntVectorT::meanValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
210 
212  void maxValue(const Teuchos::ArrayView<int> &maxs) const { XPETRA_MONITOR("EpetraIntVectorT::maxValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
213 
215  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) { XPETRA_MONITOR("EpetraIntVectorT::multiply"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Not available in Epetra"); }
216 
219  XPETRA_MONITOR("EpetraIntVectorT::elementWiseMultiply");
220  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
221  }
222 
224 
226 
227 
229  void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
230 
232  void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
233 
235  void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
236 
238  void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
239 
241 
243 
244 
246  size_t getNumVectors() const { XPETRA_MONITOR("EpetraIntVectorT::getNumVectors"); return 1; }
247 
248 
250  size_t getLocalLength() const { return 0; }
251 
253  global_size_t getGlobalLength() const { return 0; }
254 
256 
258 
259 
261  std::string description() const {
262  return std::string("");
263  }
264 
266  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const { }
267 
269 
270  RCP< Epetra_IntVector > getEpetra_IntVector() const { return Teuchos::null; }
271 
272  const RCP<const Comm<int> > getComm() const {
273  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO getComm Epetra MultiVector not implemented");
274  }
275 
276  // Implementing DistObject
277  Teuchos::RCP<const Map<int, GlobalOrdinal, Node> > getMap () const {
278  return Teuchos::null;
279  }
280 
282  const Import<int, GlobalOrdinal, Node> &importer, CombineMode CM) { }
283 
285  const Import<int, GlobalOrdinal, Node>& importer, CombineMode CM) { }
286 
288  const Export<int, GlobalOrdinal, Node>& exporter, CombineMode CM) { }
289 
291  const Export<int, GlobalOrdinal, Node>& exporter, CombineMode CM) { }
292 
293  void replaceMap(const RCP<const Map<int, GlobalOrdinal, Node> >& map) {
294  // do nothing
295  }
296 
297 
299 
300 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
302 
303  typename dual_view_type::t_host_um getHostLocalView () const {
304  throw std::runtime_error("EpetraIntVector does not support device views! Must be implemented extra...");
305  typename dual_view_type::t_host_um ret;
306  return ret;
307  }
308 
309  typename dual_view_type::t_dev_um getDeviceLocalView() const {
310  throw std::runtime_error("Epetra does not support device views!");
311  typename dual_view_type::t_dev_um ret;
312  return ret; // make compiler happy
313  }
314 
325  template<class TargetDeviceType>
326  typename Kokkos::Impl::if_c<
327  Kokkos::Impl::is_same<
328  typename dual_view_type::t_dev_um::execution_space::memory_space,
329  typename TargetDeviceType::memory_space>::value,
330  typename dual_view_type::t_dev_um,
331  typename dual_view_type::t_host_um>::type
332  getLocalView () const {
333  return this->MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
334  }
335 #endif
336 
338 
339  protected:
342  virtual void
344  { }
345 
346 
347  private:
349  //RCP< Epetra_IntVector > vec_;
350 
351  }; // class EpetraIntVectorT
352 
353  // specialization on GO=int and Node=Serial
354 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
355  template<>
357  : public virtual Vector<int,int,int,EpetraNode>
358  {
359  typedef int Scalar;
360  typedef int LocalOrdinal;
361  typedef int GlobalOrdinal;
362  typedef EpetraNode Node;
363 
364  public:
365 
367 
368 
370  explicit EpetraIntVectorT(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, bool zeroOut=true)
371  {
372  XPETRA_RCP_DYNAMIC_CAST(const EpetraMapT<GlobalOrdinal XPETRA_COMMA Node>, map, eMap, "Xpetra::EpetraCrsMatrixT constructors only accept Xpetra::EpetraMapT as input arguments.");
373  vec_ = rcp(new Epetra_IntVector(eMap->getEpetra_BlockMap(), zeroOut));
374  }
375 
378 
380 
382 
383 
385  int dot(const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &a) const { XPETRA_MONITOR("EpetraIntVectorT::dot"); TEUCHOS_TEST_FOR_EXCEPTION(-1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
386 
387 
389  Teuchos::ScalarTraits<int>::magnitudeType norm1() const { XPETRA_MONITOR("EpetraIntVectorT::norm1"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
390 
391 
393  Teuchos::ScalarTraits<int>::magnitudeType norm2() const { XPETRA_MONITOR("EpetraIntVectorT::norm2"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
394 
396  Teuchos::ScalarTraits<int>::magnitudeType normInf() const { XPETRA_MONITOR("EpetraIntVectorT::normInf"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
397 
399  int meanValue() const { XPETRA_MONITOR("EpetraIntVectorT::meanValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
400 
402  int maxValue() const { XPETRA_MONITOR("EpetraIntVectorT::maxValue"); return vec_->MaxValue(); }
403 
404 
406 
408 
409 
411  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
412 
414  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
415 
417  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
418 
420  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
421 
423  void putScalar(const int &value) { vec_->PutValue(value); }
424 
426  void randomize(bool bUseXpetraImplementation = true) { XPETRA_MONITOR("EpetraIntVectorT::randomize"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::randomize(): Functionnality not available in Epetra"); }
427 
428 
430 
431  void setSeed(unsigned int seed) { XPETRA_MONITOR("EpetraIntVectorT::setSeed"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::setSeed(): Functionnality not available in Epetra"); }
432 
433 
435 
437 
438 
440  Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const {
441  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
442  }
443 
445  Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j) {
446  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
447  }
448 
451  Teuchos::ArrayRCP<const int> getData(size_t j) const {
452  XPETRA_MONITOR("EpetraIntVectorT::getData");
453 
454  int * data = vec_->Values();
455  int localLength = vec_->MyLength();
456 
457  return ArrayRCP<int>(data, 0, localLength, false); // not ownership
458  }
459 
462  Teuchos::ArrayRCP<int> getDataNonConst(size_t j) {
463  XPETRA_MONITOR("EpetraIntVectorT::getDataNonConst");
464 
465  int * data = vec_->Values();
466  int localLength = vec_->MyLength();
467 
468  return ArrayRCP<int>(data, 0, localLength, false); // not ownership
469  }
470 
472 
474 
475  void dot(const MultiVector<int,int,GlobalOrdinal,Node> &A, const Teuchos::ArrayView<int> &dots) const {
477  XPETRA_MONITOR("EpetraIntVectorT::dot");
478 
479  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
480  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
481  }
482 
485  XPETRA_MONITOR("EpetraIntVectorT::abs");
486 
487  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
488  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
489  }
490 
493  XPETRA_MONITOR("EpetraIntVectorT::reciprocal");
494 
495  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
496  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
497  }
498 
500  void scale(const int &alpha) {
501  XPETRA_MONITOR("EpetraIntVectorT::scale");
502  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
503  }
504 
506  void scale (Teuchos::ArrayView< const int > alpha) {
507  XPETRA_MONITOR("EpetraIntVectorT::scale");
508  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
509  }
510 
512  void update(const int &alpha, const MultiVector<int,int,GlobalOrdinal,Node> &A, const int &beta) {
513  XPETRA_MONITOR("EpetraIntVectorT::update");
514 
515  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
516  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
517  }
518 
520  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) {
521  XPETRA_MONITOR("EpetraIntVectorT::update");
522 
523  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
524  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, B, eB, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
525  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
526  }
527 
529  void norm1(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const { XPETRA_MONITOR("EpetraIntVectorT::norm1"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
530 
532  void norm2(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const { XPETRA_MONITOR("EpetraIntVectorT::norm2"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
533 
535  void normInf(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const { XPETRA_MONITOR("EpetraIntVectorT::normInf"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
536 
538  void meanValue(const Teuchos::ArrayView<int> &means) const { XPETRA_MONITOR("EpetraIntVectorT::meanValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
539 
541  void maxValue(const Teuchos::ArrayView<int> &maxs) const { XPETRA_MONITOR("EpetraIntVectorT::maxValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
542 
544  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) { XPETRA_MONITOR("EpetraIntVectorT::multiply"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Not available in Epetra"); }
545 
548  XPETRA_MONITOR("EpetraIntVectorT::elementWiseMultiply");
549  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
550  }
551 
553 
555 
556 
558  void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
559 
561  void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
562 
564  void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
565 
567  void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
568 
570 
572 
573 
575  size_t getNumVectors() const { XPETRA_MONITOR("EpetraIntVectorT::getNumVectors"); return 1; }
576 
577 
579  size_t getLocalLength() const { return vec_->MyLength(); }
580 
582  global_size_t getGlobalLength() const { return vec_->GlobalLength64(); }
583 
585 
587 
588 
590  std::string description() const {
591  XPETRA_MONITOR("EpetraIntVectorT::description");
592 
593  // This implementation come from Epetra_Vector_def.hpp (without modification)
594  std::ostringstream oss;
595  oss << Teuchos::Describable::description();
596  oss << "{length="<<this->getGlobalLength()
597  << "}";
598  return oss.str();
599  }
600 
602  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const {
603  XPETRA_MONITOR("EpetraIntVectorT::describe");
604 
605  // This implementation come from Tpetra_Vector_def.hpp (without modification) // JG: true?
606  using std::endl;
607  using std::setw;
608  using Teuchos::VERB_DEFAULT;
609  using Teuchos::VERB_NONE;
610  using Teuchos::VERB_LOW;
611  using Teuchos::VERB_MEDIUM;
612  using Teuchos::VERB_HIGH;
613  using Teuchos::VERB_EXTREME;
614 
615  if (verbLevel > Teuchos::VERB_NONE)
616  vec_->Print(out);
617  }
618 
620 
621  RCP< Epetra_IntVector > getEpetra_IntVector() const { return vec_; }
622 
623  const RCP<const Comm<int> > getComm() const {
624  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO getComm Epetra MultiVector not implemented");
625  }
626 
627  // Implementing DistObject
628  Teuchos::RCP<const Map<int, GlobalOrdinal, Node> > getMap () const {
629  RCP<const Epetra_BlockMap> map = rcp(new Epetra_BlockMap(vec_->Map()));
630  return rcp (new Xpetra::EpetraMapT<GlobalOrdinal, Node>(map));
631  }
632 
634  const Import<int, GlobalOrdinal, Node> &importer, CombineMode CM) {
635  XPETRA_MONITOR("EpetraIntVectorT::doImport");
636 
637  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
638  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
639 
640  const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
641  int err = vec_->Import(v, *tImporter.getEpetra_Import(), toEpetra(CM));
642  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
643  }
644 
646  const Import<int, GlobalOrdinal, Node>& importer, CombineMode CM) {
647  XPETRA_MONITOR("EpetraIntVectorT::doExport");
648 
649  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
650  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
651 
652  const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
653  int err = vec_->Import(v, *tImporter.getEpetra_Import(), toEpetra(CM));
654  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
655  }
656 
658  const Export<int, GlobalOrdinal, Node>& exporter, CombineMode CM) {
659  XPETRA_MONITOR("EpetraIntVectorT::doImport");
660 
661  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
662  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
663 
664  const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
665  int err = vec_->Import(v, *tExporter.getEpetra_Export(), toEpetra(CM));
666  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
667  }
668 
670  const Export<int, GlobalOrdinal, Node>& exporter, CombineMode CM) {
671  XPETRA_MONITOR("EpetraIntVectorT::doExport");
672 
673  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
674  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
675 
676  const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
677  int err = vec_->Export(v, *tExporter.getEpetra_Export(), toEpetra(CM));
678  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
679  }
680 
681  void replaceMap(const RCP<const Map<int, GlobalOrdinal, Node> >& map) {
682  // do nothing
683  }
684 
685 
687 
688  #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
690 
691  typename dual_view_type::t_host_um getHostLocalView () const {
692  typedef Kokkos::View< typename dual_view_type::t_host::data_type ,
693  Kokkos::LayoutLeft,
694  typename dual_view_type::t_host::device_type ,
695  Kokkos::MemoryUnmanaged> epetra_view_type;
696 
697  // access Epetra vector data
698  int* data = NULL;
699  vec_->ExtractView(&data);
700  int localLength = vec_->MyLength();
701 
702  // create view
703  epetra_view_type test = epetra_view_type(data, localLength,1);
704  typename dual_view_type::t_host_um ret = subview(test, Kokkos::ALL(), Kokkos::ALL());
705 
706  return ret;
707  }
708 
709  typename dual_view_type::t_dev_um getDeviceLocalView() const {
710  throw std::runtime_error("Epetra does not support device views!");
711  typename dual_view_type::t_dev_um ret;
712  return ret; // make compiler happy
713  }
714 
725  template<class TargetDeviceType>
726  typename Kokkos::Impl::if_c<
727  Kokkos::Impl::is_same<
728  typename dual_view_type::t_dev_um::execution_space::memory_space,
729  typename TargetDeviceType::memory_space>::value,
730  typename dual_view_type::t_dev_um,
731  typename dual_view_type::t_host_um>::type
732  getLocalView () const {
733  return this->MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
734  }
735  #endif
736 
738 
739  protected:
742  virtual void
744  {
745  typedef EpetraIntVectorT<GlobalOrdinal, Node> this_type;
746  const this_type* rhsPtr = dynamic_cast<const this_type*> (&rhs);
747  TEUCHOS_TEST_FOR_EXCEPTION(
748  rhsPtr == NULL, std::invalid_argument, "Xpetra::MultiVector::operator=: "
749  "The left-hand side (LHS) of the assignment has a different type than "
750  "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT "
751  "(which means it wraps an Epetra_IntVector), but the RHS has some "
752  "other type. This probably means that the RHS wraps either an "
753  "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
754  "does not currently implement assignment from a Tpetra object to an "
755  "Epetra object, though this could be added with sufficient interest.");
756 
757  RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector ();
758  RCP<Epetra_IntVector> lhsImpl = this->getEpetra_IntVector ();
759 
760  TEUCHOS_TEST_FOR_EXCEPTION(
761  rhsImpl.is_null (), std::logic_error, "Xpetra::MultiVector::operator= "
762  "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of "
763  "the assignment) has a null RCP<Epetra_IntVector> inside. Please "
764  "report this bug to the Xpetra developers.");
765  TEUCHOS_TEST_FOR_EXCEPTION(
766  lhsImpl.is_null (), std::logic_error, "Xpetra::MultiVector::operator= "
767  "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the "
768  "assignment has a null RCP<Epetra_IntVector> inside. Please report "
769  "this bug to the Xpetra developers.");
770 
771  // Epetra_IntVector's assignment operator does a deep copy.
772  *lhsImpl = *rhsImpl;
773  }
774 
775 
776  private:
778  RCP< Epetra_IntVector > vec_;
779  };
780 #endif
781 
782  // specialization on GO=long long and Node=Serial
783 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
784  template<>
785  class EpetraIntVectorT<long long, EpetraNode>
786  : public virtual Vector<int,int,long long,EpetraNode>
787  {
788  typedef int Scalar;
789  typedef int LocalOrdinal;
790  typedef long long GlobalOrdinal;
791  typedef EpetraNode Node;
792 
793  public:
794 
796 
797 
799  explicit EpetraIntVectorT(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, bool zeroOut=true)
800  {
801  XPETRA_RCP_DYNAMIC_CAST(const EpetraMapT<GlobalOrdinal XPETRA_COMMA Node>, map, eMap, "Xpetra::EpetraCrsMatrixT constructors only accept Xpetra::EpetraMapT as input arguments.");
802  vec_ = rcp(new Epetra_IntVector(eMap->getEpetra_BlockMap(), zeroOut));
803  }
804 
807 
809 
811 
812 
814  int dot(const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &a) const { XPETRA_MONITOR("EpetraIntVectorT::dot"); TEUCHOS_TEST_FOR_EXCEPTION(-1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
815 
816 
818  Teuchos::ScalarTraits<int>::magnitudeType norm1() const { XPETRA_MONITOR("EpetraIntVectorT::norm1"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
819 
820 
822  Teuchos::ScalarTraits<int>::magnitudeType norm2() const { XPETRA_MONITOR("EpetraIntVectorT::norm2"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
823 
825  Teuchos::ScalarTraits<int>::magnitudeType normInf() const { XPETRA_MONITOR("EpetraIntVectorT::normInf"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
826 
828  int meanValue() const { XPETRA_MONITOR("EpetraIntVectorT::meanValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
829 
831  int maxValue() const { XPETRA_MONITOR("EpetraIntVectorT::maxValue"); return Teuchos::as<int>(vec_->MaxValue()); }
832 
834 
836 
837 
839  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
840 
842  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
843 
845  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
846 
848  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
849 
851  void putScalar(const int &value) { vec_->PutValue(value); }
852 
854  void randomize(bool bUseXpetraImplementation = true) { XPETRA_MONITOR("EpetraIntVectorT::randomize"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::randomize(): Functionnality not available in Epetra"); }
855 
856 
858 
859  void setSeed(unsigned int seed) { XPETRA_MONITOR("EpetraIntVectorT::setSeed"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra::EpetraIntVectorT::setSeed(): Functionnality not available in Epetra"); }
860 
861 
863 
865 
866 
868  Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const {
869  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
870  }
871 
873  Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j) {
874  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
875  }
876 
879  Teuchos::ArrayRCP<const int> getData(size_t j) const {
880  XPETRA_MONITOR("EpetraIntVectorT::getData");
881 
882  int * data = vec_->Values();
883  int localLength = vec_->MyLength();
884 
885  return ArrayRCP<int>(data, 0, localLength, false); // not ownership
886  }
887 
890  Teuchos::ArrayRCP<int> getDataNonConst(size_t j) {
891  XPETRA_MONITOR("EpetraIntVectorT::getDataNonConst");
892 
893  int * data = vec_->Values();
894  int localLength = vec_->MyLength();
895 
896  return ArrayRCP<int>(data, 0, localLength, false); // not ownership
897  }
898 
900 
902 
903  void dot(const MultiVector<int,int,GlobalOrdinal,Node> &A, const Teuchos::ArrayView<int> &dots) const {
905  XPETRA_MONITOR("EpetraIntVectorT::dot");
906 
907  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
908  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
909  }
910 
913  XPETRA_MONITOR("EpetraIntVectorT::abs");
914 
915  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
916  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
917  }
918 
921  XPETRA_MONITOR("EpetraIntVectorT::reciprocal");
922 
923  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
924  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
925  }
926 
928  void scale(const int &alpha) {
929  XPETRA_MONITOR("EpetraIntVectorT::scale");
930  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
931  }
932 
934  void scale (Teuchos::ArrayView< const int > alpha) {
935  XPETRA_MONITOR("EpetraIntVectorT::scale");
936  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
937  }
938 
940  void update(const int &alpha, const MultiVector<int,int,GlobalOrdinal,Node> &A, const int &beta) {
941  XPETRA_MONITOR("EpetraIntVectorT::update");
942 
943  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
944  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
945  }
946 
948  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) {
949  XPETRA_MONITOR("EpetraIntVectorT::update");
950 
951  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
952  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, B, eB, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
953  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO");
954  }
955 
957  void norm1(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const { XPETRA_MONITOR("EpetraIntVectorT::norm1"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
958 
960  void norm2(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const { XPETRA_MONITOR("EpetraIntVectorT::norm2"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
961 
963  void normInf(const Teuchos::ArrayView<Teuchos::ScalarTraits<int>::magnitudeType> &norms) const { XPETRA_MONITOR("EpetraIntVectorT::normInf"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
964 
966  void meanValue(const Teuchos::ArrayView<int> &means) const { XPETRA_MONITOR("EpetraIntVectorT::meanValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
967 
969  void maxValue(const Teuchos::ArrayView<int> &maxs) const { XPETRA_MONITOR("EpetraIntVectorT::maxValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
970 
972  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) { XPETRA_MONITOR("EpetraIntVectorT::multiply"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Not available in Epetra"); }
973 
976  XPETRA_MONITOR("EpetraIntVectorT::elementWiseMultiply");
977  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
978  }
979 
981 
983 
984 
986  void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
987 
989  void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
990 
992  void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
993 
995  void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
996 
998 
1000 
1001 
1003  size_t getNumVectors() const { XPETRA_MONITOR("EpetraIntVectorT::getNumVectors"); return 1; }
1004 
1005 
1007  size_t getLocalLength() const { return vec_->MyLength(); }
1008 
1010  global_size_t getGlobalLength() const { return vec_->GlobalLength64(); }
1011 
1013 
1015 
1016 
1018  std::string description() const {
1019  XPETRA_MONITOR("EpetraIntVectorT::description");
1020 
1021  // This implementation come from Epetra_Vector_def.hpp (without modification)
1022  std::ostringstream oss;
1023  oss << Teuchos::Describable::description();
1024  oss << "{length="<<this->getGlobalLength()
1025  << "}";
1026  return oss.str();
1027  }
1028 
1030  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const {
1031  XPETRA_MONITOR("EpetraIntVectorT::describe");
1032 
1033  // This implementation come from Tpetra_Vector_def.hpp (without modification) // JG: true?
1034  using std::endl;
1035  using std::setw;
1036  using Teuchos::VERB_DEFAULT;
1037  using Teuchos::VERB_NONE;
1038  using Teuchos::VERB_LOW;
1039  using Teuchos::VERB_MEDIUM;
1040  using Teuchos::VERB_HIGH;
1041  using Teuchos::VERB_EXTREME;
1042 
1043  if (verbLevel > Teuchos::VERB_NONE)
1044  vec_->Print(out);
1045  }
1046 
1048 
1049  RCP< Epetra_IntVector > getEpetra_IntVector() const { return vec_; }
1050 
1051  const RCP<const Comm<int> > getComm() const {
1052  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO getComm Epetra MultiVector not implemented");
1053  }
1054 
1055  // Implementing DistObject
1056  Teuchos::RCP<const Map<int, GlobalOrdinal, Node> > getMap () const {
1057  RCP<const Epetra_BlockMap> map = rcp(new Epetra_BlockMap(vec_->Map()));
1058  return rcp (new Xpetra::EpetraMapT<GlobalOrdinal, Node>(map));
1059  }
1060 
1062  const Import<int, GlobalOrdinal, Node> &importer, CombineMode CM) {
1063  XPETRA_MONITOR("EpetraIntVectorT::doImport");
1064 
1065  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1066  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1067 
1068  const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
1069  int err = vec_->Import(v, *tImporter.getEpetra_Import(), toEpetra(CM));
1070  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1071  }
1072 
1074  const Import<int, GlobalOrdinal, Node>& importer, CombineMode CM) {
1075  XPETRA_MONITOR("EpetraIntVectorT::doExport");
1076 
1077  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1078  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1079 
1080  const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
1081  int err = vec_->Import(v, *tImporter.getEpetra_Import(), toEpetra(CM));
1082  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1083  }
1084 
1086  const Export<int, GlobalOrdinal, Node>& exporter, CombineMode CM) {
1087  XPETRA_MONITOR("EpetraIntVectorT::doImport");
1088 
1089  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1090  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1091 
1092  const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
1093  int err = vec_->Import(v, *tExporter.getEpetra_Export(), toEpetra(CM));
1094  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1095  }
1096 
1098  const Export<int, GlobalOrdinal, Node>& exporter, CombineMode CM) {
1099  XPETRA_MONITOR("EpetraIntVectorT::doExport");
1100 
1101  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1102  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1103 
1104  const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
1105  int err = vec_->Export(v, *tExporter.getEpetra_Export(), toEpetra(CM));
1106  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1107  }
1108 
1109  void replaceMap(const RCP<const Map<int, GlobalOrdinal, Node> >& map) {
1110  // do nothing
1111  }
1112 
1113 
1115 
1116  #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
1118 
1119  typename dual_view_type::t_host_um getHostLocalView () const {
1120  typedef Kokkos::View< typename dual_view_type::t_host::data_type ,
1121  Kokkos::LayoutLeft,
1122  typename dual_view_type::t_host::device_type ,
1123  Kokkos::MemoryUnmanaged> epetra_view_type;
1124 
1125  // access Epetra vector data
1126  int* data = NULL;
1127  vec_->ExtractView(&data);
1128  int localLength = vec_->MyLength();
1129 
1130  // create view
1131  epetra_view_type test = epetra_view_type(data, localLength, 1);
1132  typename dual_view_type::t_host_um ret = subview(test, Kokkos::ALL(), Kokkos::ALL());
1133 
1134  return ret;
1135  }
1136 
1137  typename dual_view_type::t_dev_um getDeviceLocalView() const {
1138  throw std::runtime_error("Epetra does not support device views!");
1139  typename dual_view_type::t_dev_um ret;
1140  return ret; // make compiler happy
1141  }
1142 
1153  template<class TargetDeviceType>
1154  typename Kokkos::Impl::if_c<
1155  Kokkos::Impl::is_same<
1156  typename dual_view_type::t_dev_um::execution_space::memory_space,
1157  typename TargetDeviceType::memory_space>::value,
1158  typename dual_view_type::t_dev_um,
1159  typename dual_view_type::t_host_um>::type
1160  getLocalView () const {
1161  return this->MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
1162  }
1163  #endif
1164 
1166 
1167  protected:
1170  virtual void
1172  {
1173  typedef EpetraIntVectorT<GlobalOrdinal, Node> this_type;
1174  const this_type* rhsPtr = dynamic_cast<const this_type*> (&rhs);
1175  TEUCHOS_TEST_FOR_EXCEPTION(
1176  rhsPtr == NULL, std::invalid_argument, "Xpetra::MultiVector::operator=: "
1177  "The left-hand side (LHS) of the assignment has a different type than "
1178  "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT "
1179  "(which means it wraps an Epetra_IntVector), but the RHS has some "
1180  "other type. This probably means that the RHS wraps either an "
1181  "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
1182  "does not currently implement assignment from a Tpetra object to an "
1183  "Epetra object, though this could be added with sufficient interest.");
1184 
1185  RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector ();
1186  RCP<Epetra_IntVector> lhsImpl = this->getEpetra_IntVector ();
1187 
1188  TEUCHOS_TEST_FOR_EXCEPTION(
1189  rhsImpl.is_null (), std::logic_error, "Xpetra::MultiVector::operator= "
1190  "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of "
1191  "the assignment) has a null RCP<Epetra_IntVector> inside. Please "
1192  "report this bug to the Xpetra developers.");
1193  TEUCHOS_TEST_FOR_EXCEPTION(
1194  lhsImpl.is_null (), std::logic_error, "Xpetra::MultiVector::operator= "
1195  "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the "
1196  "assignment has a null RCP<Epetra_IntVector> inside. Please report "
1197  "this bug to the Xpetra developers.");
1198 
1199  // Epetra_IntVector's assignment operator does a deep copy.
1200  *lhsImpl = *rhsImpl;
1201  }
1202 
1203 
1204  private:
1206  RCP< Epetra_IntVector > vec_;
1207  };
1208 #endif
1209 
1210 
1211 } // namespace Xpetra
1212 
1213 #endif // XPETRA_EPETRAINTVECTOR_HPP
RCP< Epetra_IntVector > getEpetra_IntVector() const
RCP< Epetra_IntVector > getEpetra_IntVector() const
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
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.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
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::ArrayRCP< int > getDataNonConst(size_t j)
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
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).
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
void setSeed(unsigned int seed)
Set seed for Random function.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
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.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
Teuchos::ArrayRCP< const int > getData(size_t j) const
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.
void scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
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 meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
void setSeed(unsigned int seed)
Set seed for Random function.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
Xpetra namespace
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
RCP< Epetra_IntVector > vec_
The Epetra_IntVector which this class wraps.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
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 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.
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
int meanValue() const
Compute mean (average) value of this Vector.
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
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.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-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 sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
int maxValue() const
Compute max value of this Vector.
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.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void scale(Teuchos::ArrayView< const int > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
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).
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this 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.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
void setSeed(unsigned int seed)
Set seed for Random function.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
Teuchos::ArrayRCP< const int > getData(size_t j) const
void meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
std::string description() const
Return a simple one-line description of this object.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
std::string description() const
Return a simple one-line description of this object.
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
int meanValue() const
Compute mean (average) value of this Vector.
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
const RCP< const Comm< int > > getComm() const
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
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 norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void scale(Teuchos::ArrayView< const int > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
Exception throws when you call an unimplemented method of Xpetra.
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
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 scale(Teuchos::ArrayView< const int > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
void scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
size_t global_size_t
Global size_t object.
void abs(const MultiVector< int, int, GlobalOrdinal, Node > &A)
Puts element-wise absolute values of input Multi-vector in target: A = abs(this)
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
int meanValue() const
Compute mean (average) value of this Vector.
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.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
int maxValue() const
Compute max value of this Vector.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void scale(const int &alpha)
Scale the current values of a multi-vector, this = alpha*this.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max 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.
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 replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
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 replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
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 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, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
RCP< Epetra_IntVector > vec_
The Epetra_IntVector which this class wraps.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
CombineMode
Xpetra::Combine Mode enumerable type.
#define XPETRA_MONITOR(funcName)
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the 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.
Teuchos::ArrayRCP< const int > getData(size_t j) const
void meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
int maxValue() const
Compute max value of this Vector.
EpetraIntVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
std::string description() const
Return a simple one-line description of this object.
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 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::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
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.
const RCP< const Comm< int > > getComm() const
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.