43 #ifndef THYRA_DEFAULT_BLOCKED_LINEAR_OP_DEF_HPP
44 #define THYRA_DEFAULT_BLOCKED_LINEAR_OP_DEF_HPP
47 #include "Thyra_DefaultBlockedLinearOp_decl.hpp"
48 #include "Thyra_DefaultProductVectorSpace.hpp"
49 #include "Thyra_DefaultProductVector.hpp"
50 #include "Thyra_DefaultProductMultiVector.hpp"
51 #include "Thyra_MultiVectorStdOps.hpp"
52 #include "Thyra_VectorStdOps.hpp"
53 #include "Thyra_AssertOp.hpp"
54 #include "Thyra_ScaledAdjointLinearOpBase.hpp"
63 template<
class Scalar>
65 :numRowBlocks_(0), numColBlocks_(0), blockFillIsActive_(false)
72 template<
class Scalar>
75 assertBlockFillIsActive(
false);
81 template<
class Scalar>
83 const int numRowBlocks,
const int numColBlocks
86 assertBlockFillIsActive(
false);
88 resetStorage(numRowBlocks,numColBlocks);
92 template<
class Scalar>
98 using Teuchos::rcp_dynamic_cast;
99 assertBlockFillIsActive(
false);
101 productRange_ = new_productRange.assert_not_null();
102 productDomain_ = new_productDomain.assert_not_null();
103 defaultProductRange_ =
105 defaultProductDomain_ =
108 resetStorage(productRange_->numBlocks(), productDomain_->numBlocks());
112 template<
class Scalar>
115 return blockFillIsActive_;
119 template<
class Scalar>
121 const int i,
const int j
124 assertBlockFillIsActive(
true);
125 assertBlockRowCol(i,j);
130 template<
class Scalar>
132 const int i,
const int j
136 setBlockImpl(i, j, block);
140 template<
class Scalar>
142 const int i,
const int j
146 setBlockImpl(i, j, block);
150 template<
class Scalar>
156 assertBlockFillIsActive(
true);
164 numRowBlocks_ = productRange_->numBlocks();
165 numColBlocks_ = productDomain_->numBlocks();
168 numRowBlocks_ = rangeBlocks_.size();
169 numColBlocks_ = domainBlocks_.size();
179 for (
int i = 0; i < numRowBlocks_; ++i) {
181 !rangeBlocks_[i].
get(), std::logic_error
182 ,
"DefaultBlockedLinearOp<Scalar>::endBlockFill():"
183 " Error, no linear operator block for the i="<<i<<
" block row was added"
184 " and we can not complete the block fill!"
187 for(
int j = 0; j < numColBlocks_; ++j) {
189 !domainBlocks_[j].
get(), std::logic_error
190 ,
"DefaultBlockedLinearOp<Scalar>::endBlockFill():"
191 " Error, no linear operator block for the j="
192 <<j<<
" block column was added"
193 " and we can not complete the block fill!"
200 if (Ops_stack_.size()) {
201 Ops_.resize(numRowBlocks_*numColBlocks_);
202 for (
int k = 0; k < as<int>(Ops_stack_.size()); ++k ) {
203 const BlockEntry<Scalar> &block_i_j = Ops_stack_[k];
204 Ops_[numRowBlocks_*block_i_j.j + block_i_j.i] = block_i_j.block;
206 Ops_stack_.resize(0);
212 defaultProductRange_ = productVectorSpace<Scalar>(rangeBlocks_());
213 defaultProductDomain_ = productVectorSpace<Scalar>(domainBlocks_());
214 productRange_ = defaultProductRange_;
215 productDomain_ = defaultProductDomain_;
218 rangeBlocks_.resize(0);
219 domainBlocks_.resize(0);
221 blockFillIsActive_ =
false;
226 template<
class Scalar>
229 productRange_ = Teuchos::null;
230 productDomain_ = Teuchos::null;
234 Ops_stack_.resize(0);
235 rangeBlocks_.resize(0);
236 domainBlocks_.resize(0);
237 blockFillIsActive_ =
false;
244 template<
class Scalar>
248 return productRange_;
252 template<
class Scalar>
256 return productDomain_;
260 template<
class Scalar>
262 const int i,
const int j
265 assertBlockFillIsActive(
false);
266 assertBlockRowCol(i,j);
271 template<
class Scalar>
273 const int i,
const int j
279 assertBlockFillIsActive(
false);
280 assertBlockRowCol(i,j);
281 return Ops_[numRowBlocks_*j+i].isConst();
285 template<
class Scalar>
292 assertBlockFillIsActive(
false);
293 assertBlockRowCol(i,j);
294 return Ops_[numRowBlocks_*j+i].getNonconstObj();
298 template<
class Scalar>
305 assertBlockFillIsActive(
false);
306 assertBlockRowCol(i,j);
307 return Ops_[numRowBlocks_*j+i];
314 template<
class Scalar>
318 return productRange_;
322 template<
class Scalar>
326 return productDomain_;
330 template<
class Scalar>
334 return Teuchos::null;
341 template<
class Scalar>
344 assertBlockFillIsActive(
false);
345 std::ostringstream oss;
348 <<
"numRowBlocks="<<numRowBlocks_
349 <<
",numColBlocks="<<numColBlocks_
355 template<
class Scalar>
361 using Teuchos::rcpFromRef;
364 assertBlockFillIsActive(
false);
370 *out << this->description() << std::endl;
378 <<
"rangeDim=" << this->range()->dim()
379 <<
",domainDim=" << this->domain()->dim()
380 <<
",numRowBlocks=" << numRowBlocks_
381 <<
",numColBlocks=" << numColBlocks_
385 <<
"Constituent LinearOpBase objects for M = [ Op[0,0] ..."
386 <<
" ; ... ; ... Op[numRowBlocks-1,numColBlocks-1] ]:\n";
388 for(
int i = 0; i < numRowBlocks_; ++i ) {
389 for(
int j = 0; j < numColBlocks_; ++j ) {
390 *out <<
"Op["<<i<<
","<<j<<
"] = ";
392 block_i_j = getBlock(i,j);
394 *out << Teuchos::describe(*getBlock(i,j),verbLevel);
413 template<
class Scalar>
416 bool supported =
true;
417 for(
int i = 0; i < numRowBlocks_; ++i ) {
418 for(
int j = 0; j < numColBlocks_; ++j ) {
420 block_i_j = getBlock(i,j);
421 if( block_i_j.
get() && !Thyra::opSupported(*block_i_j,M_trans) )
429 template<
class Scalar>
439 using Teuchos::rcpFromRef;
447 "DefaultBlockedLinearOp<Scalar>::apply(...)", *
this, M_trans, X_in, &*Y_inout
449 #endif // TEUCHOS_DEBUG
454 opNumRowBlocks = ( !struct_transp ? numRowBlocks_ : numColBlocks_ ),
455 opNumColBlocks = ( !struct_transp ? numColBlocks_ : numRowBlocks_ );
469 ? defaultProductRange_ : defaultProductDomain_ ),
471 ? defaultProductDomain_ : defaultProductRange_ );
474 X = castOrCreateSingleBlockProductMultiVector<Scalar>(
475 defaultProductDomain_op, rcpFromRef(X_in));
477 Y = nonconstCastOrCreateSingleBlockProductMultiVector<Scalar>(
478 defaultProductRange_op, rcpFromPtr(Y_inout));
480 for(
int i = 0; i < opNumRowBlocks; ++i ) {
481 MultiVectorPtr Y_i = Y->getNonconstMultiVectorBlock(i);
482 for(
int j = 0; j < opNumColBlocks; ++j ) {
484 Op_i_j = ( !struct_transp ? getBlock(i,j) : getBlock(j,i) );
486 X_j = X->getMultiVectorBlock(j);
489 Thyra::apply(*Op_i_j, M_trans,* X_j, Y_i.ptr(), alpha, beta);
491 scale(beta, Y_i.ptr());
495 Thyra::apply(*Op_i_j, M_trans, *X_j, Y_i.ptr(), alpha, ST::one());
503 template<
class Scalar>
506 const RowStatLinearOpBaseUtils::ERowStat row_stat)
const
508 using Teuchos::rcpFromRef;
509 using Teuchos::rcp_dynamic_cast;
518 RowStatLinearOpBaseUtils::ERowStat
519 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM,
520 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
522 case RowStatLinearOpBaseUtils::ROW_STAT_INV_ROW_SUM:
523 case RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM:
524 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM;
525 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
527 case RowStatLinearOpBaseUtils::ROW_STAT_INV_COL_SUM:
528 case RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM:
529 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
530 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM;
538 for(
int i = 0; i < numRowBlocks_; ++i ) {
539 for(
int j = 0; j < numColBlocks_; ++j ) {
540 ConstLinearOpPtr Op_i_j = getBlock(i,j);
544 ConstLinearOp * Orig_i_j = 0;
552 RowStatLinearOpBaseUtils::ERowStat stat = subblk_stat;
556 stat = subblk_trans_stat;
558 if(!row_stat_op.rowStatIsSupported(stat))
568 template<
class Scalar>
571 const RowStatLinearOpBaseUtils::ERowStat row_stat,
574 using Teuchos::rcpFromRef;
575 using Teuchos::rcpFromPtr;
576 using Teuchos::rcp_dynamic_cast;
586 RowStatLinearOpBaseUtils::ERowStat
587 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM,
588 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
590 case RowStatLinearOpBaseUtils::ROW_STAT_INV_ROW_SUM:
591 case RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM:
592 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM;
593 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
595 case RowStatLinearOpBaseUtils::ROW_STAT_INV_COL_SUM:
596 case RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM:
597 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
598 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM;
609 for(
int i = 0; i < numRowBlocks_; ++i ) {
610 VectorPtr blk_vec = Y->getNonconstVectorBlock(i);
611 put_scalar (ST::zero (), blk_vec.ptr ());
613 for(
int j = 0; j < numColBlocks_; ++j ) {
614 ConstLinearOpPtr Op_i_j = getBlock(i,j);
616 VectorPtr tmp_vec = createMember(Op_i_j->range());
618 put_scalar (ST::zero (), tmp_vec.ptr ());
622 ConstLinearOp * Orig_i_j = 0;
631 row_stat_op.getRowStat(subblk_stat,tmp_vec.ptr());
633 row_stat_op.getRowStat(subblk_trans_stat,tmp_vec.ptr());
638 Vp_V(blk_vec.ptr(),*tmp_vec);
645 case RowStatLinearOpBaseUtils::ROW_STAT_INV_ROW_SUM:
646 case RowStatLinearOpBaseUtils::ROW_STAT_INV_COL_SUM:
647 reciprocal(*rowStatVec,rowStatVec.ptr());
648 case RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM:
649 case RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM:
658 template<
class Scalar>
662 using Teuchos::rcp_dynamic_cast;
668 bool supported =
true;
669 for(
int i = 0; i < numRowBlocks_; ++i ) {
670 for(
int j = 0; j < numColBlocks_; ++j ) {
671 LinearOpPtr Op_i_j = getBlock(i,j);
677 LinearOp * Orig_i_j = 0;
684 supported &= scaled_op.supportsScaleLeft();
686 supported &= scaled_op.supportsScaleRight();
694 template<
class Scalar>
698 using Teuchos::rcp_dynamic_cast;
704 bool supported =
true;
705 for(
int i = 0; i < numRowBlocks_; ++i ) {
706 for(
int j = 0; j < numColBlocks_; ++j ) {
707 LinearOpPtr Op_i_j = getBlock(i,j);
711 LinearOp * Orig_i_j = 0;
719 supported &= scaled_op.supportsScaleRight();
721 supported &= scaled_op.supportsScaleLeft();
729 template<
class Scalar>
735 using Teuchos::rcp_dynamic_cast;
745 for(
int i = 0; i < numRowBlocks_; ++i ) {
748 for(
int j = 0; j < numColBlocks_; ++j ) {
749 LinearOpPtr Op_i_j = getNonconstBlock(i,j);
753 LinearOpPtr Orig_i_j;
760 transp = saOp->overallTransp();
761 Orig_i_j = saOp->getNonconstOrigOp();
767 RCP<ScaledOp> scaled_op = rcp_dynamic_cast<ScaledOp>(Orig_i_j);
774 scaled_op->scaleLeft(*blk_vec);
776 scaled_op->scaleRight(*blk_vec);
782 template<
class Scalar>
788 using Teuchos::rcp_dynamic_cast;
798 for(
int j = 0; j < numColBlocks_; ++j ) {
801 for(
int i = 0; i < numRowBlocks_; ++i ) {
802 LinearOpPtr Op_i_j = getNonconstBlock(i,j);
806 LinearOpPtr Orig_i_j;
813 transp = saOp->overallTransp();
814 Orig_i_j = saOp->getNonconstOrigOp();
820 RCP<ScaledOp> scaled_op = rcp_dynamic_cast<ScaledOp>(Orig_i_j);
827 scaled_op->scaleRight(*blk_vec);
829 scaled_op->scaleLeft(*blk_vec);
838 template<
class Scalar>
840 const int numRowBlocks,
const int numColBlocks
843 numRowBlocks_ = numRowBlocks;
844 numColBlocks_ = numColBlocks;
845 Ops_.resize(numRowBlocks_*numColBlocks_);
847 rangeBlocks_.resize(numRowBlocks);
848 domainBlocks_.resize(numColBlocks);
850 blockFillIsActive_ =
true;
854 template<
class Scalar>
855 void DefaultBlockedLinearOp<Scalar>::assertBlockFillIsActive(
867 template<
class Scalar>
868 void DefaultBlockedLinearOp<Scalar>::assertBlockRowCol(
869 const int i,
const int j
874 !( 0 <= i ), std::logic_error
875 ,
"Error, i="<<i<<
" is invalid!"
878 !( 0 <= j ), std::logic_error
879 ,
"Error, j="<<j<<
" is invalid!"
885 !( 0 <= i && i < numRowBlocks_ ), std::logic_error
886 ,
"Error, i="<<i<<
" does not fall in the range [0,"<<numRowBlocks_-1<<
"]!"
889 !( 0 <= j && j < numColBlocks_ ), std::logic_error
890 ,
"Error, j="<<j<<
" does not fall in the range [0,"<<numColBlocks_-1<<
"]!"
900 template<
class Scalar>
901 void DefaultBlockedLinearOp<Scalar>::setBlockSpaces(
902 const int i,
const int j,
const LinearOpBase<Scalar> &block
906 assertBlockFillIsActive(
true);
907 assertBlockRowCol(i,j);
911 if( i < numRowBlocks_ && j < numColBlocks_ ) {
913 RCP<const VectorSpaceBase<Scalar> >
916 ? productRange_->getBlock(i)
921 ? productDomain_->getBlock(j)
924 if(rangeBlock.get()) {
926 "DefaultBlockedLinearOp<Scalar>::setBlockSpaces(i,j,block):\n\n"
927 "Adding block: " + block.description(),
928 *rangeBlock,(
"(*productRange->getBlock("+
toString(i)+
"))"),
932 if(domainBlock.get()) {
934 "DefaultBlockedLinearOp<Scalar>::setBlockSpaces(i,j,block):\n\n"
935 "Adding block: " + block.description(),
936 *domainBlock,(
"(*productDomain->getBlock("+
toString(j)+
"))"),
940 #endif // TEUCHOS_DEBUG
945 for(
int k = numRowBlocks_; k <= i; ++k )
946 rangeBlocks_.push_back(Teuchos::null);
947 for(
int k = numColBlocks_; k <= j; ++k )
948 domainBlocks_.push_back(Teuchos::null);
951 if(!productRange_.get()) {
952 if(!rangeBlocks_[i].
get())
953 rangeBlocks_[i] = block.range().assert_not_null();
954 if(!domainBlocks_[j].
get()) {
955 domainBlocks_[j] = block.domain().assert_not_null();
962 numRowBlocks_ = rangeBlocks_.size();
963 numColBlocks_ = domainBlocks_.size();
969 template<
class Scalar>
970 template<
class LinearOpType>
971 void DefaultBlockedLinearOp<Scalar>::setBlockImpl(
972 const int i,
const int j,
973 const RCP<LinearOpType> &block
976 setBlockSpaces(i, j, *block);
980 Ops_[numRowBlocks_*j+i] = block;
985 bool foundBlock =
false;
986 for(
unsigned int k = 0; k < Ops_stack_.size(); ++k ) {
987 BlockEntry<Scalar> &block_i_j = Ops_stack_[k];
988 if( block_i_j.i == i && block_i_j.j == j ) {
989 block_i_j.block = block;
995 Ops_stack_.push_back(BlockEntry<Scalar>(i,j,block));
1000 template<
class Scalar>
1001 void DefaultBlockedLinearOp<Scalar>::adjustBlockSpaces()
1004 #ifdef TEUCHOS_DEBUG
1020 for (
int i = 0; i < numRowBlocks_; ++i) {
1021 for (
int j = 0; j < numColBlocks_; ++j) {
1022 const RCP<const LinearOpBase<Scalar> >
1023 op_i_j = Ops_[numRowBlocks_*j+i];
1026 const RCP<const VectorSpaceBase<Scalar> > range_i_j = op_i_j->range();
1027 if (
is_null(productVectorSpaceBase<Scalar>(range_i_j,
false))) {
1028 rangeBlocks_[i] = range_i_j;
1035 for (
int j = 0; j < numColBlocks_; ++j) {
1036 for (
int i = 0; i < numRowBlocks_; ++i) {
1037 const RCP<const LinearOpBase<Scalar> >
1038 op_i_j = Ops_[numRowBlocks_*j+i];
1041 const RCP<const VectorSpaceBase<Scalar> >
1042 domain_i_j = op_i_j->domain();
1043 if (
is_null(productVectorSpaceBase<Scalar>(domain_i_j,
false))) {
1044 domainBlocks_[j] = domain_i_j;
1056 template<
class Scalar>
1058 Thyra::defaultBlockedLinearOp()
1060 return Teuchos::rcp(
new DefaultBlockedLinearOp<Scalar>());
1064 template<
class Scalar>
1067 const RCP<
const LinearOpBase<Scalar> > &A00,
1068 const std::string &label
1071 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1072 M = defaultBlockedLinearOp<Scalar>();
1073 M->beginBlockFill(1,1);
1074 M->setBlock(0, 0, A00);
1077 M->setObjectLabel(label);
1082 template<
class Scalar>
1085 const RCP<
const LinearOpBase<Scalar> > &A00,
1086 const RCP<
const LinearOpBase<Scalar> > &A01,
1087 const std::string &label
1090 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1091 M = defaultBlockedLinearOp<Scalar>();
1092 M->beginBlockFill(1,2);
1093 if(A00.get()) M->setBlock(0,0,A00);
1094 if(A01.get()) M->setBlock(0,1,A01);
1097 M->setObjectLabel(label);
1102 template<
class Scalar>
1105 const RCP<
const LinearOpBase<Scalar> > &A00,
1106 const RCP<
const LinearOpBase<Scalar> > &A10,
1107 const std::string &label
1110 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1111 M = defaultBlockedLinearOp<Scalar>();
1112 M->beginBlockFill(2,1);
1113 if(A00.get()) M->setBlock(0,0,A00);
1114 if(A10.get()) M->setBlock(1,0,A10);
1117 M->setObjectLabel(label);
1122 template<
class Scalar>
1125 const RCP<
const LinearOpBase<Scalar> > &A00,
1126 const RCP<
const LinearOpBase<Scalar> > &A01,
1127 const RCP<
const LinearOpBase<Scalar> > &A10,
1128 const RCP<
const LinearOpBase<Scalar> > &A11,
1129 const std::string &label
1132 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1133 M = defaultBlockedLinearOp<Scalar>();
1134 M->beginBlockFill(2,2);
1135 if(A00.get()) M->setBlock(0,0,A00);
1136 if(A01.get()) M->setBlock(0,1,A01);
1137 if(A10.get()) M->setBlock(1,0,A10);
1138 if(A11.get()) M->setBlock(1,1,A11);
1141 M->setObjectLabel(label);
1146 template<
class Scalar>
1148 Thyra::nonconstBlock1x1(
1149 const RCP<LinearOpBase<Scalar> > &A00,
1150 const std::string &label
1153 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1154 M = defaultBlockedLinearOp<Scalar>();
1155 M->beginBlockFill(1, 1);
1156 M->setNonconstBlock(0, 0, A00);
1159 M->setObjectLabel(label);
1164 template<
class Scalar>
1166 Thyra::nonconstBlock1x2(
1167 const RCP<LinearOpBase<Scalar> > &A00,
1168 const RCP<LinearOpBase<Scalar> > &A01,
1169 const std::string &label
1172 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1173 M = defaultBlockedLinearOp<Scalar>();
1174 M->beginBlockFill(1,2);
1175 if(A00.get()) M->setNonconstBlock(0,0,A00);
1176 if(A01.get()) M->setNonconstBlock(0,1,A01);
1179 M->setObjectLabel(label);
1184 template<
class Scalar>
1186 Thyra::nonconstBlock2x1(
1187 const RCP<LinearOpBase<Scalar> > &A00,
1188 const RCP<LinearOpBase<Scalar> > &A10,
1189 const std::string &label
1192 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1193 M = defaultBlockedLinearOp<Scalar>();
1194 M->beginBlockFill(2,1);
1195 if(A00.get()) M->setNonconstBlock(0,0,A00);
1196 if(A10.get()) M->setNonconstBlock(1,0,A10);
1199 M->setObjectLabel(label);
1204 template<
class Scalar>
1206 Thyra::nonconstBlock2x2(
1207 const RCP<LinearOpBase<Scalar> > &A00,
1208 const RCP<LinearOpBase<Scalar> > &A01,
1209 const RCP<LinearOpBase<Scalar> > &A10,
1210 const RCP<LinearOpBase<Scalar> > &A11,
1211 const std::string &label
1214 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1215 M = defaultBlockedLinearOp<Scalar>();
1216 M->beginBlockFill(2,2);
1217 if(A00.get()) M->setNonconstBlock(0,0,A00);
1218 if(A01.get()) M->setNonconstBlock(0,1,A01);
1219 if(A10.get()) M->setNonconstBlock(1,0,A10);
1220 if(A11.get()) M->setNonconstBlock(1,1,A11);
1223 M->setObjectLabel(label);
1235 #define THYRA_DEFAULT_BLOCKED_LINEAR_OP_INSTANT(SCALAR) \
1237 template class DefaultBlockedLinearOp<SCALAR >; \
1239 template RCP<DefaultBlockedLinearOp<SCALAR > > \
1240 defaultBlockedLinearOp<SCALAR >(); \
1242 template RCP<const LinearOpBase<SCALAR > > \
1244 const RCP<const LinearOpBase<SCALAR > > &A00, \
1245 const std::string &label \
1248 template RCP<const LinearOpBase<SCALAR > > \
1250 const RCP<const LinearOpBase<SCALAR > > &A00, \
1251 const RCP<const LinearOpBase<SCALAR > > &A01, \
1252 const std::string &label \
1255 template RCP<const LinearOpBase<SCALAR > > \
1257 const RCP<const LinearOpBase<SCALAR > > &A00, \
1258 const RCP<const LinearOpBase<SCALAR > > &A10, \
1259 const std::string &label \
1262 template RCP<const LinearOpBase<SCALAR > > \
1264 const RCP<const LinearOpBase<SCALAR > > &A00, \
1265 const RCP<const LinearOpBase<SCALAR > > &A01, \
1266 const RCP<const LinearOpBase<SCALAR > > &A10, \
1267 const RCP<const LinearOpBase<SCALAR > > &A11, \
1268 const std::string &label \
1271 template RCP<LinearOpBase<SCALAR > > \
1273 const RCP<LinearOpBase<SCALAR > > &A00, \
1274 const std::string &label \
1277 template RCP<LinearOpBase<SCALAR > > \
1279 const RCP<LinearOpBase<SCALAR > > &A00, \
1280 const RCP<LinearOpBase<SCALAR > > &A01, \
1281 const std::string &label \
1284 template RCP<LinearOpBase<SCALAR > > \
1286 const RCP<LinearOpBase<SCALAR > > &A00, \
1287 const RCP<LinearOpBase<SCALAR > > &A10, \
1288 const std::string &label \
1291 template RCP<LinearOpBase<SCALAR > > \
1293 const RCP<LinearOpBase<SCALAR > > &A00, \
1294 const RCP<LinearOpBase<SCALAR > > &A01, \
1295 const RCP<LinearOpBase<SCALAR > > &A10, \
1296 const RCP<LinearOpBase<SCALAR > > &A11, \
1297 const std::string &label \
1301 #endif // THYRA_DEFAULT_BLOCKED_LINEAR_OP_DEF_HPP
bool blockExists(const int i, const int j) const
bool is_null(const boost::shared_ptr< T > &p)
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
Base interface for product vectors.
basic_OSTab< char > OSTab
Teuchos::RCP< const ProductVectorSpaceBase< Scalar > > productRange() const
void unwrap(const LinearOpBase< Scalar > &Op, Scalar *scalar, EOpTransp *transp, const LinearOpBase< Scalar > **origOp)
Extract the overallScalar, overallTransp and const origOp from a const LinearOpBase object...
#define THYRA_ASSERT_LINEAR_OP_MULTIVEC_APPLY_SPACES(FUNC_NAME, M, M_T, X, Y)
This is a very useful macro that should be used to validate that the spaces for the multi-vector vers...
virtual RCP< const VectorBase< Scalar > > getVectorBlock(const int k) const =0
Returns a non-persisting const view of the (zero-based) kth block vector.
bool acceptsBlock(const int i, const int j) const
void applyImpl(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
#define TEUCHOS_ASSERT_INEQUALITY(val1, comp, val2)
basic_FancyOStream< char > FancyOStream
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Use the non-transposed operator.
T_To & dyn_cast(T_From &from)
virtual bool supportsScaleLeftImpl() const
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Prints the details about the constituent linear operators.
EOpTransp real_trans(EOpTransp transp)
Return NOTRANS or TRANS for real scalar valued operators and this also is used for determining struct...
Use the transposed operator with complex-conjugate clements (same as TRANS for real scalar types)...
Use the non-transposed operator with complex-conjugate elements (same as NOTRANS for real scalar type...
Use the transposed operator.
virtual void getRowStatImpl(const RowStatLinearOpBaseUtils::ERowStat rowStat, const Teuchos::Ptr< VectorBase< Scalar > > &rowStatVec) const
bool blockIsConst(const int i, const int j) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void setNonconstBlock(const int i, const int j, const Teuchos::RCP< LinearOpBase< Scalar > > &block)
Interface for a collection of column vectors called a multi-vector.
Base class for LinearOpBase decorator subclasses that wrap a LinearOpBase object and adds on an extra...
std::string description() const
Prints just the name DefaultBlockedLinearOp along with the overall dimensions and the number of const...
virtual std::string description() const
Abstract interface for finite-dimensional dense vectors.
TEUCHOSCORE_LIB_DLL_EXPORT std::string toString(const EVerbosityLevel verbLevel)
Teuchos::RCP< const LinearOpBase< Scalar > > clone() const
Teuchos::RCP< const VectorSpaceBase< Scalar > > domain() const
Base class for all linear operators.
bool blockFillIsActive() const
Applies left or right sclaing to the linear operator.
Teuchos::RCP< const ProductVectorSpaceBase< Scalar > > productDomain() const
Teuchos::RCP< const VectorSpaceBase< Scalar > > range() const
bool nonnull(const boost::shared_ptr< T > &p)
virtual void scaleLeftImpl(const VectorBase< Scalar > &row_scaling)
TypeTo as(const TypeFrom &t)
virtual void scaleRightImpl(const VectorBase< Scalar > &col_scaling)
bool opSupportedImpl(EOpTransp M_trans) const
Returns true only if all constituent operators support M_trans.
Interface for exxtracting row statistics as a VectorBase from a supporting LinearOpBase object...
#define THYRA_ASSERT_VEC_SPACES_NAMES(FUNC_NAME, VS1, VS1_NAME, VS2, VS2_NAME)
Helper assertion macro.
virtual bool rowStatIsSupportedImpl(const RowStatLinearOpBaseUtils::ERowStat rowStat) const
Teuchos::RCP< LinearOpBase< Scalar > > getNonconstBlock(const int i, const int j)
#define TEUCHOS_ASSERT(assertion_test)
void setBlock(const int i, const int j, const Teuchos::RCP< const LinearOpBase< Scalar > > &block)
virtual bool supportsScaleRightImpl() const
Concrete composite LinearOpBase subclass that creates single linear operator object out of a set of c...
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
std::string toString(const T &t)
Teuchos::RCP< const LinearOpBase< Scalar > > getBlock(const int i, const int j) const