46 #ifndef XPETRA_REORDEREDBLOCKEDCRSMATRIX_HPP 47 #define XPETRA_REORDEREDBLOCKEDCRSMATRIX_HPP 69 template <
class Scalar,
82 #undef XPETRA_REORDEREDBLOCKEDCRSMATRIX_SHORT 100 (Teuchos::RCP<const MapExtractor>& rangeMaps,
101 Teuchos::RCP<const MapExtractor>& domainMaps,
103 Teuchos::RCP<const Xpetra::BlockReorderManager> brm,
119 Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >
mergeSubBlockMaps(Teuchos::RCP<const Xpetra::BlockReorderManager> brm) {
120 RCP<const MapExtractor> fullRangeMapExtractor =
fullOp_->getRangeMapExtractor();
123 size_t numBlocks = brm->GetNumBlocks();
125 Teuchos::RCP<const Map> map = Teuchos::null;
132 map = fullRangeMapExtractor->getMap(Teuchos::as<size_t>(leaf->GetIndex()),
false);
135 std::vector<Teuchos::RCP<const Map> > subMaps (numBlocks, Teuchos::null);
137 for(
size_t i = 0; i < numBlocks; i++) {
138 Teuchos::RCP<const Xpetra::BlockReorderManager> blkMgr = brm->GetBlock(Teuchos::as<int>(i));
140 TEUCHOS_ASSERT(subMaps[i].is_null()==
false);
145 TEUCHOS_ASSERT(map.is_null()==
false);
158 Teuchos::ETransp mode = Teuchos::NO_TRANS,
159 Scalar alpha = ScalarTraits<Scalar>::one(),
160 Scalar beta = ScalarTraits<Scalar>::zero())
const 172 RCP<const MultiVector> refX = rcpFromRef(X);
173 RCP<const BlockedMultiVector> refbX = Teuchos::rcp_dynamic_cast<
const BlockedMultiVector>(refX);
174 RCP<MultiVector> tmpY = rcpFromRef(Y);
178 bool bCopyResultX =
false;
179 bool bCopyResultY =
false;
211 RCP<const BlockedMap> blkRgMap = Teuchos::rcp_dynamic_cast<
const BlockedMap>(
fullOp_->getRangeMap());
212 TEUCHOS_ASSERT(blkRgMap.is_null()==
false);
213 RCP<const BlockedMultiVector> bXtemp = Teuchos::rcp(
new BlockedMultiVector(blkRgMap, refX));
214 TEUCHOS_ASSERT(bXtemp.is_null()==
false);
215 RCP<const BlockedMultiVector> bX =
217 TEUCHOS_ASSERT(bX.is_null()==
false);
224 RCP<const BlockedMap> blkRgMap = Teuchos::rcp_dynamic_cast<
const BlockedMap>(
fullOp_->getRangeMap());
225 TEUCHOS_ASSERT(blkRgMap.is_null()==
false);
226 RCP<BlockedMultiVector> tmpbYtemp = Teuchos::rcp(
new BlockedMultiVector(blkRgMap, tmpY));
227 TEUCHOS_ASSERT(tmpbYtemp.is_null()==
false);
228 RCP<BlockedMultiVector> bY =
230 TEUCHOS_ASSERT(bY.is_null()==
false);
235 TEUCHOS_ASSERT(refbX.is_null()==
false);
236 TEUCHOS_ASSERT(tmpbY.is_null()==
false);
240 if (bCopyResultX ==
true) {
241 RCP<const MultiVector> Xmerged = refbX->Merge();
242 RCP<MultiVector> nonconstX = Teuchos::rcp_const_cast<
MultiVector>(refX);
243 nonconstX->
update(Teuchos::ScalarTraits<Scalar>::one(), *Xmerged, Teuchos::ScalarTraits<Scalar>::zero());
245 if (bCopyResultY ==
true) {
246 RCP< MultiVector> Ymerged = tmpbY->Merge();
247 Y.
update(Teuchos::ScalarTraits<Scalar>::one(), *Ymerged, Teuchos::ScalarTraits<Scalar>::zero());
268 std::string
description()
const {
return "ReorderedBlockedCrsMatrix"; }
271 void describe(Teuchos::FancyOStream& out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {
277 out <<
"ReorderedBlockMatrix is fillComplete" << std::endl;
279 out <<
"fullRowMap" << std::endl;
286 out <<
"Xpetra::ReorderedBlockedCrsMatrix is NOT fillComplete" << std::endl;
291 out <<
"Block(" << r <<
"," << c <<
")" << std::endl;
299 Teuchos::RCP<const Xpetra::BlockReorderManager >
brm_;
300 Teuchos::RCP<const Xpetra::BlockedCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
fullOp_;
305 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
310 RCP<const Xpetra::MapExtractor<Scalar,LocalOrdinal,GlobalOrdinal,Node> > fullRangeMapExtractor = bmat->getRangeMapExtractor();
313 size_t numBlocks = brm->GetNumBlocks();
315 Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node>> map = Teuchos::null;
321 map = fullRangeMapExtractor->getMap(Teuchos::as<size_t>(leaf->GetIndex()), bThyraMode);
324 std::vector<Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > > subMaps (numBlocks, Teuchos::null);
326 for(
size_t i = 0; i < numBlocks; i++) {
327 Teuchos::RCP<const Xpetra::BlockReorderManager> blkMgr = brm->GetBlock(Teuchos::as<int>(i));
329 TEUCHOS_ASSERT(subMaps[i].is_null()==
false);
347 TEUCHOS_ASSERT(map.is_null()==
false);
351 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
362 size_t rowSz = rowMgr->GetNumBlocks();
363 size_t colSz = colMgr->GetNumBlocks();
365 Teuchos::RCP<BlockedCrsMatrix> rbmat = Teuchos::null;
367 if(rowSz == 0 && colSz == 0) {
369 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
370 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
373 Teuchos::RCP<Matrix> mat = bmat->getMatrix(rowleaf->GetIndex(), colleaf->GetIndex());
375 if (mat == Teuchos::null)
return Teuchos::null;
379 if(matwrap != Teuchos::null) {
382 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
383 Teuchos::RCP<const Map> submap = fullRangeMapExtractor->
getMap(rowleaf->GetIndex(),
false);
384 std::vector<Teuchos::RCP<const Map> > rowSubMaps (1, submap);
385 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::rcp(
new MapExtractor(submap, rowSubMaps,
false));
387 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
388 Teuchos::RCP<const Map> submap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
389 std::vector<Teuchos::RCP<const Map> > colSubMaps (1, submap2);
390 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::rcp(
new MapExtractor(submap2, colSubMaps,
false));
393 rbmat->setMatrix(0,0,mat);
397 TEUCHOS_ASSERT(rbmat != Teuchos::null);
399 TEUCHOS_ASSERT(mat->getNodeNumEntries() == rbmat->getNodeNumEntries());
403 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::null;
405 std::vector<Teuchos::RCP<const Map> > rowSubMaps (rowSz, Teuchos::null);
406 for(
size_t i = 0; i < rowSz; i++) {
407 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
409 TEUCHOS_ASSERT(rowSubMaps[i].is_null()==
false);
412 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rgMergedSubMaps, rowSubMaps,
false));
414 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
415 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
418 Teuchos::RCP<const Map> submap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
false);
419 std::vector<Teuchos::RCP<const Map> > rowSubMaps (1, submap);
420 rgMapExtractor = Teuchos::rcp(
new MapExtractor(submap, rowSubMaps,
false));
423 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::null;
425 std::vector<Teuchos::RCP<const Map> > colSubMaps (colSz, Teuchos::null);
426 for(
size_t j = 0; j < colSz; j++) {
427 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
429 TEUCHOS_ASSERT(colSubMaps[j].is_null()==
false);
432 doMapExtractor = Teuchos::rcp(
new MapExtractor(doMergedSubMaps, colSubMaps,
false));
434 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
435 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
438 Teuchos::RCP<const Map> submap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
439 std::vector<Teuchos::RCP<const Map> > colSubMaps (1, submap);
440 doMapExtractor = Teuchos::rcp(
new MapExtractor(submap, colSubMaps,
false));
447 if (rowSz == 0 && colSz > 0) {
448 for(
size_t j = 0; j < colSz; j++) {
449 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
450 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowMgr, colSubMgr, bmat);
451 rbmat->setMatrix(0,j,Teuchos::rcp_const_cast<Matrix>(submat));
452 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
454 }
else if (rowSz > 0 && colSz == 0) {
455 for(
size_t i = 0; i < rowSz; i++) {
456 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
457 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowSubMgr, colMgr, bmat);
458 rbmat->setMatrix(i,0,Teuchos::rcp_const_cast<Matrix>(submat));
459 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
462 for(
size_t i = 0; i < rowSz; i++) {
463 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
464 for(
size_t j = 0; j < colSz; j++) {
465 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
466 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowSubMgr, colSubMgr, bmat);
467 rbmat->setMatrix(i,j,Teuchos::rcp_const_cast<Matrix>(submat));
468 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
472 TEUCHOS_ASSERT(rbmat->getNodeNumEntries() == cntNNZ);
474 rbmat->fillComplete();
480 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
489 TEUCHOS_ASSERT(bmat->getRangeMapExtractor()->getThyraMode() ==
true);
490 TEUCHOS_ASSERT(bmat->getDomainMapExtractor()->getThyraMode() ==
true);
493 size_t rowSz = rowMgr->GetNumBlocks();
494 size_t colSz = colMgr->GetNumBlocks();
496 Teuchos::RCP<BlockedCrsMatrix> rbmat = Teuchos::null;
498 if(rowSz == 0 && colSz == 0) {
500 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
501 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
504 Teuchos::RCP<Matrix> mat = bmat->getMatrix(rowleaf->GetIndex(), colleaf->GetIndex());
506 if(mat == Teuchos::null)
return Teuchos::null;
510 if(matwrap != Teuchos::null) {
513 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
515 Teuchos::RCP<const Map> xpsubmap = fullRangeMapExtractor->
getMap(rowleaf->GetIndex(),
false);
516 Teuchos::RCP<const Map> thysubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
true);
517 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (1, xpsubmap);
518 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (1, thysubmap);
520 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
522 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
524 Teuchos::RCP<const Map> xpsubmap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
525 Teuchos::RCP<const Map> tysubmap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
true);
526 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (1, xpsubmap2);
527 std::vector<Teuchos::RCP<const Map> > colTySubMaps (1, tysubmap2);
529 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
534 rbmat->setMatrix(0,0,mat);
538 TEUCHOS_ASSERT(rbmat != Teuchos::null);
540 TEUCHOS_ASSERT(mat->getNodeNumEntries() == rbmat->getNodeNumEntries());
544 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::null;
546 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (rowSz, Teuchos::null);
547 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (rowSz, Teuchos::null);
548 for(
size_t i = 0; i < rowSz; i++) {
549 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
553 TEUCHOS_ASSERT(rowXpSubMaps[i].is_null()==
false);
554 TEUCHOS_ASSERT(rowTySubMaps[i].is_null()==
false);
557 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
559 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
560 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
562 Teuchos::RCP<const Map> xpsubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
false);
563 Teuchos::RCP<const Map> thysubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
true);
564 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (1, xpsubmap);
565 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (1, thysubmap);
567 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
570 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::null;
572 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (colSz, Teuchos::null);
573 std::vector<Teuchos::RCP<const Map> > colTySubMaps (colSz, Teuchos::null);
574 for(
size_t j = 0; j < colSz; j++) {
575 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
579 TEUCHOS_ASSERT(colXpSubMaps[j].is_null()==
false);
580 TEUCHOS_ASSERT(colTySubMaps[j].is_null()==
false);
583 doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps,colTySubMaps));
585 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
586 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
588 Teuchos::RCP<const Map> xpsubmap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
589 Teuchos::RCP<const Map> tysubmap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
true);
590 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (1, xpsubmap);
591 std::vector<Teuchos::RCP<const Map> > colTySubMaps (1, tysubmap);
593 doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
601 if (rowSz == 0 && colSz > 0) {
602 for(
size_t j = 0; j < colSz; j++) {
603 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
605 rbmat->setMatrix(0,j,Teuchos::rcp_const_cast<Matrix>(submat));
606 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
608 }
else if (rowSz > 0 && colSz == 0) {
609 for(
size_t i = 0; i < rowSz; i++) {
610 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
612 rbmat->setMatrix(i,0,Teuchos::rcp_const_cast<Matrix>(submat));
613 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
616 for(
size_t i = 0; i < rowSz; i++) {
617 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
618 for(
size_t j = 0; j < colSz; j++) {
619 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
621 rbmat->setMatrix(i,j,Teuchos::rcp_const_cast<Matrix>(submat));
622 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
626 TEUCHOS_ASSERT(rbmat->getNodeNumEntries() == cntNNZ);
629 rbmat->fillComplete();
633 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
635 TEUCHOS_ASSERT(bmat->getRangeMapExtractor()->getThyraMode() == bmat->getDomainMapExtractor()->getThyraMode());
636 Teuchos::RCP<const Xpetra::Matrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > rbmat = Teuchos::null;
637 if(bmat->getRangeMapExtractor()->getThyraMode() ==
false) {
649 #define XPETRA_REORDEREDBLOCKEDCRSMATRIX_SHORT
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.
Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > mergeSubBlockMaps(Teuchos::RCP< const Xpetra::BlockReorderManager > brm, Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bmat, bool bThyraMode)
bool isFillComplete() const
Returns true if fillComplete() has been called and the matrix is in compute mode. ...
Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > fullOp_
const Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
Xpetra utility class for common map-related routines.
Teuchos::RCP< const Xpetra::BlockReorderManager > getBlockReorderManager()
Returns internal BlockReorderManager object.
static Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > concatenateMaps(const std::vector< Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > > &subMaps)
Helper function to concatenate several maps.
GlobalOrdinal global_ordinal_type
BlockedCrsMatrix(const Teuchos::RCP< const BlockedMap > &rangeMaps, const Teuchos::RCP< const BlockedMap > &domainMaps, size_t npr, Xpetra::ProfileType pftype=Xpetra::DynamicProfile)
Constructor.
Teuchos::RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > mergeSubBlocksThyra(Teuchos::RCP< const Xpetra::BlockReorderManager > rowMgr, Teuchos::RCP< const Xpetra::BlockReorderManager > colMgr, Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bmat)
virtual void update(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta)=0
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
Teuchos::RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > mergeSubBlocks(Teuchos::RCP< const Xpetra::BlockReorderManager > rowMgr, Teuchos::RCP< const Xpetra::BlockReorderManager > colMgr, Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bmat)
std::string description() const
Return a simple one-line description of this object.
size_t getNodeNumRows() const
Returns the number of matrix rows owned on the calling node.
Teuchos::RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > buildReorderedBlockedCrsMatrix(Teuchos::RCP< const Xpetra::BlockReorderManager > brm, Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bmat)
virtual ~ReorderedBlockedCrsMatrix()
Destructor.
Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > mergeSubBlockMaps(Teuchos::RCP< const Xpetra::BlockReorderManager > brm)
LocalOrdinal local_ordinal_type
RCP< const Map > getRangeMap() const
Returns the Map associated with the range of this operator.
Concrete implementation of Xpetra::Matrix.
Teuchos::RCP< Matrix > getMatrix(size_t r, size_t c) const
return block (r,c)
ReorderedBlockedCrsMatrix(Teuchos::RCP< const MapExtractor > &rangeMaps, Teuchos::RCP< const MapExtractor > &domainMaps, size_t npr, Teuchos::RCP< const Xpetra::BlockReorderManager > brm, Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bmat, Xpetra::ProfileType pftype=Xpetra::DynamicProfile)
Constructor.
virtual 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.
Teuchos::RCP< const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > buildReorderedBlockedMultiVector(Teuchos::RCP< const Xpetra::BlockReorderManager > brm, Teuchos::RCP< const Xpetra::BlockedMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > bvec)
virtual size_t Rows() const
number of row blocks
virtual size_t Cols() const
number of column blocks
Xpetra-specific matrix class.
Teuchos::RCP< const Xpetra::BlockReorderManager > brm_
virtual 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.