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 
89 
90 
93 
94 
97 
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 
145  }
146 
150  }
151 
155 
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 
178  XPETRA_MONITOR("EpetraIntVectorT::scale");
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.");
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.");
197  }
198 
201 
204 
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 
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
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 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 
386 
387 
390 
391 
394 
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"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
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 
442  }
443 
447  }
448 
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 
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.");
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.");
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.");
497  }
498 
500  void scale(const int &alpha) {
501  XPETRA_MONITOR("EpetraIntVectorT::scale");
503  }
504 
507  XPETRA_MONITOR("EpetraIntVectorT::scale");
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.");
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.");
526  }
527 
530 
533 
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;
596  oss << "{length="<<this->getGlobalLength()
597  << "}";
598  return oss.str();
599  }
600 
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 
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
629  RCP<const Epetra_BlockMap> map = rcp(new Epetra_BlockMap(vec_->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 COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
638  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal 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 COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
650  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal 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 COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
662  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal 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 COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
674  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal 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  throw std::runtime_error("EpetraIntVector does not support device views! Must be implemented extra...");
693  typename dual_view_type::t_host_um ret;
694  return ret;
695  }
696 
697  typename dual_view_type::t_dev_um getDeviceLocalView() const {
698  throw std::runtime_error("Epetra does not support device views!");
699  typename dual_view_type::t_dev_um ret;
700  return ret; // make compiler happy
701  }
702 
713  template<class TargetDeviceType>
714  typename Kokkos::Impl::if_c<
715  Kokkos::Impl::is_same<
716  typename dual_view_type::t_dev_um::execution_space::memory_space,
717  typename TargetDeviceType::memory_space>::value,
718  typename dual_view_type::t_dev_um,
719  typename dual_view_type::t_host_um>::type
720  getLocalView () const {
721  return this->MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
722  }
723  #endif
724 
726 
727  protected:
730  virtual void
732  {
733  typedef EpetraIntVectorT<GlobalOrdinal, Node> this_type;
734  const this_type* rhsPtr = dynamic_cast<const this_type*> (&rhs);
736  rhsPtr == NULL, std::invalid_argument, "Xpetra::MultiVector::operator=: "
737  "The left-hand side (LHS) of the assignment has a different type than "
738  "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT "
739  "(which means it wraps an Epetra_IntVector), but the RHS has some "
740  "other type. This probably means that the RHS wraps either an "
741  "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
742  "does not currently implement assignment from a Tpetra object to an "
743  "Epetra object, though this could be added with sufficient interest.");
744 
745  RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector ();
746  RCP<Epetra_IntVector> lhsImpl = this->getEpetra_IntVector ();
747 
749  rhsImpl.is_null (), std::logic_error, "Xpetra::MultiVector::operator= "
750  "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of "
751  "the assignment) has a null RCP<Epetra_IntVector> inside. Please "
752  "report this bug to the Xpetra developers.");
754  lhsImpl.is_null (), std::logic_error, "Xpetra::MultiVector::operator= "
755  "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the "
756  "assignment has a null RCP<Epetra_IntVector> inside. Please report "
757  "this bug to the Xpetra developers.");
758 
759  // Epetra_IntVector's assignment operator does a deep copy.
760  *lhsImpl = *rhsImpl;
761  }
762 
763 
764  private:
767  };
768 #endif
769 
770  // specialization on GO=long long and Node=Serial
771 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
772  template<>
773  class EpetraIntVectorT<long long, EpetraNode>
774  : public virtual Vector<int,int,long long,EpetraNode>
775  {
776  typedef int Scalar;
777  typedef int LocalOrdinal;
778  typedef long long GlobalOrdinal;
779  typedef EpetraNode Node;
780 
781  public:
782 
784 
785 
787  explicit EpetraIntVectorT(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, bool zeroOut=true)
788  {
789  XPETRA_RCP_DYNAMIC_CAST(const EpetraMapT<GlobalOrdinal COMMA Node>, map, eMap, "Xpetra::EpetraCrsMatrixT constructors only accept Xpetra::EpetraMapT as input arguments.");
790  vec_ = rcp(new Epetra_IntVector(eMap->getEpetra_BlockMap(), zeroOut));
791  }
792 
795 
797 
799 
800 
803 
804 
807 
808 
811 
814 
816  int meanValue() const { XPETRA_MONITOR("EpetraIntVectorT::meanValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
817 
819  int maxValue() const { XPETRA_MONITOR("EpetraIntVectorT::maxValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); return -1; }
820 
821 
823 
825 
826 
828  void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
829 
831  void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
832 
834  void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
835 
837  void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
838 
840  void putScalar(const int &value) { vec_->PutValue(value); }
841 
843  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"); }
844 
845 
847 
848  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"); }
849 
850 
852 
854 
855 
859  }
860 
864  }
865 
869  XPETRA_MONITOR("EpetraIntVectorT::getData");
870 
871  int * data = vec_->Values();
872  int localLength = vec_->MyLength();
873 
874  return ArrayRCP<int>(data, 0, localLength, false); // not ownership
875  }
876 
880  XPETRA_MONITOR("EpetraIntVectorT::getDataNonConst");
881 
882  int * data = vec_->Values();
883  int localLength = vec_->MyLength();
884 
885  return ArrayRCP<int>(data, 0, localLength, false); // not ownership
886  }
887 
889 
891 
892  void dot(const MultiVector<int,int,GlobalOrdinal,Node> &A, const Teuchos::ArrayView<int> &dots) const {
894  XPETRA_MONITOR("EpetraIntVectorT::dot");
895 
896  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
898  }
899 
902  XPETRA_MONITOR("EpetraIntVectorT::abs");
903 
904  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
906  }
907 
910  XPETRA_MONITOR("EpetraIntVectorT::reciprocal");
911 
912  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
914  }
915 
917  void scale(const int &alpha) {
918  XPETRA_MONITOR("EpetraIntVectorT::scale");
920  }
921 
924  XPETRA_MONITOR("EpetraIntVectorT::scale");
926  }
927 
929  void update(const int &alpha, const MultiVector<int,int,GlobalOrdinal,Node> &A, const int &beta) {
930  XPETRA_MONITOR("EpetraIntVectorT::update");
931 
932  // XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
934  }
935 
937  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) {
938  XPETRA_MONITOR("EpetraIntVectorT::update");
939 
940  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, A, eA, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
941  //XPETRA_DYNAMIC_CAST(const EpetraMultiVectorT, B, eB, "This Xpetra::EpetraMultiVectorT method only accept Xpetra::EpetraMultiVectorT as input arguments.");
943  }
944 
947 
950 
953 
955  void meanValue(const Teuchos::ArrayView<int> &means) const { XPETRA_MONITOR("EpetraIntVectorT::meanValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
956 
958  void maxValue(const Teuchos::ArrayView<int> &maxs) const { XPETRA_MONITOR("EpetraIntVectorT::maxValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
959 
961  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"); }
962 
965  XPETRA_MONITOR("EpetraIntVectorT::elementWiseMultiply");
966  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "Xpetra_EpetraIntVector: elementWiseMultiply not implemented because Epetra_IntVector does not support this operation");
967  }
968 
970 
972 
973 
975  void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
976 
978  void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoGlobalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
979 
981  void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::replaceLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
982 
984  void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value) { XPETRA_MONITOR("EpetraIntVectorT::sumIntoLocalValue"); TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
985 
987 
989 
990 
992  size_t getNumVectors() const { XPETRA_MONITOR("EpetraIntVectorT::getNumVectors"); return 1; }
993 
994 
996  size_t getLocalLength() const { return vec_->MyLength(); }
997 
999  global_size_t getGlobalLength() const { return vec_->GlobalLength64(); }
1000 
1002 
1004 
1005 
1007  std::string description() const {
1008  XPETRA_MONITOR("EpetraIntVectorT::description");
1009 
1010  // This implementation come from Epetra_Vector_def.hpp (without modification)
1011  std::ostringstream oss;
1013  oss << "{length="<<this->getGlobalLength()
1014  << "}";
1015  return oss.str();
1016  }
1017 
1020  XPETRA_MONITOR("EpetraIntVectorT::describe");
1021 
1022  // This implementation come from Tpetra_Vector_def.hpp (without modification) // JG: true?
1023  using std::endl;
1024  using std::setw;
1025  using Teuchos::VERB_DEFAULT;
1026  using Teuchos::VERB_NONE;
1027  using Teuchos::VERB_LOW;
1028  using Teuchos::VERB_MEDIUM;
1029  using Teuchos::VERB_HIGH;
1030  using Teuchos::VERB_EXTREME;
1031 
1032  if (verbLevel > Teuchos::VERB_NONE)
1033  vec_->Print(out);
1034  }
1035 
1037 
1039 
1040  const RCP<const Comm<int> > getComm() const {
1041  TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO getComm Epetra MultiVector not implemented");
1042  }
1043 
1044  // Implementing DistObject
1046  RCP<const Epetra_BlockMap> map = rcp(new Epetra_BlockMap(vec_->Map()));
1047  return rcp (new Xpetra::EpetraMapT<GlobalOrdinal, Node>(map));
1048  }
1049 
1051  const Import<int, GlobalOrdinal, Node> &importer, CombineMode CM) {
1052  XPETRA_MONITOR("EpetraIntVectorT::doImport");
1053 
1054  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1055  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal COMMA Node>, importer, tImporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1056 
1057  const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
1058  int err = vec_->Import(v, *tImporter.getEpetra_Import(), toEpetra(CM));
1059  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1060  }
1061 
1063  const Import<int, GlobalOrdinal, Node>& importer, CombineMode CM) {
1064  XPETRA_MONITOR("EpetraIntVectorT::doExport");
1065 
1066  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1067  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal COMMA Node>, importer, tImporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1068 
1069  const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
1070  int err = vec_->Import(v, *tImporter.getEpetra_Import(), toEpetra(CM));
1071  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1072  }
1073 
1075  const Export<int, GlobalOrdinal, Node>& exporter, CombineMode CM) {
1076  XPETRA_MONITOR("EpetraIntVectorT::doImport");
1077 
1078  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal COMMA Node>, source, tSource, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1079  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal COMMA Node>, exporter, tExporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1080 
1081  const Epetra_IntVector & v = *tSource.getEpetra_IntVector();
1082  int err = vec_->Import(v, *tExporter.getEpetra_Export(), toEpetra(CM));
1083  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1084  }
1085 
1087  const Export<int, GlobalOrdinal, Node>& exporter, CombineMode CM) {
1088  XPETRA_MONITOR("EpetraIntVectorT::doExport");
1089 
1090  XPETRA_DYNAMIC_CAST(const EpetraIntVectorT<GlobalOrdinal COMMA Node>, dest, tDest, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraIntVectorT as input arguments.");
1091  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal COMMA Node>, exporter, tExporter, "Xpetra::EpetraIntVectorT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1092 
1093  const Epetra_IntVector & v = *tDest.getEpetra_IntVector();
1094  int err = vec_->Export(v, *tExporter.getEpetra_Export(), toEpetra(CM));
1095  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1096  }
1097 
1098  void replaceMap(const RCP<const Map<int, GlobalOrdinal, Node> >& map) {
1099  // do nothing
1100  }
1101 
1102 
1104 
1105  #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
1107 
1108  typename dual_view_type::t_host_um getHostLocalView () const {
1109  throw std::runtime_error("EpetraIntVector does not support device views! Must be implemented extra...");
1110  typename dual_view_type::t_host_um ret;
1111  return ret;
1112  }
1113 
1114  typename dual_view_type::t_dev_um getDeviceLocalView() const {
1115  throw std::runtime_error("Epetra does not support device views!");
1116  typename dual_view_type::t_dev_um ret;
1117  return ret; // make compiler happy
1118  }
1119 
1130  template<class TargetDeviceType>
1131  typename Kokkos::Impl::if_c<
1132  Kokkos::Impl::is_same<
1133  typename dual_view_type::t_dev_um::execution_space::memory_space,
1134  typename TargetDeviceType::memory_space>::value,
1135  typename dual_view_type::t_dev_um,
1136  typename dual_view_type::t_host_um>::type
1137  getLocalView () const {
1138  return this->MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::template getLocalView<TargetDeviceType>();
1139  }
1140  #endif
1141 
1143 
1144  protected:
1147  virtual void
1149  {
1150  typedef EpetraIntVectorT<GlobalOrdinal, Node> this_type;
1151  const this_type* rhsPtr = dynamic_cast<const this_type*> (&rhs);
1153  rhsPtr == NULL, std::invalid_argument, "Xpetra::MultiVector::operator=: "
1154  "The left-hand side (LHS) of the assignment has a different type than "
1155  "the right-hand side (RHS). The LHS has type Xpetra::EpetraIntVectorT "
1156  "(which means it wraps an Epetra_IntVector), but the RHS has some "
1157  "other type. This probably means that the RHS wraps either an "
1158  "Tpetra::MultiVector, or an Epetra_MultiVector. Xpetra::MultiVector "
1159  "does not currently implement assignment from a Tpetra object to an "
1160  "Epetra object, though this could be added with sufficient interest.");
1161 
1162  RCP<const Epetra_IntVector> rhsImpl = rhsPtr->getEpetra_IntVector ();
1163  RCP<Epetra_IntVector> lhsImpl = this->getEpetra_IntVector ();
1164 
1166  rhsImpl.is_null (), std::logic_error, "Xpetra::MultiVector::operator= "
1167  "(in Xpetra::EpetraIntVectorT::assign): *this (the right-hand side of "
1168  "the assignment) has a null RCP<Epetra_IntVector> inside. Please "
1169  "report this bug to the Xpetra developers.");
1171  lhsImpl.is_null (), std::logic_error, "Xpetra::MultiVector::operator= "
1172  "(in Xpetra::EpetraIntVectorT::assign): The left-hand side of the "
1173  "assignment has a null RCP<Epetra_IntVector> inside. Please report "
1174  "this bug to the Xpetra developers.");
1175 
1176  // Epetra_IntVector's assignment operator does a deep copy.
1177  *lhsImpl = *rhsImpl;
1178  }
1179 
1180 
1181  private:
1184  };
1185 #endif
1186 
1187 
1188 } // namespace Xpetra
1189 
1190 #endif // XPETRA_EPETRAINTVECTOR_HPP
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
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.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
void meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
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)
int meanValue() const
Compute mean (average) value of this Vector.
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
void setSeed(unsigned int seed)
Set seed for Random function.
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
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.
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.
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::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-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.
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).
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
void setSeed(unsigned int seed)
Set seed for Random function.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Xpetra namespace
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
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)
Teuchos::ArrayRCP< const int > getData(size_t j) const
Teuchos::ArrayRCP< int > getDataNonConst(size_t j)
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
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 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::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
Teuchos::ScalarTraits< int >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
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.
Teuchos::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
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 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.
int meanValue() const
Compute mean (average) value of this Vector.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
void normInf(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
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.
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).
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::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
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.
void maxValue(const Teuchos::ArrayView< int > &maxs) const
Compute max value of each vector in multi-vector.
void putScalar(const int &value)
Initialize all values in a multi-vector with specified value.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
global_size_t getGlobalLength() const
Returns the global vector length 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.
void randomize(bool bUseXpetraImplementation=true)
Set multi-vector values to random numbers.
Teuchos::ArrayRCP< const int > getData(size_t j) const
void doImport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
int maxValue() const
Compute max value of this Vector.
std::string description() const
Return a simple one-line description of this object.
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
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 replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
virtual std::string description() const
void scale(Teuchos::ArrayView< const int > alpha)
Scale the current values of a multi-vector, this[j] = alpha[j]*this[j].
size_t getNumVectors() const
Returns the number of vectors in the multi-vector.
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 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.
int meanValue() const
Compute mean (average) value of this Vector.
Teuchos::RCP< const Map< int, GlobalOrdinal, Node > > getMap() const
The Map describing the parallel distribution of this object.
Exception throws when you call an unimplemented method of Xpetra.
void doImport(const DistObject< int, int, GlobalOrdinal, Node > &source, const Import< int, GlobalOrdinal, Node > &importer, CombineMode CM)
void meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
#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)
static const EVerbosityLevel verbLevel_default
virtual void assign(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
int maxValue() const
Compute max 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.
RCP< Epetra_IntVector > getEpetra_IntVector() const
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (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.
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
std::string description() const
Return a simple one-line description of this object.
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 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 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 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 meanValue(const Teuchos::ArrayView< int > &means) const
Compute mean (average) value of each vector in multi-vector.
void replaceMap(const RCP< const Map< int, GlobalOrdinal, Node > > &map)
int dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const
TODO missing comment.
Teuchos::ArrayRCP< const int > getData(size_t j) const
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 norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
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.
CombineMode
Xpetra::Combine Mode enumerable type.
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.
#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.
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::ScalarTraits< int >::magnitudeType norm2() const
Compute 2-norm of this Vector.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
const RCP< const Comm< int > > getComm() const
size_t getLocalLength() const
Returns the local vector length on the calling processor of vectors in the multi-vector.
void norm2(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 2-norm of each vector in multi-vector.
void doExport(const DistObject< int, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< int, GlobalOrdinal, Node > &exporter, CombineMode CM)
EpetraIntVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
EpetraIntVectorT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, bool zeroOut=true)
Sets all vector entries to zero.
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 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 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.
global_size_t getGlobalLength() const
Returns the global vector length of vectors in the multi-vector.
Teuchos::ScalarTraits< int >::magnitudeType norm1() const
Return 1-norm of this Vector.
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
void norm1(const Teuchos::ArrayView< Teuchos::ScalarTraits< int >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
bool is_null() const
std::string description() const
Return a simple one-line description of this object.
RCP< Epetra_IntVector > getEpetra_IntVector() const