46 #ifndef XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
47 #define XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
55 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
58 size_t maxNumEntriesPerRow,
59 const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
61 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
66 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
69 const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc,
70 const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
72 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
77 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
81 size_t maxNumEntriesPerRow,
82 const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
84 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
89 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
93 const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc,
94 const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
96 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
101 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
104 const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
108 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
113 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
116 const LocalOrdinal blockSize)
117 : mtx_(Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*
toTpetra(graph), blockSize)))
122 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
124 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
128 const Teuchos::RCP<Teuchos::ParameterList>& params)
130 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
135 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
137 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
141 const Teuchos::RCP<Teuchos::ParameterList>& params)
143 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
148 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
150 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
155 const Teuchos::RCP<Teuchos::ParameterList>& params)
157 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
162 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
164 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
169 const Teuchos::RCP<Teuchos::ParameterList>& params)
171 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
176 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
185 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
189 const ArrayView< const GlobalOrdinal > &cols,
190 const ArrayView< const Scalar > &vals)
192 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
197 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
201 const ArrayView< const LocalOrdinal > &cols,
202 const ArrayView< const Scalar > &vals)
204 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
209 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
213 const ArrayView< const GlobalOrdinal > &cols,
214 const ArrayView< const Scalar > &vals)
216 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
221 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
224 replaceLocalValues (LocalOrdinal localRow,
const ArrayView<const LocalOrdinal> &cols,
const ArrayView<const Scalar> &vals)
227 mtx_->replaceLocalValues(localRow,cols.getRawPtr(),vals.getRawPtr(),cols.size());
232 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
237 XPETRA_MONITOR(
"TpetraBlockCrsMatrix::setAllToScalar"); mtx_->setAllToScalar(alpha);
242 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
247 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
253 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
256 allocateAllValues(
size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind, ArrayRCP<Scalar> & values)
258 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
263 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
266 setAllValues(
const ArrayRCP<size_t> & rowptr,
const ArrayRCP<LocalOrdinal> & colind,
const ArrayRCP<Scalar> & values)
268 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
273 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
277 ArrayRCP<const LocalOrdinal>& colind,
278 ArrayRCP<const Scalar>& values)
const
280 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
290 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
299 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
304 const RCP< ParameterList > ¶ms)
310 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
319 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
325 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
329 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
336 const RCP<ParameterList> ¶ms)
338 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
347 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
348 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
356 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
357 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
365 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
366 RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node> >
370 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
374 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
378 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getGlobalNumRows");
return mtx_->getGlobalNumRows(); }
381 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
385 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getGlobalNumCols");
return mtx_->getGlobalNumCols(); }
388 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
392 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getNodeNumRows");
return mtx_->getNodeNumRows(); }
395 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
399 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getNodeNumCols");
return mtx_->getNodeNumCols(); }
402 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
406 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getGlobalNumEntries");
return mtx_->getGlobalNumEntries(); }
409 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
413 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getNodeNumEntries");
return mtx_->getNodeNumEntries(); }
416 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
420 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getNumEntriesInLocalRow");
return mtx_->getNumEntriesInLocalRow(localRow); }
423 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
427 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getNumEntriesInGlobalRow");
return mtx_->getNumEntriesInGlobalRow(globalRow); }
430 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
432 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getGlobalMaxNumRowEntries");
return mtx_->getGlobalMaxNumRowEntries(); }
435 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
437 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getNodeMaxNumRowEntries");
return mtx_->getNodeMaxNumRowEntries(); }
440 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
442 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::isLocallyIndexed");
return mtx_->isLocallyIndexed(); }
445 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
447 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::isGloballyIndexed");
return mtx_->isGloballyIndexed(); }
450 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
452 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::isFillComplete");
return mtx_->isFillComplete(); }
455 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
457 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::isFillActive");
return false; }
460 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
462 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getFrobeniusNorm");
return mtx_->getFrobeniusNorm(); }
465 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
467 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::supportsRowViews");
return mtx_->supportsRowViews(); }
470 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
474 const ArrayView< LocalOrdinal > &Indices,
475 const ArrayView< Scalar > &Values,
476 size_t &NumEntries)
const
479 mtx_->getLocalRowCopy(LocalRow, Indices, Values, NumEntries);
483 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
487 ArrayView< const GlobalOrdinal > &indices,
488 ArrayView< const Scalar > &values)
const
491 mtx_->getGlobalRowView(GlobalRow, indices, values);
495 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
499 const ArrayView< GlobalOrdinal > &indices,
500 const ArrayView< Scalar > &values,
501 size_t &numEntries)
const
504 mtx_->getGlobalRowCopy(GlobalRow, indices, values, numEntries);
508 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
512 ArrayView< const Scalar > &values)
const
513 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getLocalRowView"); mtx_->getLocalRowView(LocalRow, indices, values); }
516 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
523 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
527 Teuchos::ETransp mode,
533 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
534 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
540 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
541 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
547 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
551 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::description");
return mtx_->description(); }
554 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
558 const Teuchos::EVerbosityLevel verbLevel)
const
561 mtx_->describe(out, verbLevel);
565 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
571 Teuchos::LabeledObject::setObjectLabel(objectLabel);
572 mtx_->setObjectLabel(objectLabel);
577 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
586 "Xpetra::TpetraBlockCrsMatrix.getLocalDiagCopy() only accept Xpetra::TpetraVector as input arguments.");
587 mtx_->getLocalDiagCopy(*tDiag.getTpetra_Vector());
592 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
596 const Teuchos::ArrayView<const size_t> &offsets)
const
598 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
603 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
610 const size_t lclNumRows = mtx_->getGraph()->getNodeNumRows();
611 if (static_cast<size_t>(offsets.size()) < lclNumRows)
613 offsets.resize(lclNumRows);
619 typedef typename Node::device_type device_type;
620 typedef typename device_type::memory_space memory_space;
621 if (std::is_same<memory_space, Kokkos::HostSpace>::value)
626 typedef Kokkos::View<size_t*, device_type, Kokkos::MemoryUnmanaged> output_type;
627 output_type offsetsOut (offsets.getRawPtr(), offsets.size());
628 mtx_->getLocalDiagOffsets(offsetsOut);
632 Kokkos::View<size_t*, device_type> offsetsTmp (
"diagOffsets", offsets.size());
633 mtx_->getLocalDiagOffsets(offsetsTmp);
634 typedef Kokkos::View<size_t*, Kokkos::HostSpace, Kokkos::MemoryUnmanaged> output_type;
635 output_type offsetsOut(offsets.getRawPtr(), offsets.size());
636 Kokkos::deep_copy(offsetsOut, offsetsTmp);
641 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
646 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix::replaceDiag: function not implemented");
650 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
655 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
659 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
664 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
668 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
669 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
678 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
684 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
689 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
695 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
700 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
706 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
711 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
717 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
721 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
726 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented");
730 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
735 return !mtx_.is_null();
739 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
741 TpetraBlockCrsMatrix(
const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx)
746 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
747 RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
756 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
757 RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
764 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
765 #ifdef HAVE_XPETRA_TPETRA
770 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
775 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
778 local_matrix_type ret;
781 TEUCHOS_UNREACHABLE_RETURN(ret);
785 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
788 setAllValues (
const typename local_matrix_type::row_map_type& ptr,
789 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
790 const typename local_matrix_type::values_type& val)
792 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
795 #endif // HAVE_XPETRA_TPETRA
796 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
799 #ifdef HAVE_XPETRA_EPETRA
801 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
802 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
806 template <
class Scalar>
808 :
public CrsMatrix<Scalar,int,int,EpetraNode>
855 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
859 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
863 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
867 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
871 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
876 const Teuchos::RCP<Teuchos::ParameterList>& params)
880 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
885 const Teuchos::RCP<Teuchos::ParameterList>& params)
921 void allocateAllValues(
size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind, ArrayRCP<Scalar> & values)
925 void setAllValues(
const ArrayRCP<size_t> & rowptr,
const ArrayRCP<LocalOrdinal> & colind,
const ArrayRCP<Scalar> & values)
929 void getAllValues(ArrayRCP<const size_t>& rowptr, ArrayRCP<const LocalOrdinal>& colind, ArrayRCP<const Scalar>& values)
const
954 const RCP<ParameterList> ¶ms=Teuchos::null)
961 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRowMap()
const {
return Teuchos::null; }
964 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getColMap()
const {
return Teuchos::null; }
967 RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node> >
getCrsGraph()
const
968 {
return Teuchos::null;}
1013 typename ScalarTraits< Scalar >::magnitudeType
getFrobeniusNorm()
const {
return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); }
1019 void getLocalRowCopy(
LocalOrdinal LocalRow,
const ArrayView< LocalOrdinal > &Indices,
const ArrayView< Scalar > &Values,
size_t &NumEntries)
const { }
1037 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 { }
1040 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getDomainMap()
const {
return Teuchos::null; }
1043 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRangeMap()
const {
return Teuchos::null; }
1052 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const { }
1077 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getMap()
const {
return Teuchos::null; }
1110 TpetraBlockCrsMatrix(
const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1115 RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_BlockCrsMatrix()
const {
return Teuchos::null; }
1120 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
1121 #ifdef HAVE_XPETRA_TPETRA
1124 local_matrix_type getLocalMatrix ()
const {
1125 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
1126 local_matrix_type ret;
1130 void setAllValues (
const typename local_matrix_type::row_map_type& ptr,
1131 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
1132 const typename local_matrix_type::values_type& val)
1134 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
1136 #endif // HAVE_XPETRA_TPETRA
1137 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
1142 #endif // #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT)))
1147 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
1148 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
1151 template <
class Scalar>
1153 :
public CrsMatrix<Scalar,int,long long,EpetraNode>
1197 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
1201 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
1205 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
1209 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null)
1213 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
1218 const Teuchos::RCP<Teuchos::ParameterList>& params)
1222 TpetraBlockCrsMatrix(
const Teuchos::RCP<
const Tpetra::BlockCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >& sourceMatrix,
1227 const Teuchos::RCP<Teuchos::ParameterList>& params)
1261 void allocateAllValues(
size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind, ArrayRCP<Scalar> & values)
1265 void setAllValues(
const ArrayRCP<size_t> & rowptr,
const ArrayRCP<LocalOrdinal> & colind,
const ArrayRCP<Scalar> & values)
1269 void getAllValues(ArrayRCP<const size_t>& rowptr, ArrayRCP<const LocalOrdinal>& colind, ArrayRCP<const Scalar>& values)
const
1294 const RCP<ParameterList> ¶ms=Teuchos::null)
1301 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRowMap()
const {
return Teuchos::null; }
1304 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getColMap()
const {
return Teuchos::null; }
1307 RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node> >
getCrsGraph()
const
1308 {
return Teuchos::null;}
1353 typename ScalarTraits< Scalar >::magnitudeType
getFrobeniusNorm()
const {
return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); }
1359 void getLocalRowCopy(
LocalOrdinal LocalRow,
const ArrayView< LocalOrdinal > &Indices,
const ArrayView< Scalar > &Values,
size_t &NumEntries)
const { }
1377 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 { }
1380 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getDomainMap()
const {
return Teuchos::null; }
1383 const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRangeMap()
const {
return Teuchos::null; }
1392 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const { }
1415 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getMap()
const {
return Teuchos::null; }
1448 TpetraBlockCrsMatrix(
const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1453 RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_BlockCrsMatrix()
const {
return Teuchos::null; }
1458 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
1459 #ifdef HAVE_XPETRA_TPETRA
1462 local_matrix_type getLocalMatrix ()
const {
1463 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
1464 local_matrix_type ret;
1465 TEUCHOS_UNREACHABLE_RETURN(ret);
1468 void setAllValues (
const typename local_matrix_type::row_map_type& ptr,
1469 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
1470 const typename local_matrix_type::values_type& val)
1472 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation");
1474 #endif // HAVE_XPETRA_TPETRA
1475 #endif // HAVE_XPETRA_KOKKOS_REFACTOR
1480 #endif // IF ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))
1485 #endif // HAVE_XPETRA_EPETRA
1490 #endif // XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
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.
TpetraExport< LocalOrdinal, GlobalOrdinal, Node > TpetraExportClass
void fillComplete(const RCP< ParameterList > ¶ms=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 > ¶ms=null)
Signal that data entry is complete, specifying domain and range maps.
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 > ¶ms=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.
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.
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 resumeFill(const RCP< ParameterList > ¶ms=null)
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 > ¶ms=Teuchos::null)
Constructor for a fused import ( not implemented )
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row (not implemented) ...
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
bool hasMatrix() const
Does this have an underlying matrix.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
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 > ¶ms=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.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row (not implemented) ...
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix. ...
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)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
void fillComplete(const RCP< ParameterList > ¶ms=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 & 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)
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.
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...
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, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column Map and number of entries in each row (not implemented) ...
size_t getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
void resumeFill(const RCP< ParameterList > ¶ms=null)
~TpetraBlockCrsMatrix()
Destructor.
bool hasMatrix() const
Does this have an underlying matrix.
void replaceDiag(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag)
Replace the diagonal entries of the matrix.
TpetraImport< LocalOrdinal, GlobalOrdinal, Node > TpetraImportClass
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
TpetraImport< LocalOrdinal, GlobalOrdinal, Node > TpetraImportClass
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row (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.
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 > ¶ms)
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.
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 > ¶ms)
Constructor for a fused import (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 > ¶ms=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.
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 > ¶ms=Teuchos::null)
Constructor for a fused export (not implemented(.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
~TpetraBlockCrsMatrix()
Destructor.
size_t global_size_t
Global size_t object.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
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)
virtual ~TpetraBlockCrsMatrix()
Destructor.
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 > ¶ms=Teuchos::null)
Constructor for a fused export (not implemented)
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, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column Map and number of entries in each row (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 > ¶ms=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 > ¶ms=Teuchos::null)
Constructor specifying a previously constructed graph ( not implemented )
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 > ¶ms=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 Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const LocalOrdinal blockSize)
Constructor specifying a previously constructed graph & 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 > ¶ms=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 > ¶ms=Teuchos::null)
Expert static fill complete.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
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.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
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.
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 > ¶ms)
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 > ¶ms)
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 > ¶ms=null)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row (not implemented) ...
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