10 #ifndef THYRA_DEFAUL_INVERSE_MODEL_EVALUATOR_HPP
11 #define THYRA_DEFAUL_INVERSE_MODEL_EVALUATOR_HPP
14 #include "Thyra_ModelEvaluatorDelegatorBase.hpp"
15 #include "Thyra_ModelEvaluatorHelpers.hpp"
16 #include "Thyra_DetachedVectorView.hpp"
17 #include "Thyra_ParameterDrivenMultiVectorInput.hpp"
18 #include "Thyra_VectorSpaceFactoryBase.hpp"
19 #include "Thyra_MultiVectorStdOps.hpp"
20 #include "Thyra_AssertOp.hpp"
21 #include "Teuchos_StandardMemberCompositionMacros.hpp"
22 #include "Teuchos_StandardCompositionMacros.hpp"
23 #include "Teuchos_ParameterListAcceptor.hpp"
24 #include "Teuchos_VerboseObjectParameterListHelpers.hpp"
25 #include "Teuchos_StandardParameterEntryValidators.hpp"
26 #include "Teuchos_Time.hpp"
230 template<
class Scalar>
351 mutable bool usingObservationTargetAsParameter_;
357 double observationMultiplier_;
358 double parameterMultiplier_;
360 bool observationTargetAsParameter_;
362 bool observationPassThrough_;
369 static const std::string ObservationIndex_name_;
370 static const int ObservationIndex_default_;
372 static const std::string ParameterSubvectorIndex_name_;
373 static const int ParameterSubvectorIndex_default_;
375 static const std::string ObservationMultiplier_name_;
376 static const double ObservationMultiplier_default_;
378 static const std::string ObservationTargetVector_name_;
380 static const std::string ObservationTargetAsParameter_name_;
381 static const bool ObservationTargetAsParameter_default_;
383 static const std::string ObservationPassThrough_name_;
384 static const bool ObservationPassThrough_default_;
386 static const std::string ParameterMultiplier_name_;
387 static const double ParameterMultiplier_default_;
389 static const std::string ParameterBaseVector_name_;
394 void initializeDefaults();
396 void initializeInArgsOutArgs()
const;
407 template<
class Scalar>
415 inverseModel->initialize(thyraModel);
427 template<
class Scalar>
430 =
"Observation Index";
432 template<
class Scalar>
438 template<
class Scalar>
441 =
"Parameter Subvector Ordinal";
443 template<
class Scalar>
449 template<
class Scalar>
452 =
"Observation Multiplier";
454 template<
class Scalar>
460 template<
class Scalar>
463 =
"Observation Target Vector";
466 template<
class Scalar>
469 =
"Observation Target as Parameter";
471 template<
class Scalar>
477 template<
class Scalar>
480 =
"Observation Pass Through";
482 template<
class Scalar>
488 template<
class Scalar>
491 =
"Parameter Multiplier";
493 template<
class Scalar>
499 template<
class Scalar>
502 =
"Parameter Base Vector";
508 template<
class Scalar>
510 :usingObservationTargetAsParameter_(false), obs_idx_(-1),p_idx_(0),
511 observationTargetAsParameter_(false),
512 observationPassThrough_(ObservationPassThrough_default_),
514 observationMultiplier_(0.0),
515 parameterMultiplier_(0.0)
519 template<
class Scalar>
525 inv_g_space_= thyraModel->get_x_space()->smallVecSpcFcty()->createVecSpc(1);
532 template<
class Scalar>
537 if(thyraModel) *thyraModel = this->getUnderlyingModel();
545 template<
class Scalar>
552 using Teuchos::getParameterPtr;
554 using Teuchos::sublist;
559 paramList_ = paramList;
562 obs_idx_ = paramList_->
get(
563 ObservationIndex_name_,ObservationIndex_default_);
564 observationPassThrough_ = paramList_->get(
565 ObservationPassThrough_name_, ObservationPassThrough_default_ );
568 ( obs_idx_ < 0 && observationPassThrough_ ), std::logic_error,
569 "Error, the observation function index obs_idx = " << obs_idx_ <<
" is not\n"
570 "allowed when the observation is simply passed through!"
573 observationMultiplier_ = paramList_->get(
574 ObservationMultiplier_name_,ObservationMultiplier_default_);
575 if (!ObservationPassThrough_default_) {
576 observationTargetAsParameter_ = paramList_->get(
577 ObservationTargetAsParameter_name_, ObservationTargetAsParameter_default_ );
578 if(get_observationTargetIO().
get()) {
579 observationTargetReader_.set_vecSpc(get_obs_space());
581 vots_observationTargetReader(
582 rcp(&observationTargetReader_,
false)
583 ,this->getOStream(),this->getVerbLevel()
585 observationTargetReader_.setParameterList(
586 sublist(paramList_,ObservationTargetVector_name_)
590 observationTargetReader_.readVector(
591 "observation target vector",&observationTarget);
592 observationTarget_ = observationTarget;
596 observationTargetAsParameter_ =
false;
597 observationTarget_ = Teuchos::null;
601 p_idx_ = paramList_->
get(
602 ParameterSubvectorIndex_name_,ParameterSubvectorIndex_default_);
603 parameterMultiplier_ = paramList_->get(
604 ParameterMultiplier_name_,ParameterMultiplier_default_);
605 if(get_parameterBaseIO().
get()) {
606 parameterBaseReader_.set_vecSpc(this->get_p_space(p_idx_));
608 vots_parameterBaseReader(
609 rcp(¶meterBaseReader_,
false)
610 ,this->getOStream(),this->getVerbLevel()
612 parameterBaseReader_.setParameterList(
613 sublist(paramList_,ParameterBaseVector_name_)
617 parameterBaseReader_.readVector(
618 "parameter base vector",¶meterBase);
619 parameterBase_ = parameterBase;
623 localVerbLevel_ = this->readLocalVerbosityLevelValidatedParameter(*paramList_);
624 Teuchos::readVerboseObjectSublist(&*paramList_,
this);
627 paramList_->validateParameters(*getValidParameters(),0);
628 #endif // TEUCHOS_DEBUG
637 template<
class Scalar>
645 template<
class Scalar>
650 paramList_ = Teuchos::null;
655 template<
class Scalar>
663 template<
class Scalar>
667 if(validParamList_.get()==NULL) {
670 pl->
set( ObservationIndex_name_,ObservationIndex_default_,
671 "The index of the observation function, obs_idx.\n"
672 "If obs_idx < 0, then the observation will be the state vector x.\n"
673 "If obs_idx >= 0, then the observation will be the response function g(obs_idx)."
675 pl->
set( ParameterSubvectorIndex_name_,ParameterSubvectorIndex_default_,
676 "The index of the parameter subvector that will be used in the\n"
677 "regularization term."
679 pl->
set( ObservationMultiplier_name_,ObservationMultiplier_default_,
680 "observationMultiplier"
682 if(this->get_observationTargetIO().
get())
683 observationTargetReader_.set_fileIO(this->get_observationTargetIO());
685 *observationTargetReader_.getValidParameters()
687 pl->
set( ObservationPassThrough_name_, ObservationPassThrough_default_,
688 "If true, then the observation will just be used instead of the least-squares\n"
689 "function. This allows you to add a parameter regularization term to any existing\n"
692 pl->
set( ObservationTargetAsParameter_name_, ObservationTargetAsParameter_default_,
693 "If true, then a parameter will be accepted for the state observation vector\n"
694 "to allow it to be set by an external client through the InArgs object."
696 pl->
set( ParameterMultiplier_name_,ParameterMultiplier_default_,
697 "parameterMultiplier" );
698 if(this->get_parameterBaseIO().
get())
699 parameterBaseReader_.set_fileIO(this->get_parameterBaseIO());
701 *parameterBaseReader_.getValidParameters()
703 this->setLocalVerbosityLevelValidatedParameter(&*pl);
704 Teuchos::setupVerboseObjectSublist(&*pl);
705 validParamList_ = pl;
707 return validParamList_;
714 template<
class Scalar>
718 if (prototypeInArgs_.Np()==0)
719 initializeInArgsOutArgs();
720 if ( l == prototypeInArgs_.Np()-1 && usingObservationTargetAsParameter_ )
721 return get_obs_space();
722 return this->getUnderlyingModel()->get_p_space(l);
726 template<
class Scalar>
730 if (prototypeOutArgs_.Np()==0)
731 initializeInArgsOutArgs();
732 if (j==prototypeOutArgs_.Ng()-1)
734 return this->getUnderlyingModel()->get_g_space(j);
738 template<
class Scalar>
742 if (prototypeInArgs_.Np()==0)
743 initializeInArgsOutArgs();
744 return prototypeInArgs_;
751 template<
class Scalar>
755 thyraModel = this->getUnderlyingModel();
756 std::ostringstream oss;
757 oss <<
"Thyra::DefaultInverseModelEvaluator{";
758 oss <<
"thyraModel=";
760 oss <<
"\'"<<thyraModel->description()<<
"\'";
771 template<
class Scalar>
775 if (prototypeOutArgs_.Np()==0)
776 initializeInArgsOutArgs();
777 return prototypeOutArgs_;
781 template<
class Scalar>
782 void DefaultInverseModelEvaluator<Scalar>::evalModelImpl(
783 const ModelEvaluatorBase::InArgs<Scalar> &inArgs,
784 const ModelEvaluatorBase::OutArgs<Scalar> &outArgs
790 using Teuchos::rcp_const_cast;
791 using Teuchos::rcp_dynamic_cast;
794 typedef typename ST::magnitudeType ScalarMag;
795 typedef ModelEvaluatorBase MEB;
797 THYRA_MODEL_EVALUATOR_DECORATOR_EVAL_MODEL_LOCALVERBLEVEL_BEGIN(
798 "Thyra::DefaultInverseModelEvaluator",inArgs,outArgs,localVerbLevel_
804 const bool print_o = print_x;
810 const RCP<VectorBase<Scalar> >
811 g_inv_out = outArgs.get_g(outArgs.Ng()-1);
812 const RCP<MultiVectorBase<Scalar> >
813 DgDx_inv_trans_out = get_mv(
814 outArgs.get_DgDx(outArgs.Ng()-1),
"DgDx", MEB::DERIV_TRANS_MV_BY_ROW
816 const RCP<MultiVectorBase<Scalar> >
817 DgDp_inv_trans_out = get_mv(
818 outArgs.get_DgDp(outArgs.Ng()-1,p_idx_),
"DgDp", MEB::DERIV_TRANS_MV_BY_ROW
820 const bool computeInverseFunction = (
nonnull(g_inv_out)
828 *out <<
"\nComputing the base point and the observation(s) ...\n";
830 MEB::InArgs<Scalar> wrappedInArgs = thyraModel->createInArgs();
831 wrappedInArgs.setArgs(inArgs,
true);
832 MEB::OutArgs<Scalar> wrappedOutArgs = thyraModel->createOutArgs();
833 wrappedOutArgs.setArgs(outArgs,
true);
834 RCP<VectorBase<Scalar> > wrapped_o;
835 MEB::Derivative<Scalar> wrapped_DoDx;
836 MEB::Derivative<Scalar> wrapped_DoDp_trans;
837 if( obs_idx_ >= 0 && computeInverseFunction )
839 wrapped_o = createMember(thyraModel->get_g_space(obs_idx_));
840 wrappedOutArgs.set_g(obs_idx_,wrapped_o);
841 if (
nonnull(DgDx_inv_trans_out)) {
842 if (!observationPassThrough_)
843 wrapped_DoDx = thyraModel->create_DgDx_op(obs_idx_);
845 wrapped_DoDx = Thyra::create_DgDx_mv(
846 *thyraModel, obs_idx_, MEB::DERIV_TRANS_MV_BY_ROW );
847 wrappedOutArgs.set_DgDx(obs_idx_,wrapped_DoDx);
849 if (
nonnull(DgDp_inv_trans_out)) {
850 wrapped_DoDp_trans = create_DgDp_mv(
851 *thyraModel, obs_idx_, p_idx_, MEB::DERIV_TRANS_MV_BY_ROW
853 wrappedOutArgs.set_DgDp(obs_idx_,p_idx_,wrapped_DoDp_trans);
861 if (!wrappedOutArgs.isEmpty()) {
862 thyraModel->evalModel(wrappedInArgs,wrappedOutArgs);
866 *out <<
"\nSkipping the evaluation of the underlying model since "
867 <<
"there is nothing to compute ...\n";
870 bool failed = wrappedOutArgs.isFailed();
876 if ( !failed && computeInverseFunction ) {
882 RCP<const VectorBase<Scalar> >
883 x_in = inArgs.get_x(),
884 p_in = inArgs.get_p(p_idx_);
886 const MEB::InArgs<Scalar> nominalValues = this->getNominalValues();
887 RCP<const VectorBase<Scalar> >
888 x = ( !
is_null(x_in) ? x_in : nominalValues.get_x().assert_not_null() ),
889 p = ( !
is_null(p_in) ? p_in : nominalValues.get_p(p_idx_).assert_not_null() );
891 const RCP<const VectorSpaceBase<Scalar> >
892 o_space = get_obs_space(),
893 p_space = this->get_p_space(p_idx_);
900 *out <<
"\nno = " << no
906 observationPassThrough_ && no != 1, std::logic_error,
907 "Error, the observation function dimension no="<<no<<
" > 1 is not allowed"
908 " when the observation is passed through as the observation matching term!"
913 RCP<const VectorBase<Scalar> > o;
914 RCP<VectorBase<Scalar> > diff_o;
915 if( !observationPassThrough_ && (
nonnull(g_inv_out) ||
nonnull(DgDx_inv_trans_out) ) )
917 if (obs_idx_ < 0 ) o = x;
else o = wrapped_o;
918 if(trace) *out <<
"\n||o||inf = " << norm_inf(*o) << endl;
919 if (print_o) *out <<
"\no = " << *o;
920 diff_o = createMember(o_space);
921 RCP<const VectorBase<Scalar> >
923 = ( observationTargetAsParameter_
924 ? inArgs.get_p(inArgs.Np()-1)
927 if (
is_null(observationTarget) ) {
928 observationTarget = observationTarget_;
930 *out <<
"\n||ot||inf = " << norm_inf(*observationTarget) << endl;
932 *out <<
"\not = " << *observationTarget;
934 if (!
is_null(observationTarget)) {
935 V_VmV( diff_o.ptr(), *o, *observationTarget );
938 assign( diff_o.ptr(), *o );
941 *out <<
"\n||diff_o||inf = " << norm_inf(*diff_o) << endl;
944 *out <<
"\ndiff_o = " << *diff_o;
949 RCP<VectorBase<Scalar> > diff_p;
951 if(trace) *out <<
"\n||p||inf = " << norm_inf(*p) << endl;
953 diff_p = createMember(p_space);
954 if (!
is_null(parameterBase_) ) {
955 if(trace) *out <<
"\n||pt||inf = " << norm_inf(*parameterBase_) << endl;
960 V_VmV( diff_p.ptr(), *p, *parameterBase_ );
963 assign( diff_p.ptr(), *p );
965 if(trace) {*out <<
"\n||diff_p|| = " << norm(*diff_p) << endl;}
967 *out <<
"\ndiff_p = "
975 RCP<const LinearOpBase<Scalar> >
976 Q_o = this->get_observationMatchWeightingOp(),
977 Q_p = this->get_parameterRegularizationWeightingOp();
982 "Thyra::DefaultInverseModelEvaluator::evalModel(...)",
983 *Q_o->range(), *o_space
986 "Thyra::DefaultInverseModelEvaluator::evalModel(...)",
987 *Q_o->domain(), *o_space
992 "Thyra::DefaultInverseModelEvaluator::evalModel(...)",
993 *Q_p->range(), *p_space
996 "Thyra::DefaultInverseModelEvaluator::evalModel(...)",
997 *Q_p->domain(), *p_space
1005 RCP<VectorBase<Scalar> > Q_o_diff_o;
1007 Q_o_diff_o = createMember(Q_o->range());
1008 apply( *Q_o,
NOTRANS, *diff_o, Q_o_diff_o.ptr() );
1012 RCP<VectorBase<Scalar> > Q_p_diff_p;
1014 Q_p_diff_p = createMember(Q_p->range());
1015 apply( *Q_p,
NOTRANS, *diff_p, Q_p_diff_p.ptr() );
1021 *out <<
"\nComputing inverse response function ginv = g(Np-1) ...\n";
1022 const Scalar observationTerm
1023 = ( observationPassThrough_
1024 ? get_ele(*wrapped_o,0)
1025 : ( observationMultiplier_ != ST::zero()
1027 ? observationMultiplier_*0.5*dot(*diff_o,*Q_o_diff_o)
1028 : observationMultiplier_*(0.5/no)*dot(*diff_o,*diff_o)
1033 const Scalar parameterTerm
1034 = ( parameterMultiplier_ != ST::zero()
1036 ? parameterMultiplier_*0.5*dot(*diff_p,*Q_p_diff_p)
1037 : parameterMultiplier_*(0.5/np)*dot(*diff_p,*diff_p)
1041 const Scalar g_inv_val = observationTerm+parameterTerm;
1044 <<
"\nObservation matching term of ginv = g(Np-1):"
1045 <<
"\n observationMultiplier = " << observationMultiplier_
1046 <<
"\n observationMultiplier*observationMatch(x,p) = " << observationTerm
1047 <<
"\nParameter regularization term of ginv = g(Np-1):"
1048 <<
"\n parameterMultiplier = " << parameterMultiplier_
1049 <<
"\n parameterMultiplier*parameterRegularization(p) = " << parameterTerm
1050 <<
"\nginv = " << g_inv_val
1052 set_ele(0, observationTerm+parameterTerm, g_inv_out.ptr());
1056 if (
nonnull(DgDx_inv_trans_out)) {
1058 *out <<
"\nComputing inverse response function derivative DginvDx^T:\n";
1059 if (!observationPassThrough_) {
1060 if( obs_idx_ < 0 ) {
1063 *out <<
"\nDginvDx^T = observationMultiplier * Q_o * diff_o ...\n";
1065 DgDx_inv_trans_out->col(0).ptr(),
1066 observationMultiplier_,
1072 *out <<
"\nDginvDx^T = observationMultiplier * (1/no) * diff_o ...\n";
1074 DgDx_inv_trans_out->col(0).ptr(),
1075 Scalar(observationMultiplier_*(1.0/no)),
1083 if (print_o && print_x)
1084 *out <<
"\nDoDx = " << *wrapped_DoDx.getLinearOp();
1087 *out <<
"\nDginvDx^T = observationMultiplier * DoDx^T * Q_o * diff_o ...\n";
1091 DgDx_inv_trans_out->col(0).ptr(),
1092 observationMultiplier_
1097 *out <<
"\nDginvDx^T = (observationMultiplier*(1/no)) * DoDx^T * diff_o ...\n";
1101 DgDx_inv_trans_out->col(0).ptr(),
1102 Scalar(observationMultiplier_*(1.0/no))
1109 *out <<
"\nDginvDx^T = observationMultiplier * DoDx^T ...\n";
1111 DgDx_inv_trans_out->col(0).ptr(), observationMultiplier_,
1112 *wrapped_DoDx.getMultiVector()->col(0)
1116 *out <<
"\n||DginvDx^T||inf = " << norms_inf(*DgDx_inv_trans_out) <<
"\n";
1118 *out <<
"\nDginvDx^T = " << *DgDx_inv_trans_out;
1122 if (
nonnull(DgDp_inv_trans_out)) {
1124 *out <<
"\nComputing inverse response function derivative DginvDp^T ...\n";
1125 if (obs_idx_ >= 0) {
1127 *out <<
"\n||DoDp^T|| = " << norms_inf(*wrapped_DoDp_trans.getMultiVector()) << endl;
1129 *out <<
"\nDoDp^T = " << Teuchos::describe(*wrapped_DoDp_trans.getMultiVector(),
Teuchos::VERB_EXTREME);
1132 *out <<
"\nDginvDp^T = 0 ...\n";
1133 assign( DgDp_inv_trans_out->col(0).ptr(), ST::zero() );
1135 if (!observationPassThrough_) {
1136 if ( obs_idx_ >= 0 ) {
1139 *out <<
"\nDginvDp^T += observationMultiplier* * (DoDp^T) * Q_o * diff_o ...\n";
1141 *wrapped_DoDp_trans.getMultiVector(),
NOTRANS,
1143 DgDp_inv_trans_out->col(0).ptr(),
1144 Scalar(observationMultiplier_*(1.0/no)),
1150 *out <<
"\nDgDp^T += observationMultiplier* * (DoDp^T) * Q_o * diff_o ...\n";
1152 *wrapped_DoDp_trans.getMultiVector(),
NOTRANS,
1154 DgDp_inv_trans_out->col(0).ptr(),
1155 Scalar(observationMultiplier_*(1.0/no)),
1160 *out <<
"\n||DginvDp^T||inf = " << norms_inf(*DgDp_inv_trans_out) <<
"\n";
1162 *out <<
"\nDginvDp^T = " << *DgDp_inv_trans_out;
1170 *out <<
"\nDginvDp^T += (observationMultiplier*(1/no)) * (DoDp^T) * diff_o ...\n";
1172 DgDp_inv_trans_out->col(0).ptr(), observationMultiplier_,
1173 *wrapped_DoDp_trans.getMultiVector()->col(0)
1178 if( parameterMultiplier_ != ST::zero() ) {
1181 *out <<
"\nDginvDp^T += parameterMultiplier * Q_p * diff_p ...\n";
1183 DgDp_inv_trans_out->col(0).ptr(),
1184 parameterMultiplier_,
1190 *out <<
"\nDginvDp^T += (parameterMultiplier*(1.0/np)) * diff_p ...\n";
1192 DgDp_inv_trans_out->col(0).ptr(),
1193 Scalar(parameterMultiplier_*(1.0/np)),
1198 *out <<
"\n||DginvDp^T||inf = " << norms_inf(*DgDp_inv_trans_out) <<
"\n";
1200 *out <<
"\nDginvDp^T = " << *DgDp_inv_trans_out;
1209 THYRA_MODEL_EVALUATOR_DECORATOR_EVAL_MODEL_END();
1217 template<
class Scalar>
1218 void DefaultInverseModelEvaluator<Scalar>::initializeDefaults()
1220 obs_idx_ = ObservationIndex_default_;
1221 p_idx_ = ParameterSubvectorIndex_default_;
1222 observationMultiplier_ = ObservationMultiplier_default_;
1223 parameterMultiplier_ = ParameterMultiplier_default_;
1227 template<
class Scalar>
1228 void DefaultInverseModelEvaluator<Scalar>::initializeInArgsOutArgs()
const
1231 typedef ModelEvaluatorBase MEB;
1233 const RCP<const ModelEvaluator<Scalar> >
1234 thyraModel = this->getUnderlyingModel();
1236 const MEB::InArgs<Scalar> wrappedInArgs = thyraModel->createInArgs();
1237 const int wrapped_Np = wrappedInArgs.Np();
1239 MEB::InArgsSetup<Scalar> inArgs;
1240 inArgs.setModelEvalDescription(this->description());
1241 const bool supports_x = wrappedInArgs.supports(MEB::IN_ARG_x);
1242 usingObservationTargetAsParameter_ = ( supports_x && observationTargetAsParameter_ );
1245 wrapped_Np + ( usingObservationTargetAsParameter_ ? 1 : 0 )
1247 prototypeInArgs_ = inArgs;
1249 const MEB::OutArgs<Scalar> wrappedOutArgs = thyraModel->createOutArgs();
1250 const int wrapped_Ng = wrappedOutArgs.Ng();
1252 MEB::OutArgsSetup<Scalar> outArgs;
1253 outArgs.setModelEvalDescription(inArgs.modelEvalDescription());
1254 outArgs.set_Np_Ng( prototypeInArgs_.Np(), wrapped_Ng+1 );
1255 outArgs.setSupports(wrappedOutArgs);
1256 outArgs.setSupports(MEB::OUT_ARG_DgDx,wrapped_Ng,MEB::DERIV_TRANS_MV_BY_ROW);
1257 outArgs.setSupports(MEB::OUT_ARG_DgDp,wrapped_Ng,p_idx_,MEB::DERIV_TRANS_MV_BY_ROW);
1258 prototypeOutArgs_ = outArgs;
1263 template<
class Scalar>
1264 RCP<const VectorSpaceBase<Scalar> >
1265 DefaultInverseModelEvaluator<Scalar>::get_obs_space()
const
1267 return ( obs_idx_ < 0 ? this->get_x_space() : this->get_g_space(obs_idx_) );
1274 #endif // THYRA_DEFAUL_INVERSE_MODEL_EVALUATOR_HPP
Pure abstract base interface for evaluating a stateless "model" that can be mapped into a number of d...
#define THYRA_ASSERT_VEC_SPACES(FUNC_NAME, VS1, VS2)
This is a very useful macro that should be used to validate that two vector spaces are compatible...
bool is_null(const boost::shared_ptr< T > &p)
basic_OSTab< char > OSTab
Concrete aggregate class for all output arguments computable by a ModelEvaluator subclass object...
void uninitialize()
Uninitialize.
T & get(const std::string &name, T def_value)
This is a base class that delegetes almost all function to a wrapped model evaluator object...
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Use the non-transposed operator.
ModelEvaluatorBase::InArgs< Scalar > createInArgs() const
void initialize(const RCP< ModelEvaluator< Scalar > > &model)
Initialize given a non-const model evaluator.
void initialize(const RCP< ModelEvaluator< Scalar > > &thyraModel)
Use the transposed operator with complex-conjugate clements (same as TRANS for real scalar types)...
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
RCP< const Teuchos::ParameterList > getParameterList() const
DefaultInverseModelEvaluator()
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
RCP< Teuchos::ParameterList > unsetParameterList()
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
RCP< const VectorSpaceBase< Scalar > > get_g_space(int j) const
std::string description() const
Abstract strategy interface for reading and writing (multi)vector objects to and from files...
Abstract interface for finite-dimensional dense vectors.
RCP< DefaultInverseModelEvaluator< Scalar > > defaultInverseModelEvaluator(const RCP< ModelEvaluator< Scalar > > &thyraModel)
Non-member constructor.
Base class for all linear operators.
STANDARD_CONST_COMPOSITION_MEMBERS(VectorBase< Scalar >, observationTarget)
Observation target vector ot.
TEUCHOSCORE_LIB_DLL_EXPORT bool includesVerbLevel(const EVerbosityLevel verbLevel, const EVerbosityLevel requestedVerbLevel, const bool isDefaultLevel=false)
void validateParameters(ParameterList const &validParamList, int const depth=1000, EValidateUsed const validateUsed=VALIDATE_USED_ENABLED, EValidateDefaults const validateDefaults=VALIDATE_DEFAULTS_ENABLED) const
ParameterList & setParameters(const ParameterList &source)
bool nonnull(const boost::shared_ptr< T > &p)
This class wraps any ModelEvaluator object and adds a simple, but fairly general, inverse response fu...
void setParameterList(RCP< Teuchos::ParameterList > const ¶mList)
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
RCP< const VectorSpaceBase< Scalar > > get_p_space(int l) const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
RCP< Teuchos::ParameterList > getNonconstParameterList()
RCP< const Teuchos::ParameterList > getValidParameters() const
STANDARD_NONCONST_COMPOSITION_MEMBERS(MultiVectorFileIOBase< Scalar >, observationTargetIO)
MultiVectorFileIOBase object used to read the observation target vector ot as directed by the paramet...
Concrete aggregate class for all input arguments computable by a ModelEvaluator subclass object...