46#ifndef XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
47#define XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
51#include "Xpetra_TpetraCrsGraph.hpp"
57 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
60 size_t maxNumEntriesPerRow,
63 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
68 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
74 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
79 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
83 size_t maxNumEntriesPerRow,
86 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
91 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
98 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
103 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
110 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
115 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
118 const LocalOrdinal blockSize)
119 : mtx_(
Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*
toTpetra(graph), blockSize)))
124 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
129 const LocalOrdinal blockSize)
130 : mtx_(
Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*
toTpetra(graph), *
toTpetra(pointDomainMap), *
toTpetra(pointRangeMap),blockSize)))
135 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
143 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
148 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
156 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
161 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
170 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
175 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
184 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
189 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
198 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
205 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
210 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
217 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
222 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
229 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in"+std::string(__FILE__)+
":"+std::to_string(__LINE__));
234 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
245 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
250 XPETRA_MONITOR(
"TpetraBlockCrsMatrix::setAllToScalar"); mtx_->setAllToScalar(alpha);
255 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
258 scale(
const Scalar &alpha)
260 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
266 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
271 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
276 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
281 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
286 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
293 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
297 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
302 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
313 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
322 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
333 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
342 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
348 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
352 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
361 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
370 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
379 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
388 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
394 using G_t = Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>;
396 RCP<G_t> t_graph = Teuchos::rcp_const_cast<G_t>(Teuchos::rcpFromRef(mtx_->getCrsGraph()));
402 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
406 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getGlobalNumRows");
return mtx_->getGlobalNumRows(); }
409 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
413 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getGlobalNumCols");
return mtx_->getGlobalNumCols(); }
416 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
420 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getLocalNumRows");
return mtx_->getLocalNumRows(); }
423 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
427 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getLocalNumCols");
return mtx_->getLocalNumCols(); }
430 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
434 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getGlobalNumEntries");
return mtx_->getGlobalNumEntries(); }
437 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
441 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getLocalNumEntries");
return mtx_->getLocalNumEntries(); }
444 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
448 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getNumEntriesInLocalRow");
return mtx_->getNumEntriesInLocalRow(localRow); }
451 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
455 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getNumEntriesInGlobalRow");
return mtx_->getNumEntriesInGlobalRow(globalRow); }
458 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
460 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getGlobalMaxNumRowEntries");
return mtx_->getGlobalMaxNumRowEntries(); }
463 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
465 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getLocalMaxNumRowEntries");
return mtx_->getLocalMaxNumRowEntries(); }
468 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
470 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::isLocallyIndexed");
return mtx_->isLocallyIndexed(); }
473 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
475 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::isGloballyIndexed");
return mtx_->isGloballyIndexed(); }
478 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
480 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::isFillComplete");
return mtx_->isFillComplete(); }
483 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
485 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::isFillActive");
return false; }
488 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
490 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::getFrobeniusNorm");
return mtx_->getFrobeniusNorm(); }
493 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
495 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::supportsRowViews");
return mtx_->supportsRowViews(); }
498 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
504 size_t &NumEntries)
const
507 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::nonconst_local_inds_host_view_type indices(
"indices",Indices.
size());
508 typename Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::nonconst_values_host_view_type values(
"values", Values.
size());
510 mtx_->getLocalRowCopy(LocalRow, indices, values, NumEntries);
511 for (
size_t i=0;i<NumEntries; ++i) {
512 Indices[i]=indices(i);
516 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
523 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::local_inds_host_view_type indices;
524 typename Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::values_host_view_type values;
526 mtx_->getLocalRowView(LocalRow, indices, values);
532 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
540 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::global_inds_host_view_type indices;
541 typename Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::values_host_view_type values;
543 mtx_->getGlobalRowView(GlobalRow, indices, values);
549 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
555 size_t &NumEntries)
const
558 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::nonconst_global_inds_host_view_type indices(
"indices",Indices.
size());
559 typename Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::nonconst_values_host_view_type values(
"values", Values.
size());
561 mtx_->getGlobalRowCopy(GlobalRow, indices, values, NumEntries);
562 for (
size_t i=0;i<NumEntries; ++i) {
563 Indices[i]=indices(i);
569 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
576 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
585 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
592 bool sumInterfaceValues,
598 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
605 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
612 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
616 {
XPETRA_MONITOR(
"TpetraBlockCrsMatrix::description");
return mtx_->description(); }
619 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
626 mtx_->describe(out, verbLevel);
630 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
637 mtx_->setObjectLabel(objectLabel);
642 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
651 "Xpetra::TpetraBlockCrsMatrix.getLocalDiagCopy() only accept Xpetra::TpetraVector as input arguments.");
652 mtx_->getLocalDiagCopy(*tDiag.getTpetra_Vector());
657 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
663 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
668 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
675 const size_t lclNumRows = mtx_->getGraph()->getLocalNumRows();
676 if (
static_cast<size_t>(offsets.
size()) < lclNumRows)
678 offsets.
resize(lclNumRows);
684 typedef typename Node::device_type device_type;
685 typedef typename device_type::memory_space memory_space;
686 if (std::is_same<memory_space, Kokkos::HostSpace>::value)
691 typedef Kokkos::View<size_t*, device_type, Kokkos::MemoryUnmanaged> output_type;
692 output_type offsetsOut (offsets.
getRawPtr(), offsets.
size());
693 mtx_->getLocalDiagOffsets(offsetsOut);
697 Kokkos::View<size_t*, device_type> offsetsTmp (
"diagOffsets", offsets.
size());
698 mtx_->getLocalDiagOffsets(offsetsTmp);
699 typedef Kokkos::View<size_t*, Kokkos::HostSpace, Kokkos::MemoryUnmanaged> output_type;
701 Kokkos::deep_copy(offsetsOut, offsetsTmp);
706 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
711 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix::replaceDiag: function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
715 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
720 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
724 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
729 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
733 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
743 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
749 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
754 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
760 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
765 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
771 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
776 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
782 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
786 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
791 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix function not implemented in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
795template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
800 return !mtx_.is_null();
804template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
811template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
821template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
829#ifdef HAVE_XPETRA_TPETRA
834template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
839 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
848template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
853 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
856 typename local_matrix_type::HostMirror ret;
863template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
866setAllValues (
const typename local_matrix_type::row_map_type& ptr,
867 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
868 const typename local_matrix_type::values_type& val)
870 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
876#ifdef HAVE_XPETRA_EPETRA
878#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
879 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
883 template <
class Scalar>
885 :
public CrsMatrix<Scalar,int,int,EpetraNode>
1049 {
return Teuchos::null;}
1118 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 { }
1201#ifdef HAVE_XPETRA_TPETRA
1205 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
1211 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
1212 const typename local_matrix_type::values_type& val)
1214 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
1226#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
1227 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
1230 template <
class Scalar>
1232 :
public CrsMatrix<Scalar,int,long long,EpetraNode>
1392 {
return Teuchos::null;}
1461 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 { }
1542#ifdef HAVE_XPETRA_TPETRA
1546 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
1552 const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type& ind,
1553 const typename local_matrix_type::values_type& val)
1555 throw std::runtime_error(
"Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in "+std::string(__FILE__)+
":"+std::to_string(__LINE__));
#define XPETRA_MONITOR(funcName)
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
void resize(const size_type n, const T &val=T())
static const EVerbosityLevel verbLevel_default
virtual void setObjectLabel(const std::string &objectLabel)
KokkosSparse::CrsMatrix< impl_scalar_type, LocalOrdinal, execution_space, void, typename local_graph_type::size_type > local_matrix_type
The specialization of Kokkos::CrsMatrix that represents the part of the sparse matrix on each MPI pro...
void setAllValues(const typename local_matrix_type::row_map_type &ptr, const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind, const typename local_matrix_type::values_type &val)
Xpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
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...
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix.
bool isFillActive() const
Returns true if the matrix is in edit mode.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const LocalOrdinal blockSize)
Constructor specifying a previously constructed graph & blocksize.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
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(.
bool hasMatrix() const
Does this have an underlying matrix.
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.
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 replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
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 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 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 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.
TpetraExport< LocalOrdinal, GlobalOrdinal, Node > TpetraExportClass
std::string description() const
A simple one-line description of this object.
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, 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.
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
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.
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 )
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
TpetraImport< LocalOrdinal, GlobalOrdinal, Node > TpetraImportClass
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale matrix using the given vector entries.
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
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, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Constructor specifying column Map and 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...
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 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.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
~TpetraBlockCrsMatrix()
Destructor.
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 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.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
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.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
TpetraBlockCrsMatrix(const TpetraBlockCrsMatrix &matrix)
Deep copy constructor.
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 doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
void getAllValues(ArrayRCP< Scalar > &values)
Gets the 1D pointer arrays of the graph (not implemented)
local_matrix_type getLocalMatrix() const
void resumeFill(const RCP< ParameterList > ¶ms=null)
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
void replaceDiag(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag)
Replace the diagonal entries of the matrix.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
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)
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
TpetraBlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraBlockCrsMatrixClass
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
TpetraBlockCrsMatrix(const Teuchos::RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &mtx)
TpetraBlockCrsMatrix constructor to wrap a Tpetra::BlockCrsMatrix object.
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 )
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
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 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 leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
global_size_t getGlobalNumRows() const
Number of global elements in the row map of 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 getGlobalNumCols() const
Number of global columns in the matrix.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
TpetraVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraVectorClass
size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
~TpetraBlockCrsMatrix()
Destructor.
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 )
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale matrix using the given vector entries.
void setAllValues(const typename local_matrix_type::row_map_type &ptr, const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind, const typename local_matrix_type::values_type &val)
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< Scalar > &values)
Gets the 1D pointer arrays of the graph (not implemented)
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
TpetraBlockCrsMatrix(const Teuchos::RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &mtx)
TpetraBlockCrsMatrix constructor to wrap a Tpetra::BlockCrsMatrix object.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
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...
TpetraBlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraBlockCrsMatrixClass
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)
bool hasMatrix() const
Does this have an underlying 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)
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 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)
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
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 TpetraBlockCrsMatrix &matrix)
Deep copy constructor.
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
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 insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix.
void resumeFill(const RCP< ParameterList > ¶ms=null)
TpetraImport< LocalOrdinal, GlobalOrdinal, Node > TpetraImportClass
void fillComplete(const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete.
TpetraExport< LocalOrdinal, GlobalOrdinal, Node > TpetraExportClass
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (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 describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
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 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.
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 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.
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.
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 isFillActive() const
Returns true if the matrix is in edit mode.
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)
Xpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void replaceDiag(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra 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)
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
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 setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
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, 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.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this 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 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 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 doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
local_matrix_type getLocalMatrix() const
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
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 leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
TpetraVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraVectorClass
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)
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)
local_matrix_type getLocalMatrixDevice() const
void setObjectLabel(const std::string &objectLabel)
local_matrix_type::HostMirror getLocalMatrixHost() const
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
std::string description() const
A simple one-line description of this object.
virtual bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix.
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 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 getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
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 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)
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
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.
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 replaceDiag(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag)
Replace the diagonal entries of the matrix.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale operator with given vector values.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column 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)
typename CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
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.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with 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...
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....
virtual ~TpetraBlockCrsMatrix()
Destructor.
size_t getLocalNumEntries() const
Returns the local number of entries 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.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
void resumeFill(const RCP< ParameterList > ¶ms=null)
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
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 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.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
bool isFillActive() const
Returns true if the matrix is in edit mode.
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 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.
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrixNonConst() const
Get the underlying Tpetra 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 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.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
size_t global_size_t
Global size_t object.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
CombineMode
Xpetra::Combine Mode enumerable type.
static magnitudeType magnitude(T a)