All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Xpetra_TpetraBlockCrsMatrix_def.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // Xpetra: A linear algebra interface package
6 // Copyright 2012 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact
39 // Jonathan Hu (jhu@sandia.gov)
40 // Andrey Prokopenko (aprokop@sandia.gov)
41 // Ray Tuminaro (rstumin@sandia.gov)
42 //
43 // ***********************************************************************
44 //
45 // @HEADER
46 #ifndef XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
47 #define XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
48 
50 
51 namespace Xpetra {
52 
53 
55  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
58  size_t maxNumEntriesPerRow,
59  ProfileType pftype,
61  {
62  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
63  }
64 
65 
67  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
70  const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc,
71  ProfileType pftype,
73  {
74  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
75  }
76 
77 
79  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
83  size_t maxNumEntriesPerRow,
84  ProfileType pftype,
86  {
87  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
88  }
89 
90 
92  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
96  const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc,
97  ProfileType pftype,
99  {
100  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
101  }
102 
103 
105  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
109  // : mtx_(Teuchos::rcp(new Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >(toTpetra(graph), params)))
110  // * there is no Tpetra::BlockCrsMatrix(graph, params) c'tor. We throw anyways here so no need to set mtx_.
111  {
112  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
113  }
114 
115 
117  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
120  const LocalOrdinal blockSize)
121  : mtx_(Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*toTpetra(graph), blockSize)))
122  { }
123 
124 
126  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
128  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
130  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap,
131  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap,
133  {
134  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
135  }
136 
137 
139  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
141  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
143  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap,
144  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap,
146  {
147  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
148  }
149 
150 
152  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
154  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
155  const Import<LocalOrdinal,GlobalOrdinal,Node> & RowImporter,
156  const Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > DomainImporter,
157  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap,
158  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap,
160  {
161  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
162  }
163 
164 
166  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
168  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
169  const Export<LocalOrdinal,GlobalOrdinal,Node> & RowExporter,
170  const Teuchos::RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > DomainExporter,
171  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap,
172  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap,
174  {
175  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
176  }
177 
178 
180  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
183 
184 
186 
187 
189  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
190  void
192  insertGlobalValues(GlobalOrdinal globalRow,
194  const ArrayView< const Scalar > &vals)
195  {
196  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
197  }
198 
199 
201  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
202  void
204  insertLocalValues(LocalOrdinal localRow,
205  const ArrayView< const LocalOrdinal > &cols,
206  const ArrayView< const Scalar > &vals)
207  {
208  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
209  }
210 
211 
213  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
214  void
216  replaceGlobalValues(GlobalOrdinal globalRow,
218  const ArrayView< const Scalar > &vals)
219  {
220  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
221  }
222 
223 
225  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
226  void
228  replaceLocalValues (LocalOrdinal localRow,const ArrayView<const LocalOrdinal> &cols,const ArrayView<const Scalar> &vals)
229  {
230  XPETRA_MONITOR("TpetraBlockCrsMatrix::replaceLocalValues");
231  mtx_->replaceLocalValues(localRow,cols.getRawPtr(),vals.getRawPtr(),cols.size());
232  }
233 
234 
236  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
237  void
239  setAllToScalar(const Scalar &alpha)
240  {
241  XPETRA_MONITOR("TpetraBlockCrsMatrix::setAllToScalar"); mtx_->setAllToScalar(alpha);
242  }
243 
244 
246  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
247  void
249  scale(const Scalar &alpha)
250  {
251  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
252  }
253 
254 
256  //** \warning This is an expert-only routine and should not be called from user code. (not implemented)
257  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
258  void
260  allocateAllValues(size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind, ArrayRCP<Scalar> & values)
261  {
262  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
263  }
264 
265 
267  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
268  void
270  setAllValues(const ArrayRCP<size_t> & rowptr, const ArrayRCP<LocalOrdinal> & colind, const ArrayRCP<Scalar> & values)
271  {
272  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
273  }
274 
275 
277  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
278  void
282  ArrayRCP<const Scalar>& values) const
283  {
284  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
285  }
286 
287 
289 
290  // Transformational Methods
292 
293 
294  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
295  void
298  {
299  /*noop*/
300  }
301 
302 
303  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
304  void
307  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap,
308  const RCP< ParameterList > &params)
309  {
310  /*noop*/
311  }
312 
313 
314  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
315  void
318  {
319  /*noop*/
320  }
321 
322 
323  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
324  void
328  {
329  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
330  }
331 
332 
333  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
334  void
337  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
338  const RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > &importer,
339  const RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > &exporter,
340  const RCP<ParameterList> &params)
341  {
342  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
343  }
344 
346 
347 
349 
350 
351  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
354  getRowMap() const
355  {
356  XPETRA_MONITOR("TpetraBlockCrsMatrix::getRowMap"); return toXpetra(mtx_->getRowMap());
357  }
358 
359 
360  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
363  getColMap() const
364  {
365  XPETRA_MONITOR("TpetraBlockCrsMatrix::getColMap"); return toXpetra(mtx_->getColMap());
366  }
367 
368 
369  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
373  {
374  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
375  }
376 
377 
378  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
382  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalNumRows"); return mtx_->getGlobalNumRows(); }
383 
384 
385  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
389  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalNumCols"); return mtx_->getGlobalNumCols(); }
390 
391 
392  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
393  size_t
396  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getNodeNumRows"); return mtx_->getNodeNumRows(); }
397 
398 
399  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
400  size_t
403  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getNodeNumCols"); return mtx_->getNodeNumCols(); }
404 
405 
406  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
410  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalNumEntries"); return mtx_->getGlobalNumEntries(); }
411 
412 
413  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
414  size_t
417  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getNodeNumEntries"); return mtx_->getNodeNumEntries(); }
418 
419 
420  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
421  size_t
423  getNumEntriesInLocalRow(LocalOrdinal localRow) const
424  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getNumEntriesInLocalRow"); return mtx_->getNumEntriesInLocalRow(localRow); }
425 
426 
427  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
428  size_t
430  getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
431  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getNumEntriesInGlobalRow"); return mtx_->getNumEntriesInGlobalRow(globalRow); }
432 
433 
434  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
436  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalMaxNumRowEntries"); return mtx_->getGlobalMaxNumRowEntries(); }
437 
438 
439  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
441  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getNodeMaxNumRowEntries"); return mtx_->getNodeMaxNumRowEntries(); }
442 
443 
444  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
446  { XPETRA_MONITOR("TpetraBlockCrsMatrix::isLocallyIndexed"); return mtx_->isLocallyIndexed(); }
447 
448 
449  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
451  { XPETRA_MONITOR("TpetraBlockCrsMatrix::isGloballyIndexed"); return mtx_->isGloballyIndexed(); }
452 
453 
454  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
456  { XPETRA_MONITOR("TpetraBlockCrsMatrix::isFillComplete"); return mtx_->isFillComplete(); }
457 
458 
459  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
461  { XPETRA_MONITOR("TpetraBlockCrsMatrix::isFillActive"); return false; }
462 
463 
464  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
466  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getFrobeniusNorm"); return mtx_->getFrobeniusNorm(); }
467 
468 
469  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
471  { XPETRA_MONITOR("TpetraBlockCrsMatrix::supportsRowViews"); return mtx_->supportsRowViews(); }
472 
473 
474  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
475  void
477  getLocalRowCopy(LocalOrdinal LocalRow,
478  const ArrayView< LocalOrdinal > &Indices,
479  const ArrayView< Scalar > &Values,
480  size_t &NumEntries) const
481  {
482  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalRowCopy");
483  mtx_->getLocalRowCopy(LocalRow, Indices, Values, NumEntries);
484  }
485 
486 
487  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
488  void
490  getGlobalRowView(GlobalOrdinal GlobalRow,
492  ArrayView< const Scalar > &values) const
493  {
494  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalRowView");
495  mtx_->getGlobalRowView(GlobalRow, indices, values);
496  }
497 
498 
499  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
500  void
502  getGlobalRowCopy(GlobalOrdinal GlobalRow,
503  const ArrayView< GlobalOrdinal > &indices,
504  const ArrayView< Scalar > &values,
505  size_t &numEntries) const
506  {
507  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalRowCopy");
508  mtx_->getGlobalRowCopy(GlobalRow, indices, values, numEntries);
509  }
510 
511 
512  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
513  void
515  getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices,
516  ArrayView< const Scalar > &values) const
517  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalRowView"); mtx_->getLocalRowView(LocalRow, indices, values); }
518 
519 
520  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
521  bool
524  { return true; }
525 
526 
527  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
531  Teuchos::ETransp mode,
532  Scalar alpha,
533  Scalar beta) const
534  { XPETRA_MONITOR("TpetraBlockCrsMatrix::apply"); mtx_->apply(toTpetra(X), toTpetra(Y), mode, alpha, beta); }
535 
536 
537  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
541  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getDomainMap"); return toXpetra(mtx_->getDomainMap()); }
542 
543 
544  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
548  { XPETRA_MONITOR("TpetraBlockCrsMatrix::getRangeMap"); return toXpetra(mtx_->getRangeMap()); }
549 
550 
551  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
552  std::string
555  { XPETRA_MONITOR("TpetraBlockCrsMatrix::description"); return mtx_->description(); }
556 
557 
558  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
559  void
562  const Teuchos::EVerbosityLevel verbLevel) const
563  {
564  XPETRA_MONITOR("TpetraBlockCrsMatrix::describe");
565  mtx_->describe(out, verbLevel);
566  }
567 
568 
569  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
570  void
572  setObjectLabel( const std::string &objectLabel )
573  {
574  XPETRA_MONITOR("TpetraCrsMatrix::setObjectLabel");
575  Teuchos::LabeledObject::setObjectLabel(objectLabel);
576  mtx_->setObjectLabel(objectLabel);
577  }
578 
579 #ifdef XPETRA_ENABLE_DEPRECATED_CODE
580  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
584  // : mtx_ (matrix.mtx_->template clone<Node> (matrix.mtx_->getNode()))
585  {
586  // This won't compile because there is no Tpetra::BlockCrsMatrix::clone()
587  // so just throwing an error... it'll go away anyhow with deprecations.
588  // But seriously, pre ETI how did this ever actually compile!?
589  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function is deprecated.");
590  }
591 #endif // XPETRA_ENABLE_DEPRECATED_CODE
592 
593 
594  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
595  void
598  {
599  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalDiagCopy");
601  diag,
602  tDiag,
603  "Xpetra::TpetraBlockCrsMatrix.getLocalDiagCopy() only accept Xpetra::TpetraVector as input arguments.");
604  mtx_->getLocalDiagCopy(*tDiag.getTpetra_Vector());
605  }
606 
607 
609  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
610  void
613  const Teuchos::ArrayView<const size_t> &offsets) const
614  {
615  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
616  }
617 
618 
619 
620  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
621  void
624  {
625  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalDiagOffsets");
626 
627  const size_t lclNumRows = mtx_->getGraph()->getNodeNumRows();
628  if (static_cast<size_t>(offsets.size()) < lclNumRows)
629  {
630  offsets.resize(lclNumRows);
631  }
632 
633  // The input ArrayRCP must always be a host pointer. Thus, if
634  // device_type::memory_space is Kokkos::HostSpace, it's OK for us
635  // to write to that allocation directly as a Kokkos::View.
636  typedef typename Node::device_type device_type;
637  typedef typename device_type::memory_space memory_space;
638  if (std::is_same<memory_space, Kokkos::HostSpace>::value)
639  {
640  // It is always syntactically correct to assign a raw host
641  // pointer to a device View, so this code will compile correctly
642  // even if this branch never runs.
643  typedef Kokkos::View<size_t*, device_type, Kokkos::MemoryUnmanaged> output_type;
644  output_type offsetsOut (offsets.getRawPtr(), offsets.size());
645  mtx_->getLocalDiagOffsets(offsetsOut);
646  }
647  else
648  {
649  Kokkos::View<size_t*, device_type> offsetsTmp ("diagOffsets", offsets.size());
650  mtx_->getLocalDiagOffsets(offsetsTmp);
651  typedef Kokkos::View<size_t*, Kokkos::HostSpace, Kokkos::MemoryUnmanaged> output_type;
652  output_type offsetsOut(offsets.getRawPtr(), offsets.size());
653  Kokkos::deep_copy(offsetsOut, offsetsTmp);
654  }
655  }
656 
657 
658  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
659  void
662  {
663  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix::replaceDiag: function not implemented");
664  }
665 
666 
667  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
668  void
671  {
672  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
673  }
674 
675 
676  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
677  void
680  {
681  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
682  }
683 
684 
685  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
688  getMap() const
689  {
690  XPETRA_MONITOR("TpetraBlockCrsMatrix::getMap"); return rcp( new TpetraMap< LocalOrdinal, GlobalOrdinal, Node >(mtx_->getMap()) );
691  }
692 
693 
695  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
696  void
700  {
701  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
702  }
703 
704 
706  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
707  void
711  {
712  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
713  }
714 
715 
717  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
718  void
722  {
723  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
724  }
725 
726 
728  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
729  void
733  {
734  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
735  }
736 
737 
738  template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
739  void
742  {
743  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented");
744  }
745 
746 
747 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
748 bool
750 hasMatrix() const
751 {
752  return !mtx_.is_null();
753 }
754 
755 
756 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
758 TpetraBlockCrsMatrix(const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx)
759 : mtx_(mtx)
760 { }
761 
762 
763 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
767 {
768  return mtx_;
769 }
770 
771 
772 // TODO: remove
773 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
777 {
778  return mtx_;
779 }
780 
781 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
782 #ifdef HAVE_XPETRA_TPETRA
783 
784 // was: typedef typename Xpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::local_matrix_type local_matrix_type;
785 //using local_matrix_type = typename CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::local_matrix_type;
786 
787 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
790 getLocalMatrix () const
791 {
792  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
793 
794 #ifndef __NVCC__
795  local_matrix_type ret;
796 #endif // __NVCC__
797 
799 }
800 
801 
802 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
803 void
805 setAllValues (const typename local_matrix_type::row_map_type& ptr,
806  const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
807  const typename local_matrix_type::values_type& val)
808 {
809  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
810 }
811 
812 #endif // HAVE_XPETRA_TPETRA
813 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
814 
815 
816 #ifdef HAVE_XPETRA_EPETRA
817 
818 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
819  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
820 
821 
822  // specialization of TpetraBlockCrsMatrix for GO=LO=int and Node=EpetraNode
823  template <class Scalar>
824  class TpetraBlockCrsMatrix<Scalar,int,int,EpetraNode>
825  : public CrsMatrix<Scalar,int,int,EpetraNode>//, public TpetraRowMatrix<Scalar,int,int,Node>
826  {
827 
828  // The following typedef are used by the XPETRA_DYNAMIC_CAST() macro.
829  typedef int LocalOrdinal;
830  typedef int GlobalOrdinal;
831  typedef EpetraNode Node;
836 
837  public:
838 
840 
842  TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null) {
844  }
845 
849  }
850 
854  }
855 
859  }
860 
864  }
865 
869  }
870 
872  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
874  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap = Teuchos::null,
875  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap = Teuchos::null,
876  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
878 
880  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
882  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap = Teuchos::null,
883  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap = Teuchos::null,
884  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
886 
888  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
889  const Import<LocalOrdinal,GlobalOrdinal,Node> & RowImporter,
890  const Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > DomainImporter,
891  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap,
892  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap,
895 
897  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
898  const Export<LocalOrdinal,GlobalOrdinal,Node> & RowExporter,
899  const Teuchos::RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > DomainExporter,
900  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap,
901  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap,
903  {
905  }
906 
909 
910 
912 
915  {}
916 
919  {}
920 
923  {}
924 
927  {}
928 
930  void setAllToScalar(const Scalar &alpha) {}
931 
933  void scale(const Scalar &alpha)
934  {}
935 
937  //** \warning This is an expert-only routine and should not be called from user code. (not implemented)
938  void allocateAllValues(size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind, ArrayRCP<Scalar> & values)
939  {}
940 
942  void setAllValues(const ArrayRCP<size_t> & rowptr, const ArrayRCP<LocalOrdinal> & colind, const ArrayRCP<Scalar> & values)
943  {}
944 
947  {}
948 
949 
951 
953  void resumeFill(const RCP< ParameterList > &params=null) { /*noop*/ }
954 
956  void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null) { /*noop*/ }
957 
959  void fillComplete(const RCP< ParameterList > &params=null) { /*noop*/ }
960 
961 
964  {}
965 
968  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
969  const RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > &importer=Teuchos::null,
970  const RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > &exporter=Teuchos::null,
971  const RCP<ParameterList> &params=Teuchos::null)
972  {}
973 
974 
976 
978  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const { return Teuchos::null; }
979 
981  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const { return Teuchos::null; }
982 
985  {return Teuchos::null;}
986 
988  global_size_t getGlobalNumRows() const { return 0; }
989 
991  global_size_t getGlobalNumCols() const { return 0; }
992 
994  size_t getNodeNumRows() const { return 0; }
995 
997  size_t getNodeNumCols() const { return 0; }
998 
1000  global_size_t getGlobalNumEntries() const { return 0; }
1001 
1003  size_t getNodeNumEntries() const { return 0; }
1004 
1006  size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
1007 
1009  size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
1010 
1012  size_t getGlobalMaxNumRowEntries() const { return 0; }
1013 
1015  size_t getNodeMaxNumRowEntries() const { return 0; }
1016 
1018  bool isLocallyIndexed() const { return false; }
1019 
1021  bool isGloballyIndexed() const { return false; }
1022 
1024  bool isFillComplete() const { return false; }
1025 
1027  bool isFillActive() const { return false; }
1028 
1031 
1033  bool supportsRowViews() const { return false; }
1034 
1036  void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const { }
1037 
1040 
1042  void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &indices, const ArrayView< Scalar > &values, size_t &numEntries) const { }
1043 
1046 
1048  bool haveGlobalConstants() const {return false;}
1049 
1050 
1052 
1055 
1057  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const { return Teuchos::null; }
1058 
1060  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const { return Teuchos::null; }
1061 
1062 
1064 
1066  std::string description() const { return std::string(""); }
1067 
1070 
1071 
1074 
1077 
1080 
1083  {}
1084 
1086 
1089 
1090 
1092 
1095 
1099  {}
1100 
1104  {}
1105 
1109  {}
1110 
1114  {}
1115 
1117  {}
1118 
1119 
1120 #ifdef XPETRA_ENABLE_DEPRECATED_CODE
1121  // INST_INT_INT specialization variant
1122  template<class Node2>
1124  XPETRA_DEPRECATED
1125  clone(const RCP<Node2> &node2) const
1126  {
1127  return Teuchos::null;
1128  }
1129 #endif // XPETRA_ENABLE_DEPRECATED_CODE
1130 
1132 
1134  bool hasMatrix() const { return false; }
1135 
1137  TpetraBlockCrsMatrix(const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1139  }
1140 
1143 
1146 
1147 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
1148 #ifdef HAVE_XPETRA_TPETRA
1150 
1151  local_matrix_type getLocalMatrix () const {
1152  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
1153  local_matrix_type ret;
1154  return ret; // make compiler happy
1155  }
1156 
1157  void setAllValues (const typename local_matrix_type::row_map_type& ptr,
1158  const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
1159  const typename local_matrix_type::values_type& val)
1160  {
1161  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
1162  }
1163 #endif // HAVE_XPETRA_TPETRA
1164 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
1165 
1166  }; // TpetraBlockCrsMatrix class
1167 
1168 
1169 #endif // #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT)))
1170 
1171 
1172 
1173 
1174 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
1175  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
1176 
1177  // specialization of TpetraBlockCrsMatrix for GO=long long and Node=EpetraNode
1178  template <class Scalar>
1179  class TpetraBlockCrsMatrix<Scalar,int,long long,EpetraNode>
1180  : public CrsMatrix<Scalar,int,long long,EpetraNode>//, public TpetraRowMatrix<Scalar,int,int,Node>
1181  {
1182 
1183  // The following typedef are used by the XPETRA_DYNAMIC_CAST() macro.
1184  typedef int LocalOrdinal;
1185  typedef long long GlobalOrdinal;
1186  typedef EpetraNode Node;
1191 
1192  public:
1193 
1195 
1197  TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
1199 
1203 
1207 
1211 
1215 
1219 
1220 
1221 
1222 
1224  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
1225  const Import<LocalOrdinal,GlobalOrdinal,Node> & importer,
1226  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap = Teuchos::null,
1227  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap = Teuchos::null,
1228  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
1230 
1232  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
1233  const Export<LocalOrdinal,GlobalOrdinal,Node> & exporter,
1234  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap = Teuchos::null,
1235  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap = Teuchos::null,
1236  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
1238 
1240  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
1241  const Import<LocalOrdinal,GlobalOrdinal,Node> & RowImporter,
1242  const Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > DomainImporter,
1243  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap,
1244  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap,
1247 
1249  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
1250  const Export<LocalOrdinal,GlobalOrdinal,Node> & RowExporter,
1251  const Teuchos::RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > DomainExporter,
1252  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap,
1253  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap,
1256 
1259 
1260 
1262 
1265  {}
1266 
1269  {}
1270 
1273  {}
1274 
1277  {}
1278 
1280  void setAllToScalar(const Scalar &alpha) {}
1281 
1283  void scale(const Scalar &alpha)
1284  {}
1285 
1287  //** \warning This is an expert-only routine and should not be called from user code. (not implemented)
1288  void allocateAllValues(size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind, ArrayRCP<Scalar> & values)
1289  {}
1290 
1292  void setAllValues(const ArrayRCP<size_t> & rowptr, const ArrayRCP<LocalOrdinal> & colind, const ArrayRCP<Scalar> & values)
1293  {}
1294 
1297  {}
1298 
1299 
1301 
1303  void resumeFill(const RCP< ParameterList > &params=null) { /*noop*/ }
1304 
1306  void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null) { /*noop*/ }
1307 
1309  void fillComplete(const RCP< ParameterList > &params=null) { /*noop*/ }
1310 
1311 
1314  {}
1315 
1318  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
1319  const RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > &importer=Teuchos::null,
1320  const RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > &exporter=Teuchos::null,
1321  const RCP<ParameterList> &params=Teuchos::null)
1322  {}
1323 
1324 
1326 
1328  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const { return Teuchos::null; }
1329 
1331  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const { return Teuchos::null; }
1332 
1335  {return Teuchos::null;}
1336 
1338  global_size_t getGlobalNumRows() const { return 0; }
1339 
1341  global_size_t getGlobalNumCols() const { return 0; }
1342 
1344  size_t getNodeNumRows() const { return 0; }
1345 
1347  size_t getNodeNumCols() const { return 0; }
1348 
1350  global_size_t getGlobalNumEntries() const { return 0; }
1351 
1353  size_t getNodeNumEntries() const { return 0; }
1354 
1356  size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
1357 
1359  size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
1360 
1362  size_t getGlobalMaxNumRowEntries() const { return 0; }
1363 
1365  size_t getNodeMaxNumRowEntries() const { return 0; }
1366 
1368  bool isLocallyIndexed() const { return false; }
1369 
1371  bool isGloballyIndexed() const { return false; }
1372 
1374  bool isFillComplete() const { return false; }
1375 
1377  bool isFillActive() const { return false; }
1378 
1381 
1383  bool supportsRowViews() const { return false; }
1384 
1386  void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const { }
1387 
1390 
1392  void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &indices, const ArrayView< Scalar > &values, size_t &numEntries) const { }
1393 
1396 
1398  bool haveGlobalConstants() const {return true;}
1399 
1400 
1402 
1405 
1407  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const { return Teuchos::null; }
1408 
1410  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const { return Teuchos::null; }
1411 
1412 
1414 
1416  std::string description() const { return std::string(""); }
1417 
1420 
1423 
1426 
1429 
1432  {}
1433 
1435 
1438 
1440 
1443 
1447  {}
1448 
1452  {}
1453 
1457  {}
1458 
1462  {}
1463 
1465  {}
1466 
1467 
1468 #ifdef XPETRA_ENABLE_DEPRECATED_CODE
1469  // INST_INT_LONG_LONG specialization variation
1470  template<class Node2>
1472  XPETRA_DEPRECATED
1473  clone(const RCP<Node2> &node2) const
1474  {
1475  return Teuchos::null;
1476  }
1477 #endif // XPETRA_ENABLE_DEPRECATED_CODE
1478 
1480 
1482  bool hasMatrix() const { return false; }
1483 
1485  TpetraBlockCrsMatrix(const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1487  }
1488 
1491 
1494 
1495 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
1496 #ifdef HAVE_XPETRA_TPETRA
1498 
1499  local_matrix_type getLocalMatrix () const {
1500  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
1501  local_matrix_type ret;
1503  }
1504 
1505  void setAllValues (const typename local_matrix_type::row_map_type& ptr,
1506  const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
1507  const typename local_matrix_type::values_type& val)
1508  {
1509  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
1510  }
1511 #endif // HAVE_XPETRA_TPETRA
1512 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
1513 
1514  }; // TpetraBlockCrsMatrix class
1515 
1516 
1517 #endif // IF ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))
1518 
1519 
1520 
1521 
1522 #endif // HAVE_XPETRA_EPETRA
1523 
1524 
1525 } // Xpetra namespace
1526 
1527 #endif // XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
1528 
1529 
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y...
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
TpetraBlockCrsMatrix(const TpetraBlockCrsMatrix &matrix)
Deep copy constructor.
RCP< Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const Map< LocalOrdinal, GlobalOrdinal, Node1 > &map, const RCP< Node2 > &node2)
void fillComplete(const RCP< ParameterList > &params=null)
Signal that data entry is complete.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the matrix. Put into storage allocated by calli...
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
void replaceDiag(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &indices, const ArrayView< Scalar > &values, size_t &numEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage...
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null)
Signal that data entry is complete, specifying domain and range maps.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column Map and number of entries in each row (not implemented) ...
void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the matrix. Put into storage allocated by calli...
size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale matrix using the given vector entries.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
TpetraBlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraBlockCrsMatrixClass
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y...
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
Replaces the current domainMap and importer with the user-specified objects.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrixNonConst() const
Get the underlying Tpetra matrix.
void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the matrix. Put into storage allocated by calli...
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > &params=Teuchos::null)
Expert static fill complete.
size_t getNodeNumRows() const
Returns the number of matrix rows owned on the calling node.
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 rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale operator with given vector values.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
bool hasMatrix() const
Does this have an underlying matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrixNonConst() const
Get the underlying Tpetra matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor for a fused import ( not implemented )
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
T * getRawPtr() const
size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
size_type size() const
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > &params=Teuchos::null)
Expert static fill complete.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix. ...
size_type size() const
void setObjectLabel(const std::string &objectLabel)
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y...
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
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.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
std::string description() const
A simple one-line description of this object.
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph (not impelmented)
void fillComplete(const RCP< ParameterList > &params=null)
Signal that data entry is complete.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const LocalOrdinal blockSize)
Constructor specifying a previously constructed graph &amp; blocksize.
TpetraBlockCrsMatrix(const Teuchos::RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &mtx)
TpetraBlockCrsMatrix constructor to wrap a Tpetra::BlockCrsMatrix object.
TpetraVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraVectorClass
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &indices, const ArrayView< Scalar > &values, size_t &numEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage...
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
void resize(const size_type n, const T &val=T())
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix. ...
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row (not implemented) ...
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
virtual bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph (not impelmented)
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
size_t getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
void replaceDiag(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag)
Replace the diagonal entries of the matrix.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
TpetraImport< LocalOrdinal, GlobalOrdinal, Node > TpetraImportClass
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
Computes the sparse matrix-multivector multiplication.
std::string description() const
A simple one-line description of this object.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
std::string description() const
A simple one-line description of this object.
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph (not impelmented)
TpetraBlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraBlockCrsMatrixClass
RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrixNonConst() const
Get the underlying Tpetra matrix.
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor for a fused export (not implemented(.
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.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column Map and number of entries in each row (not implemented) ...
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Teuchos::ArrayView< const size_t > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor for a fused import (not implemented)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row (not implemented) ...
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null)
Signal that data entry is complete, specifying domain and range maps.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
size_t getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale matrix using the given vector entries.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
T * getRawPtr() const
bool isFillActive() const
Returns true if the matrix is in edit mode.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
Replaces the current domainMap and importer with the user-specified objects.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor for a fused export (not implemented(.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
size_t global_size_t
Global size_t object.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row (not implemented) ...
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
static const EVerbosityLevel verbLevel_default
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix. ...
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
TpetraBlockCrsMatrix(const TpetraBlockCrsMatrix &matrix)
Deep copy constructor.
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
static magnitudeType magnitude(T a)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor for a fused export (not implemented)
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying a previously constructed graph ( not implemented )
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
size_t getNodeNumRows() const
Returns the number of matrix rows owned on the calling node.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying a previously constructed graph ( not implemented )
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor for a fused import (not implemented)
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const LocalOrdinal blockSize)
Constructor specifying a previously constructed graph &amp; blocksize.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph (not implemented)
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
size_t getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale operator with given vector values.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph (not implemented)
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
void replaceDiag(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag)
Replace the diagonal entries of the matrix.
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null)
Signal that data entry is complete, specifying domain and range maps.
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > &params=Teuchos::null)
Expert static fill complete.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
CombineMode
Xpetra::Combine Mode enumerable type.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
#define XPETRA_MONITOR(funcName)
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
Computes the sparse matrix-multivector multiplication.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
TpetraBlockCrsMatrix(const Teuchos::RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &mtx)
TpetraBlockCrsMatrix constructor to wrap a Tpetra::BlockCrsMatrix object.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
TpetraVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraVectorClass
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Teuchos::ArrayView< const size_t > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row (not implemented) ...
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
bool isFillActive() const
Returns true if the matrix is in edit mode.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
size_t getNodeNumRows() const
Returns the number of matrix rows owned on the calling node.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor for a fused export (not implemented)
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
Computes the sparse matrix-multivector multiplication.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &indices, const ArrayView< Scalar > &values, size_t &numEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage...
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor for a fused import ( not implemented )
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph (not implemented)
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
Replaces the current domainMap and importer with the user-specified objects.
bool isFillActive() const
Returns true if the matrix is in edit mode.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
void resumeFill(const RCP< ParameterList > &params=null)
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
TpetraExport< LocalOrdinal, GlobalOrdinal, Node > TpetraExportClass