46 #ifndef XPETRA_TPETRACRSMATRIX_DEF_HPP
47 #define XPETRA_TPETRACRSMATRIX_DEF_HPP
49 #include <Xpetra_MultiVectorFactory.hpp>
51 #include "Tpetra_Details_residual.hpp"
55 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
57 : mtx_ (
Teuchos::
rcp (new Tpetra::
CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> (
toTpetra(rowMap), maxNumEntriesPerRow, Tpetra::StaticProfile, params))) { }
59 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
61 : mtx_(
Teuchos::
rcp(new Tpetra::
CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> (
toTpetra(rowMap), NumEntriesPerRowToAlloc(), Tpetra::StaticProfile, params))) { }
63 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
64 TpetraCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::TpetraCrsMatrix(
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)
65 : mtx_(
Teuchos::
rcp(new Tpetra::
CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(rowMap),
toTpetra(colMap), maxNumEntriesPerRow, Tpetra::StaticProfile, params))) { }
67 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
68 TpetraCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::TpetraCrsMatrix(
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)
69 : mtx_(
Teuchos::
rcp(new Tpetra::
CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >(
toTpetra(rowMap),
toTpetra(colMap), NumEntriesPerRowToAlloc(), Tpetra::StaticProfile, params))) { }
71 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
77 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
84 typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> MyTpetraCrsMatrix;
90 mtx_=Tpetra::importAndFillCompleteCrsMatrix<MyTpetraCrsMatrix>(tSourceMatrix.getTpetra_CrsMatrix(),
toTpetra(importer),myDomainMap,myRangeMap,params);
91 bool restrictComm=
false;
92 if(!params.
is_null()) restrictComm = params->
get(
"Restrict Communicator",restrictComm);
93 if(restrictComm && mtx_->getRowMap().is_null()) mtx_=Teuchos::null;
97 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
104 typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> MyTpetraCrsMatrix;
110 mtx_=Tpetra::exportAndFillCompleteCrsMatrix<MyTpetraCrsMatrix>(tSourceMatrix.getTpetra_CrsMatrix(),
toTpetra(exporter),myDomainMap,myRangeMap,params);
114 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
122 typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> MyTpetraCrsMatrix;
129 mtx_=Tpetra::importAndFillCompleteCrsMatrix<MyTpetraCrsMatrix>(tSourceMatrix.getTpetra_CrsMatrix(),
toTpetra(RowImporter),
toTpetra(*DomainImporter),myDomainMap,myRangeMap,params);
130 bool restrictComm=
false;
131 if(!params.
is_null()) restrictComm = params->
get(
"Restrict Communicator",restrictComm);
132 if(restrictComm && mtx_->getRowMap().is_null()) mtx_=Teuchos::null;
135 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
143 typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> MyTpetraCrsMatrix;
150 mtx_=Tpetra::exportAndFillCompleteCrsMatrix<MyTpetraCrsMatrix>(tSourceMatrix.getTpetra_CrsMatrix(),
toTpetra(RowExporter),
toTpetra(*DomainExporter),myDomainMap,myRangeMap,params);
156 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
157 #ifdef HAVE_XPETRA_TPETRA
158 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
161 const local_matrix_type& lclMatrix,
165 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
167 const local_matrix_type& lclMatrix,
168 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
169 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
170 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap,
171 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap,
175 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
177 const local_matrix_type& lclMatrix,
178 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
179 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
180 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap,
181 const Teuchos::RCP<
const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap,
182 const Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Node> >& importer,
183 const Teuchos::RCP<
const Export<LocalOrdinal,GlobalOrdinal,Node> >& exporter,
185 : mtx_(
Teuchos::
rcp(new Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(lclMatrix,
toTpetra(rowMap),
toTpetra(colMap),
toTpetra(domainMap),
toTpetra(rangeMap),
toTpetra(importer),
toTpetra(exporter), params))) { }
189 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
192 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
195 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
198 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
201 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
209 const LocalOrdinal numValid =
210 mtx_->replaceLocalValues (localRow, cols, vals);
212 static_cast<size_type
> (numValid) != cols.
size (), std::runtime_error,
213 "replaceLocalValues returned " << numValid <<
" != cols.size() = " <<
214 cols.
size () <<
".");
217 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
220 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
223 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
227 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
229 {
XPETRA_MONITOR(
"TpetraCrsMatrix::setAllValues"); mtx_->setAllValues(rowptr,colind,values); }
231 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
233 {
XPETRA_MONITOR(
"TpetraCrsMatrix::getAllValues"); mtx_->getAllValues(rowptr,colind,values); }
235 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
237 {
XPETRA_MONITOR(
"TpetraCrsMatrix::getAllValues"); mtx_->getAllValues(values); }
239 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
241 {
return mtx_->haveGlobalConstants();}
243 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
246 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
247 void TpetraCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::fillComplete(
const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap,
const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap,
const RCP< ParameterList > ¶ms) {
XPETRA_MONITOR(
"TpetraCrsMatrix::fillComplete"); mtx_->fillComplete(
toTpetra(domainMap),
toTpetra(rangeMap), params); }
249 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
253 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
258 mtx_->replaceDomainMapAndImporter(
toTpetra(newDomainMap),myImport);
261 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
271 if(importer!=Teuchos::null) {
273 myImport = tImporter.getTpetra_Import();
275 if(exporter!=Teuchos::null) {
277 myExport = tExporter.getTpetra_Export();
280 mtx_->expertStaticFillComplete(
toTpetra(domainMap),
toTpetra(rangeMap),myImport,myExport,params);
283 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
286 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
289 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
292 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
295 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
298 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
301 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
304 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
307 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
310 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
313 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
316 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
319 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
322 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
325 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
328 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
331 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
334 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
337 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
340 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
343 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::nonconst_local_inds_host_view_type indices(
"indices",Indices.
size());
344 typename Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::nonconst_values_host_view_type values(
"values", Values.
size());
346 mtx_->getLocalRowCopy(LocalRow, indices, values, NumEntries);
347 for (
size_t i=0;i<NumEntries; ++i) {
348 Indices[i]=indices(i);
353 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
356 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::nonconst_global_inds_host_view_type indices(
"indices",Indices.
size());
357 typename Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::nonconst_values_host_view_type values(
"values", Values.
size());
359 mtx_->getGlobalRowCopy(GlobalRow, indices, values, NumEntries);
360 for (
size_t i=0;i<NumEntries; ++i) {
361 Indices[i]=indices(i);
367 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
370 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::global_inds_host_view_type indices;
371 typename Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::values_host_view_type values;
373 mtx_->getGlobalRowView(GlobalRow, indices, values);
378 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
381 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::local_inds_host_view_type indices;
382 typename Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::values_host_view_type values;
384 mtx_->getLocalRowView(LocalRow, indices, values);
389 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
390 void TpetraCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::apply(
const MultiVector &X,
MultiVector &Y,
Teuchos::ETransp mode, Scalar alpha, Scalar beta)
const {
XPETRA_MONITOR(
"TpetraCrsMatrix::apply"); mtx_->apply(
toTpetra(X),
toTpetra(Y), mode, alpha, beta); }
392 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
393 void TpetraCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::apply(
const MultiVector &X,
MultiVector &Y,
Teuchos::ETransp mode, Scalar alpha, Scalar beta,
bool sumInterfaceValues,
const RCP<
Import<LocalOrdinal, GlobalOrdinal, Node> >& regionInterfaceImporter,
const Teuchos::ArrayRCP<LocalOrdinal>& regionInterfaceLIDs )
const
398 if (sumInterfaceValues)
403 matvecInterfaceTmp->doImport(Y, *regionInterfaceImporter,
INSERT);
409 for(LocalOrdinal interfaceIdx = 0; interfaceIdx < static_cast<LocalOrdinal>(interfaceData.
size()); ++interfaceIdx) {
410 YData[regionInterfaceLIDs[interfaceIdx]] += interfaceData[interfaceIdx];
415 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
418 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
421 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
424 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
427 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
431 mtx_->setObjectLabel(objectLabel);
436 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
440 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
444 mtx_->getLocalDiagCopy(*tDiag.getTpetra_Vector());
447 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
450 mtx_->getLocalDiagOffsets(offsets);
453 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
456 mtx_->getLocalDiagCopy(*(
toTpetra(diag)), offsets);
459 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
462 Tpetra::replaceDiagonalCrsMatrix(*mtx_, *(
toTpetra(diag)));
465 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
471 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
477 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
480 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
492 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
503 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
514 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
525 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
528 mtx_->removeEmptyProcessesInPlace(
toTpetra(newMap));
531 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
533 return ! mtx_.is_null ();
536 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
539 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
543 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
547 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
#define XPETRA_MONITOR(funcName)
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
void resize(const size_type n, const T &val=T())
virtual void setObjectLabel(const std::string &objectLabel)
static Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &map, size_t NumVectors, bool zeroOut=true)
Constructor specifying the number of non-zeros for all rows.
virtual Teuchos::ArrayRCP< Scalar > getDataNonConst(size_t j)=0
View of the local values in a particular vector of this multivector.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs.
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
RCP< Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_CrsMatrixNonConst() const
Get the underlying Tpetra matrix.
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
TpetraCrsMatrix(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.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the 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.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs.
void getLocalDiagCopy(Vector &diag) const
Get a copy of the diagonal entries owned by this node, with local row indices.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
size_t getNodeNumRows() const
Returns the number of matrix rows owned on the calling node.
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this.
void rightScale(const Vector &x)
Right scale operator with given vector values.
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...
global_size_t getGlobalNumCols() const
Number of global columns 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.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in 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 residual(const MultiVector &X, const MultiVector &B, MultiVector &R) const
Compute a residual R = B - (*this) * X.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
void resumeFill(const RCP< ParameterList > ¶ms=null)
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs.
void leftScale(const Vector &x)
Left scale operator with given vector values.
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 getNodeNumEntries() const
Returns the local number of entries in this matrix.
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
bool hasMatrix() const
Does this have an underlying matrix.
std::string description() const
A simple one-line description of this object.
RCP< const Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_CrsMatrix() const
Get the underlying Tpetra matrix.
virtual ~TpetraCrsMatrix()
Destructor.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
bool isFillActive() const
Returns true if the matrix is in edit mode.
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 setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph.
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
global_size_t getGlobalNumEntries() const
Returns the global number of entries 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.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this 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.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
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 > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
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 getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
void replaceDiag(const Vector &diag)
Replace the diagonal entries of the matrix.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
void setObjectLabel(const std::string &objectLabel)
void apply(const MultiVector &X, MultiVector &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 > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y....
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.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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.