46 #ifndef XPETRA_REORDEREDBLOCKEDCRSMATRIX_HPP
47 #define XPETRA_REORDEREDBLOCKEDCRSMATRIX_HPP
56 #include "Xpetra_BlockedMultiVector.hpp"
58 #include "Xpetra_CrsMatrixWrap.hpp"
70 template <
class Scalar,
83 #undef XPETRA_REORDEREDBLOCKEDCRSMATRIX_SHORT
100 (Teuchos::RCP<const MapExtractor>& rangeMaps,
101 Teuchos::RCP<const MapExtractor>& domainMaps,
103 Teuchos::RCP<const Xpetra::BlockReorderManager> brm,
118 Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >
mergeSubBlockMaps(Teuchos::RCP<const Xpetra::BlockReorderManager> brm) {
119 RCP<const MapExtractor> fullRangeMapExtractor =
fullOp_->getRangeMapExtractor();
122 size_t numBlocks = brm->GetNumBlocks();
124 Teuchos::RCP<const Map> map = Teuchos::null;
131 map = fullRangeMapExtractor->getMap(Teuchos::as<size_t>(leaf->GetIndex()),
false);
134 std::vector<Teuchos::RCP<const Map> > subMaps (numBlocks, Teuchos::null);
136 for(
size_t i = 0; i < numBlocks; i++) {
137 Teuchos::RCP<const Xpetra::BlockReorderManager> blkMgr = brm->GetBlock(Teuchos::as<int>(i));
139 TEUCHOS_ASSERT(subMaps[i].is_null()==
false);
144 TEUCHOS_ASSERT(map.is_null()==
false);
157 Teuchos::ETransp mode = Teuchos::NO_TRANS,
158 Scalar alpha = ScalarTraits<Scalar>::one(),
159 Scalar beta = ScalarTraits<Scalar>::zero())
const
171 RCP<const MultiVector> refX = rcpFromRef(X);
172 RCP<const BlockedMultiVector> refbX = Teuchos::rcp_dynamic_cast<
const BlockedMultiVector>(refX);
173 RCP<MultiVector> tmpY = rcpFromRef(Y);
177 bool bCopyResultX =
false;
178 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 {
276 out <<
"ReorderedBlockMatrix is fillComplete" << std::endl;
278 out <<
"fullRowMap" << std::endl;
285 out <<
"Xpetra::ReorderedBlockedCrsMatrix is NOT fillComplete" << std::endl;
290 out <<
"Block(" << r <<
"," << c <<
")" << std::endl;
298 Teuchos::RCP<const Xpetra::BlockReorderManager >
brm_;
299 Teuchos::RCP<const Xpetra::BlockedCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
fullOp_;
304 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
309 RCP<const Xpetra::MapExtractor<Scalar,LocalOrdinal,GlobalOrdinal,Node> > fullRangeMapExtractor = bmat->getRangeMapExtractor();
312 size_t numBlocks = brm->GetNumBlocks();
314 Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node>> map = Teuchos::null;
320 map = fullRangeMapExtractor->getMap(Teuchos::as<size_t>(leaf->GetIndex()), bThyraMode);
323 std::vector<Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > > subMaps (numBlocks, Teuchos::null);
325 for(
size_t i = 0; i < numBlocks; i++) {
326 Teuchos::RCP<const Xpetra::BlockReorderManager> blkMgr = brm->GetBlock(Teuchos::as<int>(i));
328 TEUCHOS_ASSERT(subMaps[i].is_null()==
false);
346 TEUCHOS_ASSERT(map.is_null()==
false);
350 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
361 size_t rowSz = rowMgr->GetNumBlocks();
362 size_t colSz = colMgr->GetNumBlocks();
364 Teuchos::RCP<BlockedCrsMatrix> rbmat = Teuchos::null;
366 if(rowSz == 0 && colSz == 0) {
368 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
369 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
372 Teuchos::RCP<Matrix> mat = bmat->getMatrix(rowleaf->GetIndex(), colleaf->GetIndex());
374 if (mat == Teuchos::null)
return Teuchos::null;
378 if(matwrap != Teuchos::null) {
381 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
382 Teuchos::RCP<const Map> submap = fullRangeMapExtractor->
getMap(rowleaf->GetIndex(),
false);
383 std::vector<Teuchos::RCP<const Map> > rowSubMaps (1, submap);
384 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::rcp(
new MapExtractor(submap, rowSubMaps,
false));
386 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
387 Teuchos::RCP<const Map> submap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
388 std::vector<Teuchos::RCP<const Map> > colSubMaps (1, submap2);
389 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::rcp(
new MapExtractor(submap2, colSubMaps,
false));
391 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor,doMapExtractor, 33, rowMgr,bmat));
392 rbmat->setMatrix(0,0,mat);
395 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
396 TEUCHOS_ASSERT(rbmat != Teuchos::null);
398 TEUCHOS_ASSERT(mat->getNodeNumEntries() == rbmat->getNodeNumEntries());
402 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::null;
404 std::vector<Teuchos::RCP<const Map> > rowSubMaps (rowSz, Teuchos::null);
405 for(
size_t i = 0; i < rowSz; i++) {
406 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
408 TEUCHOS_ASSERT(rowSubMaps[i].is_null()==
false);
411 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rgMergedSubMaps, rowSubMaps,
false));
413 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
414 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
417 Teuchos::RCP<const Map> submap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
false);
418 std::vector<Teuchos::RCP<const Map> > rowSubMaps (1, submap);
419 rgMapExtractor = Teuchos::rcp(
new MapExtractor(submap, rowSubMaps,
false));
422 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::null;
424 std::vector<Teuchos::RCP<const Map> > colSubMaps (colSz, Teuchos::null);
425 for(
size_t j = 0; j < colSz; j++) {
426 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
428 TEUCHOS_ASSERT(colSubMaps[j].is_null()==
false);
431 doMapExtractor = Teuchos::rcp(
new MapExtractor(doMergedSubMaps, colSubMaps,
false));
433 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
434 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
437 Teuchos::RCP<const Map> submap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
438 std::vector<Teuchos::RCP<const Map> > colSubMaps (1, submap);
439 doMapExtractor = Teuchos::rcp(
new MapExtractor(submap, colSubMaps,
false));
442 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor,doMapExtractor, 33, rowMgr,bmat));
446 if (rowSz == 0 && colSz > 0) {
447 for(
size_t j = 0; j < colSz; j++) {
448 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
449 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowMgr, colSubMgr, bmat);
450 rbmat->setMatrix(0,j,Teuchos::rcp_const_cast<Matrix>(submat));
451 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
453 }
else if (rowSz > 0 && colSz == 0) {
454 for(
size_t i = 0; i < rowSz; i++) {
455 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
456 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowSubMgr, colMgr, bmat);
457 rbmat->setMatrix(i,0,Teuchos::rcp_const_cast<Matrix>(submat));
458 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
461 for(
size_t i = 0; i < rowSz; i++) {
462 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
463 for(
size_t j = 0; j < colSz; j++) {
464 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
465 Teuchos::RCP<const Matrix> submat =
mergeSubBlocks(rowSubMgr, colSubMgr, bmat);
466 rbmat->setMatrix(i,j,Teuchos::rcp_const_cast<Matrix>(submat));
467 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
471 TEUCHOS_ASSERT(rbmat->getNodeNumEntries() == cntNNZ);
473 rbmat->fillComplete();
479 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
488 TEUCHOS_ASSERT(bmat->getRangeMapExtractor()->getThyraMode() ==
true);
489 TEUCHOS_ASSERT(bmat->getDomainMapExtractor()->getThyraMode() ==
true);
492 size_t rowSz = rowMgr->GetNumBlocks();
493 size_t colSz = colMgr->GetNumBlocks();
495 Teuchos::RCP<BlockedCrsMatrix> rbmat = Teuchos::null;
497 if(rowSz == 0 && colSz == 0) {
499 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
500 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
503 Teuchos::RCP<Matrix> mat = bmat->getMatrix(rowleaf->GetIndex(), colleaf->GetIndex());
505 if(mat == Teuchos::null)
return Teuchos::null;
509 if(matwrap != Teuchos::null) {
512 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
514 Teuchos::RCP<const Map> xpsubmap = fullRangeMapExtractor->
getMap(rowleaf->GetIndex(),
false);
515 Teuchos::RCP<const Map> thysubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
true);
516 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (1, xpsubmap);
517 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (1, thysubmap);
519 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
521 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
523 Teuchos::RCP<const Map> xpsubmap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
524 Teuchos::RCP<const Map> tysubmap2 = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
true);
525 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (1, xpsubmap2);
526 std::vector<Teuchos::RCP<const Map> > colTySubMaps (1, tysubmap2);
528 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
532 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor,doMapExtractor, 33, rowMgr,bmat));
533 rbmat->setMatrix(0,0,mat);
536 rbmat = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(mat);
537 TEUCHOS_ASSERT(rbmat != Teuchos::null);
539 TEUCHOS_ASSERT(mat->getNodeNumEntries() == rbmat->getNodeNumEntries());
543 Teuchos::RCP<const MapExtractor> rgMapExtractor = Teuchos::null;
545 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (rowSz, Teuchos::null);
546 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (rowSz, Teuchos::null);
547 for(
size_t i = 0; i < rowSz; i++) {
548 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
552 TEUCHOS_ASSERT(rowXpSubMaps[i].is_null()==
false);
553 TEUCHOS_ASSERT(rowTySubMaps[i].is_null()==
false);
556 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
558 Teuchos::RCP<const Xpetra::BlockReorderLeaf> rowleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(rowMgr);
559 RCP<const MapExtractor> fullRangeMapExtractor = bmat->getRangeMapExtractor();
561 Teuchos::RCP<const Map> xpsubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
false);
562 Teuchos::RCP<const Map> thysubmap = fullRangeMapExtractor->getMap(rowleaf->GetIndex(),
true);
563 std::vector<Teuchos::RCP<const Map> > rowXpSubMaps (1, xpsubmap);
564 std::vector<Teuchos::RCP<const Map> > rowTySubMaps (1, thysubmap);
566 rgMapExtractor = Teuchos::rcp(
new MapExtractor(rowXpSubMaps, rowTySubMaps));
569 Teuchos::RCP<const MapExtractor> doMapExtractor = Teuchos::null;
571 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (colSz, Teuchos::null);
572 std::vector<Teuchos::RCP<const Map> > colTySubMaps (colSz, Teuchos::null);
573 for(
size_t j = 0; j < colSz; j++) {
574 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
578 TEUCHOS_ASSERT(colXpSubMaps[j].is_null()==
false);
579 TEUCHOS_ASSERT(colTySubMaps[j].is_null()==
false);
582 doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps,colTySubMaps));
584 Teuchos::RCP<const Xpetra::BlockReorderLeaf> colleaf = Teuchos::rcp_dynamic_cast<
const Xpetra::BlockReorderLeaf>(colMgr);
585 RCP<const MapExtractor> fullDomainMapExtractor = bmat->getDomainMapExtractor();
587 Teuchos::RCP<const Map> xpsubmap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
false);
588 Teuchos::RCP<const Map> tysubmap = fullDomainMapExtractor->getMap(colleaf->GetIndex(),
true);
589 std::vector<Teuchos::RCP<const Map> > colXpSubMaps (1, xpsubmap);
590 std::vector<Teuchos::RCP<const Map> > colTySubMaps (1, tysubmap);
592 doMapExtractor = Teuchos::rcp(
new MapExtractor(colXpSubMaps, colTySubMaps));
596 rbmat = Teuchos::rcp(
new ReorderedBlockedCrsMatrix(rgMapExtractor,doMapExtractor, 33, rowMgr,bmat));
600 if (rowSz == 0 && colSz > 0) {
601 for(
size_t j = 0; j < colSz; j++) {
602 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
604 rbmat->setMatrix(0,j,Teuchos::rcp_const_cast<Matrix>(submat));
605 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
607 }
else if (rowSz > 0 && colSz == 0) {
608 for(
size_t i = 0; i < rowSz; i++) {
609 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
611 rbmat->setMatrix(i,0,Teuchos::rcp_const_cast<Matrix>(submat));
612 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
615 for(
size_t i = 0; i < rowSz; i++) {
616 Teuchos::RCP<const Xpetra::BlockReorderManager> rowSubMgr = rowMgr->GetBlock(Teuchos::as<int>(i));
617 for(
size_t j = 0; j < colSz; j++) {
618 Teuchos::RCP<const Xpetra::BlockReorderManager> colSubMgr = colMgr->GetBlock(Teuchos::as<int>(j));
620 rbmat->setMatrix(i,j,Teuchos::rcp_const_cast<Matrix>(submat));
621 if(submat != Teuchos::null) cntNNZ += submat->getNodeNumEntries();
625 TEUCHOS_ASSERT(rbmat->getNodeNumEntries() == cntNNZ);
628 rbmat->fillComplete();
632 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
634 TEUCHOS_ASSERT(bmat->getRangeMapExtractor()->getThyraMode() == bmat->getDomainMapExtractor()->getThyraMode());
635 Teuchos::RCP<const Xpetra::Matrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > rbmat = Teuchos::null;
636 if(bmat->getRangeMapExtractor()->getThyraMode() ==
false) {
648 #define XPETRA_REORDEREDBLOCKEDCRSMATRIX_SHORT
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. ...
RCP< const Map > getRangeMap() const
Returns the Map associated with the range of this operator.
const Teuchos::RCP< const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
Teuchos::RCP< const Xpetra::BlockedCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > fullOp_
Xpetra utility class for common map-related routines.
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::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
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)
Teuchos::RCP< Matrix > getMatrix(size_t r, size_t c) const
return block (r,c)
virtual size_t Cols() const
number of column blocks
std::string description() const
Return a simple one-line description of this object.
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
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.
Concrete implementation of Xpetra::Matrix.
virtual size_t Rows() const
number of row blocks
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)
size_t getNodeNumRows() const
Returns the number of matrix rows owned on the calling node.
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)
Constructor.
Xpetra-specific matrix class.
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::BlockReorderManager > brm_