10 #ifndef THYRA_DEFAULT_BLOCKED_LINEAR_OP_DEF_HPP
11 #define THYRA_DEFAULT_BLOCKED_LINEAR_OP_DEF_HPP
14 #include "Thyra_DefaultBlockedLinearOp_decl.hpp"
15 #include "Thyra_DefaultProductVectorSpace.hpp"
16 #include "Thyra_DefaultProductVector.hpp"
17 #include "Thyra_DefaultProductMultiVector.hpp"
18 #include "Thyra_MultiVectorStdOps.hpp"
19 #include "Thyra_VectorStdOps.hpp"
20 #include "Thyra_AssertOp.hpp"
21 #include "Thyra_ScaledAdjointLinearOpBase.hpp"
30 template<
class Scalar>
32 :numRowBlocks_(0), numColBlocks_(0), blockFillIsActive_(false)
39 template<
class Scalar>
42 assertBlockFillIsActive(
false);
48 template<
class Scalar>
50 const int numRowBlocks,
const int numColBlocks
53 assertBlockFillIsActive(
false);
55 resetStorage(numRowBlocks,numColBlocks);
59 template<
class Scalar>
65 using Teuchos::rcp_dynamic_cast;
66 assertBlockFillIsActive(
false);
68 productRange_ = new_productRange.assert_not_null();
69 productDomain_ = new_productDomain.assert_not_null();
70 defaultProductRange_ =
72 defaultProductDomain_ =
75 resetStorage(productRange_->numBlocks(), productDomain_->numBlocks());
79 template<
class Scalar>
82 return blockFillIsActive_;
86 template<
class Scalar>
88 const int i,
const int j
91 assertBlockFillIsActive(
true);
92 assertBlockRowCol(i,j);
97 template<
class Scalar>
99 const int i,
const int j
103 setBlockImpl(i, j, block);
107 template<
class Scalar>
109 const int i,
const int j
113 setBlockImpl(i, j, block);
117 template<
class Scalar>
123 assertBlockFillIsActive(
true);
131 numRowBlocks_ = productRange_->numBlocks();
132 numColBlocks_ = productDomain_->numBlocks();
135 numRowBlocks_ = rangeBlocks_.size();
136 numColBlocks_ = domainBlocks_.size();
146 for (
int i = 0; i < numRowBlocks_; ++i) {
148 !rangeBlocks_[i].
get(), std::logic_error
149 ,
"DefaultBlockedLinearOp<Scalar>::endBlockFill():"
150 " Error, no linear operator block for the i="<<i<<
" block row was added"
151 " and we can not complete the block fill!"
154 for(
int j = 0; j < numColBlocks_; ++j) {
156 !domainBlocks_[j].
get(), std::logic_error
157 ,
"DefaultBlockedLinearOp<Scalar>::endBlockFill():"
158 " Error, no linear operator block for the j="
159 <<j<<
" block column was added"
160 " and we can not complete the block fill!"
167 if (Ops_stack_.size()) {
168 Ops_.resize(numRowBlocks_*numColBlocks_);
169 for (
int k = 0; k < as<int>(Ops_stack_.size()); ++k ) {
170 const BlockEntry<Scalar> &block_i_j = Ops_stack_[k];
171 Ops_[numRowBlocks_*block_i_j.j + block_i_j.i] = block_i_j.block;
173 Ops_stack_.resize(0);
179 defaultProductRange_ = productVectorSpace<Scalar>(rangeBlocks_());
180 defaultProductDomain_ = productVectorSpace<Scalar>(domainBlocks_());
181 productRange_ = defaultProductRange_;
182 productDomain_ = defaultProductDomain_;
185 rangeBlocks_.resize(0);
186 domainBlocks_.resize(0);
188 blockFillIsActive_ =
false;
193 template<
class Scalar>
196 productRange_ = Teuchos::null;
197 productDomain_ = Teuchos::null;
201 Ops_stack_.resize(0);
202 rangeBlocks_.resize(0);
203 domainBlocks_.resize(0);
204 blockFillIsActive_ =
false;
211 template<
class Scalar>
215 return productRange_;
219 template<
class Scalar>
223 return productDomain_;
227 template<
class Scalar>
229 const int i,
const int j
232 assertBlockFillIsActive(
false);
233 assertBlockRowCol(i,j);
238 template<
class Scalar>
240 const int i,
const int j
246 assertBlockFillIsActive(
false);
247 assertBlockRowCol(i,j);
248 return Ops_[numRowBlocks_*j+i].isConst();
252 template<
class Scalar>
259 assertBlockFillIsActive(
false);
260 assertBlockRowCol(i,j);
261 return Ops_[numRowBlocks_*j+i].getNonconstObj();
265 template<
class Scalar>
272 assertBlockFillIsActive(
false);
273 assertBlockRowCol(i,j);
274 return Ops_[numRowBlocks_*j+i];
281 template<
class Scalar>
285 return productRange_;
289 template<
class Scalar>
293 return productDomain_;
297 template<
class Scalar>
301 return Teuchos::null;
308 template<
class Scalar>
311 assertBlockFillIsActive(
false);
312 std::ostringstream oss;
315 <<
"numRowBlocks="<<numRowBlocks_
316 <<
",numColBlocks="<<numColBlocks_
322 template<
class Scalar>
328 using Teuchos::rcpFromRef;
331 assertBlockFillIsActive(
false);
337 *out << this->description() << std::endl;
345 <<
"rangeDim=" << this->range()->dim()
346 <<
",domainDim=" << this->domain()->dim()
347 <<
",numRowBlocks=" << numRowBlocks_
348 <<
",numColBlocks=" << numColBlocks_
352 <<
"Constituent LinearOpBase objects for M = [ Op[0,0] ..."
353 <<
" ; ... ; ... Op[numRowBlocks-1,numColBlocks-1] ]:\n";
355 for(
int i = 0; i < numRowBlocks_; ++i ) {
356 for(
int j = 0; j < numColBlocks_; ++j ) {
357 *out <<
"Op["<<i<<
","<<j<<
"] = ";
359 block_i_j = getBlock(i,j);
361 *out << Teuchos::describe(*getBlock(i,j),verbLevel);
380 template<
class Scalar>
383 bool supported =
true;
384 for(
int i = 0; i < numRowBlocks_; ++i ) {
385 for(
int j = 0; j < numColBlocks_; ++j ) {
387 block_i_j = getBlock(i,j);
388 if( block_i_j.
get() && !Thyra::opSupported(*block_i_j,M_trans) )
396 template<
class Scalar>
406 using Teuchos::rcpFromRef;
414 "DefaultBlockedLinearOp<Scalar>::apply(...)", *
this, M_trans, X_in, &*Y_inout
416 #endif // TEUCHOS_DEBUG
421 opNumRowBlocks = ( !struct_transp ? numRowBlocks_ : numColBlocks_ ),
422 opNumColBlocks = ( !struct_transp ? numColBlocks_ : numRowBlocks_ );
436 ? defaultProductRange_ : defaultProductDomain_ ),
438 ? defaultProductDomain_ : defaultProductRange_ );
441 X = castOrCreateSingleBlockProductMultiVector<Scalar>(
442 defaultProductDomain_op, rcpFromRef(X_in));
444 Y = nonconstCastOrCreateSingleBlockProductMultiVector<Scalar>(
445 defaultProductRange_op, rcpFromPtr(Y_inout));
447 for(
int i = 0; i < opNumRowBlocks; ++i ) {
448 MultiVectorPtr Y_i = Y->getNonconstMultiVectorBlock(i);
449 for(
int j = 0; j < opNumColBlocks; ++j ) {
451 Op_i_j = ( !struct_transp ? getBlock(i,j) : getBlock(j,i) );
453 X_j = X->getMultiVectorBlock(j);
456 Thyra::apply(*Op_i_j, M_trans,* X_j, Y_i.ptr(), alpha, beta);
458 scale(beta, Y_i.ptr());
462 Thyra::apply(*Op_i_j, M_trans, *X_j, Y_i.ptr(), alpha, ST::one());
470 template<
class Scalar>
473 const RowStatLinearOpBaseUtils::ERowStat row_stat)
const
475 using Teuchos::rcpFromRef;
476 using Teuchos::rcp_dynamic_cast;
485 RowStatLinearOpBaseUtils::ERowStat
486 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM,
487 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
489 case RowStatLinearOpBaseUtils::ROW_STAT_INV_ROW_SUM:
490 case RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM:
491 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM;
492 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
494 case RowStatLinearOpBaseUtils::ROW_STAT_INV_COL_SUM:
495 case RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM:
496 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
497 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM;
505 for(
int i = 0; i < numRowBlocks_; ++i ) {
506 for(
int j = 0; j < numColBlocks_; ++j ) {
507 ConstLinearOpPtr Op_i_j = getBlock(i,j);
511 ConstLinearOp * Orig_i_j = 0;
519 RowStatLinearOpBaseUtils::ERowStat stat = subblk_stat;
523 stat = subblk_trans_stat;
525 if(!row_stat_op.rowStatIsSupported(stat))
535 template<
class Scalar>
538 const RowStatLinearOpBaseUtils::ERowStat row_stat,
541 using Teuchos::rcpFromRef;
542 using Teuchos::rcpFromPtr;
543 using Teuchos::rcp_dynamic_cast;
553 RowStatLinearOpBaseUtils::ERowStat
554 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM,
555 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
557 case RowStatLinearOpBaseUtils::ROW_STAT_INV_ROW_SUM:
558 case RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM:
559 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM;
560 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
562 case RowStatLinearOpBaseUtils::ROW_STAT_INV_COL_SUM:
563 case RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM:
564 subblk_stat = RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM;
565 subblk_trans_stat = RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM;
576 for(
int i = 0; i < numRowBlocks_; ++i ) {
577 VectorPtr blk_vec = Y->getNonconstVectorBlock(i);
578 put_scalar (ST::zero (), blk_vec.ptr ());
580 for(
int j = 0; j < numColBlocks_; ++j ) {
581 ConstLinearOpPtr Op_i_j = getBlock(i,j);
583 VectorPtr tmp_vec = createMember(Op_i_j->range());
585 put_scalar (ST::zero (), tmp_vec.ptr ());
589 ConstLinearOp * Orig_i_j = 0;
598 row_stat_op.getRowStat(subblk_stat,tmp_vec.ptr());
600 row_stat_op.getRowStat(subblk_trans_stat,tmp_vec.ptr());
605 Vp_V(blk_vec.ptr(),*tmp_vec);
612 case RowStatLinearOpBaseUtils::ROW_STAT_INV_ROW_SUM:
613 case RowStatLinearOpBaseUtils::ROW_STAT_INV_COL_SUM:
614 reciprocal(*rowStatVec,rowStatVec.ptr());
615 case RowStatLinearOpBaseUtils::ROW_STAT_ROW_SUM:
616 case RowStatLinearOpBaseUtils::ROW_STAT_COL_SUM:
625 template<
class Scalar>
629 using Teuchos::rcp_dynamic_cast;
635 bool supported =
true;
636 for(
int i = 0; i < numRowBlocks_; ++i ) {
637 for(
int j = 0; j < numColBlocks_; ++j ) {
638 LinearOpPtr Op_i_j = getBlock(i,j);
644 LinearOp * Orig_i_j = 0;
651 supported &= scaled_op.supportsScaleLeft();
653 supported &= scaled_op.supportsScaleRight();
661 template<
class Scalar>
665 using Teuchos::rcp_dynamic_cast;
671 bool supported =
true;
672 for(
int i = 0; i < numRowBlocks_; ++i ) {
673 for(
int j = 0; j < numColBlocks_; ++j ) {
674 LinearOpPtr Op_i_j = getBlock(i,j);
678 LinearOp * Orig_i_j = 0;
686 supported &= scaled_op.supportsScaleRight();
688 supported &= scaled_op.supportsScaleLeft();
696 template<
class Scalar>
702 using Teuchos::rcp_dynamic_cast;
712 for(
int i = 0; i < numRowBlocks_; ++i ) {
715 for(
int j = 0; j < numColBlocks_; ++j ) {
716 LinearOpPtr Op_i_j = getNonconstBlock(i,j);
720 LinearOpPtr Orig_i_j;
727 transp = saOp->overallTransp();
728 Orig_i_j = saOp->getNonconstOrigOp();
734 RCP<ScaledOp> scaled_op = rcp_dynamic_cast<ScaledOp>(Orig_i_j);
741 scaled_op->scaleLeft(*blk_vec);
743 scaled_op->scaleRight(*blk_vec);
749 template<
class Scalar>
755 using Teuchos::rcp_dynamic_cast;
765 for(
int j = 0; j < numColBlocks_; ++j ) {
768 for(
int i = 0; i < numRowBlocks_; ++i ) {
769 LinearOpPtr Op_i_j = getNonconstBlock(i,j);
773 LinearOpPtr Orig_i_j;
780 transp = saOp->overallTransp();
781 Orig_i_j = saOp->getNonconstOrigOp();
787 RCP<ScaledOp> scaled_op = rcp_dynamic_cast<ScaledOp>(Orig_i_j);
794 scaled_op->scaleRight(*blk_vec);
796 scaled_op->scaleLeft(*blk_vec);
805 template<
class Scalar>
807 const int numRowBlocks,
const int numColBlocks
810 numRowBlocks_ = numRowBlocks;
811 numColBlocks_ = numColBlocks;
812 Ops_.resize(numRowBlocks_*numColBlocks_);
814 rangeBlocks_.resize(numRowBlocks);
815 domainBlocks_.resize(numColBlocks);
817 blockFillIsActive_ =
true;
821 template<
class Scalar>
822 void DefaultBlockedLinearOp<Scalar>::assertBlockFillIsActive(
834 template<
class Scalar>
835 void DefaultBlockedLinearOp<Scalar>::assertBlockRowCol(
836 const int i,
const int j
841 !( 0 <= i ), std::logic_error
842 ,
"Error, i="<<i<<
" is invalid!"
845 !( 0 <= j ), std::logic_error
846 ,
"Error, j="<<j<<
" is invalid!"
852 !( 0 <= i && i < numRowBlocks_ ), std::logic_error
853 ,
"Error, i="<<i<<
" does not fall in the range [0,"<<numRowBlocks_-1<<
"]!"
856 !( 0 <= j && j < numColBlocks_ ), std::logic_error
857 ,
"Error, j="<<j<<
" does not fall in the range [0,"<<numColBlocks_-1<<
"]!"
867 template<
class Scalar>
868 void DefaultBlockedLinearOp<Scalar>::setBlockSpaces(
869 const int i,
const int j,
const LinearOpBase<Scalar> &block
873 assertBlockFillIsActive(
true);
874 assertBlockRowCol(i,j);
878 if( i < numRowBlocks_ && j < numColBlocks_ ) {
880 RCP<const VectorSpaceBase<Scalar> >
883 ? productRange_->getBlock(i)
888 ? productDomain_->getBlock(j)
891 if(rangeBlock.get()) {
893 "DefaultBlockedLinearOp<Scalar>::setBlockSpaces(i,j,block):\n\n"
894 "Adding block: " + block.description(),
895 *rangeBlock,(
"(*productRange->getBlock("+
toString(i)+
"))"),
899 if(domainBlock.get()) {
901 "DefaultBlockedLinearOp<Scalar>::setBlockSpaces(i,j,block):\n\n"
902 "Adding block: " + block.description(),
903 *domainBlock,(
"(*productDomain->getBlock("+
toString(j)+
"))"),
907 #endif // TEUCHOS_DEBUG
912 for(
int k = numRowBlocks_; k <= i; ++k )
913 rangeBlocks_.push_back(Teuchos::null);
914 for(
int k = numColBlocks_; k <= j; ++k )
915 domainBlocks_.push_back(Teuchos::null);
918 if(!productRange_.get()) {
919 if(!rangeBlocks_[i].
get())
920 rangeBlocks_[i] = block.range().assert_not_null();
921 if(!domainBlocks_[j].
get()) {
922 domainBlocks_[j] = block.domain().assert_not_null();
929 numRowBlocks_ = rangeBlocks_.size();
930 numColBlocks_ = domainBlocks_.size();
936 template<
class Scalar>
937 template<
class LinearOpType>
938 void DefaultBlockedLinearOp<Scalar>::setBlockImpl(
939 const int i,
const int j,
940 const RCP<LinearOpType> &block
943 setBlockSpaces(i, j, *block);
947 Ops_[numRowBlocks_*j+i] = block;
952 bool foundBlock =
false;
953 for(
unsigned int k = 0; k < Ops_stack_.size(); ++k ) {
954 BlockEntry<Scalar> &block_i_j = Ops_stack_[k];
955 if( block_i_j.i == i && block_i_j.j == j ) {
956 block_i_j.block = block;
962 Ops_stack_.push_back(BlockEntry<Scalar>(i,j,block));
967 template<
class Scalar>
968 void DefaultBlockedLinearOp<Scalar>::adjustBlockSpaces()
987 for (
int i = 0; i < numRowBlocks_; ++i) {
988 for (
int j = 0; j < numColBlocks_; ++j) {
989 const RCP<const LinearOpBase<Scalar> >
990 op_i_j = Ops_[numRowBlocks_*j+i];
993 const RCP<const VectorSpaceBase<Scalar> > range_i_j = op_i_j->range();
994 if (
is_null(productVectorSpaceBase<Scalar>(range_i_j,
false))) {
995 rangeBlocks_[i] = range_i_j;
1002 for (
int j = 0; j < numColBlocks_; ++j) {
1003 for (
int i = 0; i < numRowBlocks_; ++i) {
1004 const RCP<const LinearOpBase<Scalar> >
1005 op_i_j = Ops_[numRowBlocks_*j+i];
1008 const RCP<const VectorSpaceBase<Scalar> >
1009 domain_i_j = op_i_j->domain();
1010 if (
is_null(productVectorSpaceBase<Scalar>(domain_i_j,
false))) {
1011 domainBlocks_[j] = domain_i_j;
1023 template<
class Scalar>
1025 Thyra::defaultBlockedLinearOp()
1027 return Teuchos::rcp(
new DefaultBlockedLinearOp<Scalar>());
1031 template<
class Scalar>
1034 const RCP<
const LinearOpBase<Scalar> > &A00,
1035 const std::string &label
1038 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1039 M = defaultBlockedLinearOp<Scalar>();
1040 M->beginBlockFill(1,1);
1041 M->setBlock(0, 0, A00);
1044 M->setObjectLabel(label);
1049 template<
class Scalar>
1052 const RCP<
const LinearOpBase<Scalar> > &A00,
1053 const RCP<
const LinearOpBase<Scalar> > &A01,
1054 const std::string &label
1057 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1058 M = defaultBlockedLinearOp<Scalar>();
1059 M->beginBlockFill(1,2);
1060 if(A00.get()) M->setBlock(0,0,A00);
1061 if(A01.get()) M->setBlock(0,1,A01);
1064 M->setObjectLabel(label);
1069 template<
class Scalar>
1072 const RCP<
const LinearOpBase<Scalar> > &A00,
1073 const RCP<
const LinearOpBase<Scalar> > &A10,
1074 const std::string &label
1077 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1078 M = defaultBlockedLinearOp<Scalar>();
1079 M->beginBlockFill(2,1);
1080 if(A00.get()) M->setBlock(0,0,A00);
1081 if(A10.get()) M->setBlock(1,0,A10);
1084 M->setObjectLabel(label);
1089 template<
class Scalar>
1092 const RCP<
const LinearOpBase<Scalar> > &A00,
1093 const RCP<
const LinearOpBase<Scalar> > &A01,
1094 const RCP<
const LinearOpBase<Scalar> > &A10,
1095 const RCP<
const LinearOpBase<Scalar> > &A11,
1096 const std::string &label
1099 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1100 M = defaultBlockedLinearOp<Scalar>();
1101 M->beginBlockFill(2,2);
1102 if(A00.get()) M->setBlock(0,0,A00);
1103 if(A01.get()) M->setBlock(0,1,A01);
1104 if(A10.get()) M->setBlock(1,0,A10);
1105 if(A11.get()) M->setBlock(1,1,A11);
1108 M->setObjectLabel(label);
1113 template<
class Scalar>
1115 Thyra::nonconstBlock1x1(
1116 const RCP<LinearOpBase<Scalar> > &A00,
1117 const std::string &label
1120 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1121 M = defaultBlockedLinearOp<Scalar>();
1122 M->beginBlockFill(1, 1);
1123 M->setNonconstBlock(0, 0, A00);
1126 M->setObjectLabel(label);
1131 template<
class Scalar>
1133 Thyra::nonconstBlock1x2(
1134 const RCP<LinearOpBase<Scalar> > &A00,
1135 const RCP<LinearOpBase<Scalar> > &A01,
1136 const std::string &label
1139 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1140 M = defaultBlockedLinearOp<Scalar>();
1141 M->beginBlockFill(1,2);
1142 if(A00.get()) M->setNonconstBlock(0,0,A00);
1143 if(A01.get()) M->setNonconstBlock(0,1,A01);
1146 M->setObjectLabel(label);
1151 template<
class Scalar>
1153 Thyra::nonconstBlock2x1(
1154 const RCP<LinearOpBase<Scalar> > &A00,
1155 const RCP<LinearOpBase<Scalar> > &A10,
1156 const std::string &label
1159 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1160 M = defaultBlockedLinearOp<Scalar>();
1161 M->beginBlockFill(2,1);
1162 if(A00.get()) M->setNonconstBlock(0,0,A00);
1163 if(A10.get()) M->setNonconstBlock(1,0,A10);
1166 M->setObjectLabel(label);
1171 template<
class Scalar>
1173 Thyra::nonconstBlock2x2(
1174 const RCP<LinearOpBase<Scalar> > &A00,
1175 const RCP<LinearOpBase<Scalar> > &A01,
1176 const RCP<LinearOpBase<Scalar> > &A10,
1177 const RCP<LinearOpBase<Scalar> > &A11,
1178 const std::string &label
1181 RCP<PhysicallyBlockedLinearOpBase<Scalar> >
1182 M = defaultBlockedLinearOp<Scalar>();
1183 M->beginBlockFill(2,2);
1184 if(A00.get()) M->setNonconstBlock(0,0,A00);
1185 if(A01.get()) M->setNonconstBlock(0,1,A01);
1186 if(A10.get()) M->setNonconstBlock(1,0,A10);
1187 if(A11.get()) M->setNonconstBlock(1,1,A11);
1190 M->setObjectLabel(label);
1202 #define THYRA_DEFAULT_BLOCKED_LINEAR_OP_INSTANT(SCALAR) \
1204 template class DefaultBlockedLinearOp<SCALAR >; \
1206 template RCP<DefaultBlockedLinearOp<SCALAR > > \
1207 defaultBlockedLinearOp<SCALAR >(); \
1209 template RCP<const LinearOpBase<SCALAR > > \
1211 const RCP<const LinearOpBase<SCALAR > > &A00, \
1212 const std::string &label \
1215 template RCP<const LinearOpBase<SCALAR > > \
1217 const RCP<const LinearOpBase<SCALAR > > &A00, \
1218 const RCP<const LinearOpBase<SCALAR > > &A01, \
1219 const std::string &label \
1222 template RCP<const LinearOpBase<SCALAR > > \
1224 const RCP<const LinearOpBase<SCALAR > > &A00, \
1225 const RCP<const LinearOpBase<SCALAR > > &A10, \
1226 const std::string &label \
1229 template RCP<const LinearOpBase<SCALAR > > \
1231 const RCP<const LinearOpBase<SCALAR > > &A00, \
1232 const RCP<const LinearOpBase<SCALAR > > &A01, \
1233 const RCP<const LinearOpBase<SCALAR > > &A10, \
1234 const RCP<const LinearOpBase<SCALAR > > &A11, \
1235 const std::string &label \
1238 template RCP<LinearOpBase<SCALAR > > \
1240 const RCP<LinearOpBase<SCALAR > > &A00, \
1241 const std::string &label \
1244 template RCP<LinearOpBase<SCALAR > > \
1246 const RCP<LinearOpBase<SCALAR > > &A00, \
1247 const RCP<LinearOpBase<SCALAR > > &A01, \
1248 const std::string &label \
1251 template RCP<LinearOpBase<SCALAR > > \
1253 const RCP<LinearOpBase<SCALAR > > &A00, \
1254 const RCP<LinearOpBase<SCALAR > > &A10, \
1255 const std::string &label \
1258 template RCP<LinearOpBase<SCALAR > > \
1260 const RCP<LinearOpBase<SCALAR > > &A00, \
1261 const RCP<LinearOpBase<SCALAR > > &A01, \
1262 const RCP<LinearOpBase<SCALAR > > &A10, \
1263 const RCP<LinearOpBase<SCALAR > > &A11, \
1264 const std::string &label \
1268 #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