Thyra Package Browser (Single Doxygen Collection) Version of the Day
Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
Thyra::DefaultMultiPeriodModelEvaluator< Scalar > Class Template Reference

Composite subclass that takes a single ModelEvaluator object and represents it as a single aggregate multi-period ModelEvalator object. More...

#include <Thyra_DefaultMultiPeriodModelEvaluator.hpp>

Inheritance diagram for Thyra::DefaultMultiPeriodModelEvaluator< Scalar >:
Inheritance graph
[legend]

List of all members.

Private Types

typedef Array< Scalar > g_weights_t
typedef Array< Array< RCP
< const VectorBase< Scalar > > > > 
z_t

Private Member Functions

void set_z_indexes_and_create_period_l_map (const Array< int > &z_indexes)
void wrapNominalValuesAndBounds ()
int period_l (const int l) const
int numPeriodZs () const
int N () const

Static Private Member Functions

static RCP< ProductVectorBase
< Scalar > > 
createProductVector (const RCP< const ProductVectorSpaceBase< Scalar > > &prodVecSpc)

Private Attributes

RCP< ModelEvaluator< Scalar > > periodModel_
Array< RCP< ModelEvaluator
< Scalar > > > 
periodModels_
Array< int > z_indexes_
Array< int > period_l_map_
z_t z_
int g_index_
g_weights_t g_weights_
RCP< const
ProductVectorSpaceBase< Scalar > > 
x_bar_space_
RCP< const
ProductVectorSpaceBase< Scalar > > 
f_bar_space_
RCP
< LinearOpWithSolveFactoryBase
< Scalar > > 
W_bar_factory_
int Np_
int Ng_
ModelEvaluatorBase::InArgs
< Scalar > 
nominalValues_
ModelEvaluatorBase::InArgs
< Scalar > 
lowerBounds_
ModelEvaluatorBase::InArgs
< Scalar > 
upperBounds_

Constructors/Intializers/Accessors

 DefaultMultiPeriodModelEvaluator ()
 
 DefaultMultiPeriodModelEvaluator (const int N, const Array< RCP< ModelEvaluator< Scalar > > > &periodModels, const Array< int > &z_indexes, const Array< Array< RCP< const VectorBase< Scalar > > > > &z, const int g_index, const Array< Scalar > g_weights, const RCP< const ProductVectorSpaceBase< Scalar > > &x_bar_space=Teuchos::null, const RCP< const ProductVectorSpaceBase< Scalar > > &f_bar_space=Teuchos::null, const RCP< LinearOpWithSolveFactoryBase< Scalar > > &W_bar_factory=Teuchos::null)
 Calls intialize(...).
void initialize (const int N, const Array< RCP< ModelEvaluator< Scalar > > > &periodModels, const Array< int > &z_indexes, const Array< Array< RCP< const VectorBase< Scalar > > > > &z, const int g_index, const Array< Scalar > g_weights, const RCP< const ProductVectorSpaceBase< Scalar > > &x_bar_space=Teuchos::null, const RCP< const ProductVectorSpaceBase< Scalar > > &f_bar_space=Teuchos::null, const RCP< LinearOpWithSolveFactoryBase< Scalar > > &W_bar_factory=Teuchos::null)
 Initialize.
void reset_z (const Array< Array< RCP< const VectorBase< Scalar > > > > &z)
 Reset z.

Public functions overridden from ModelEvaulator.

int Np () const
 
int Ng () const
 
RCP< const VectorSpaceBase
< Scalar > > 
get_x_space () const
 
RCP< const VectorSpaceBase
< Scalar > > 
get_f_space () const
 
RCP< const VectorSpaceBase
< Scalar > > 
get_p_space (int l) const
 
RCP< const Array< std::string > > get_p_names (int l) const
 
RCP< const VectorSpaceBase
< Scalar > > 
get_g_space (int j) const
 
ModelEvaluatorBase::InArgs
< Scalar > 
getNominalValues () const
 
ModelEvaluatorBase::InArgs
< Scalar > 
getLowerBounds () const
 
ModelEvaluatorBase::InArgs
< Scalar > 
getUpperBounds () const
 
RCP< LinearOpBase< Scalar > > create_W_op () const
RCP< const
LinearOpWithSolveFactoryBase
< Scalar > > 
get_W_factory () const
ModelEvaluatorBase::InArgs
< Scalar > 
createInArgs () const
 
void reportFinalPoint (const ModelEvaluatorBase::InArgs< Scalar > &finalPoint, const bool wasSolved)
 Ignores the final point.

Private functions overridden from ModelEvaulatorDefaultBase.

RCP< LinearOpBase< Scalar > > create_DfDp_op_impl (int l) const
 
RCP< LinearOpBase< Scalar > > create_DgDx_dot_op_impl (int j) const
 
RCP< LinearOpBase< Scalar > > create_DgDx_op_impl (int j) const
 
RCP< LinearOpBase< Scalar > > create_DgDp_op_impl (int j, int l) const
 
ModelEvaluatorBase::OutArgs
< Scalar > 
createOutArgsImpl () const
 
void evalModelImpl (const ModelEvaluatorBase::InArgs< Scalar > &inArgs, const ModelEvaluatorBase::OutArgs< Scalar > &outArgs) const
 

Detailed Description

template<class Scalar>
class Thyra::DefaultMultiPeriodModelEvaluator< Scalar >

Composite subclass that takes a single ModelEvaluator object and represents it as a single aggregate multi-period ModelEvalator object.

Mathematically, this subclass is used to form a multi-period (or multi-point) problem of the form:


   (x_bar,{p_l}\p_period) -> f_bar

   (x_bar,{p_l}\p_period) -> g_bar

 

where


   x_bar = [ x[0]; x[1]; ...; x[N-1]]

   {p_l}\p_period = { p_(0), p_(1), ..., p_(z_index-1), p_(z_index+1), ..., p_(Np-1) }

   f_bar(...) = [ f(x[0],{p_l},z[0]); f(x[1],{p_l},z[1]); ..., f(x[N-1],{p_l},z[N-1]) ]

   g_bar(...) = sum( g_weights[i]*g[g_index](x[0],{p_l},z[i]), i = 0,...,N-1 )

 

Above, the notation {p_l} is meant to represent the set of all parameter subvectors in each of the constituent models minus the parameter subvector used to define period data.

This gives the first derivative objects:

                      
                      [ W[0], 0,     ...  0      ]
                      [ 0,    W[i],  ...  0      ]
   W_bar = DfDx_bar = [ .,    .,     ...  .      ]
                      [ 0,    0,     ...  W[N-1] ]

  
                 [ DfDp[0][l]   ]
                 [ DfDp[1][l]   ]
   DfDp_bar[l] = [ ...          ]
                 [ DfDp[N=1][l] ]


                  [ g_wieght[0] * DgDx_dot[0]     ]
                  [ g_wieght[1] * DgDx_dot[1]     ]
   DgDx_dot_bar = [ ...                           ]
                  [ g_wieght[N-1] * DgDx_dot[N-1] ]


              [ g_wieght[0] * DgDx[0]     ]
              [ g_wieght[1] * DgDx[1]     ]
   DgDx_bar = [ ...                       ]
              [ g_wieght[N-1] * DgDx[N-1] ]


   DgDp_bar = sum( g_weights[i]*DgDp[i][g_index], i = 0,...,N-1 )


 

This class could be made much more general but for now ???

Definition at line 118 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.


Member Typedef Documentation

template<class Scalar >
typedef Array<Scalar> Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::g_weights_t [private]

Definition at line 293 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
typedef Array<Array<RCP<const VectorBase<Scalar> > > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::z_t [private]

Definition at line 294 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.


Constructor & Destructor Documentation

Definition at line 351 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::DefaultMultiPeriodModelEvaluator ( const int  N,
const Array< RCP< ModelEvaluator< Scalar > > > &  periodModels,
const Array< int > &  z_indexes,
const Array< Array< RCP< const VectorBase< Scalar > > > > &  z,
const int  g_index,
const Array< Scalar >  g_weights,
const RCP< const ProductVectorSpaceBase< Scalar > > &  x_bar_space = Teuchos::null,
const RCP< const ProductVectorSpaceBase< Scalar > > &  f_bar_space = Teuchos::null,
const RCP< LinearOpWithSolveFactoryBase< Scalar > > &  W_bar_factory = Teuchos::null 
)

Member Function Documentation

template<class Scalar >
void Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::initialize ( const int  N,
const Array< RCP< ModelEvaluator< Scalar > > > &  periodModels,
const Array< int > &  z_indexes,
const Array< Array< RCP< const VectorBase< Scalar > > > > &  z,
const int  g_index,
const Array< Scalar >  g_weights,
const RCP< const ProductVectorSpaceBase< Scalar > > &  x_bar_space = Teuchos::null,
const RCP< const ProductVectorSpaceBase< Scalar > > &  f_bar_space = Teuchos::null,
const RCP< LinearOpWithSolveFactoryBase< Scalar > > &  W_bar_factory = Teuchos::null 
)

Initialize.

Parameters:
N[in] The number of periods.
periodModels[in] Array (length N) of the period models. For now, each of the period models at periodModels[i] must have an identical structure for every input and output. The reason that different models are passed in is so that different behaviors of the output functions and different nominal values for each period's x and bounds can be specified. The nominal values from periodModels[0] will be used to set the nominal values for the non-peroid parameters.
z_indexes[in] Array of sorted zero-based indexes of the model's parameter subvector that represents z[i]. Note, this array must be sorted from smallest to largets and can not have any duplicate entires!
z[in] Array (length N) of the period defining auxiliary paramter subvectors. Each entry z[i] is an array of subvectors where z[i][k] is the subvector p(z_indexes[k]) in the underlying perild model. Therefore, the array z[i] must be ordered according to z_indexes. Note that z[i][k] is allowed to be null in which case the underlying default value for this parameter will be used.
g_index[in] The index of the response function that will be used for the period objective function.
g_weights[in] Array (length N) of the g_weights for the auxiliary response functions in the summation for g_bar(...) shown above.
x_bar_space[in] The product vector space that represents the space for x_bar as defined above. If x_bar_space.get()==NULL then a default version of this product space will be created internally.
f_bar_space[in] The product vector space that represents the space for f_bar as defined above. If f_bar_space.get()==NULL then a default version of this product space will be created internally.
W_bar_factory[in] Factory object that is used to create the block LOWS object that will be used to represent the block diagonal object W_bar. If is_null(W_bar_factory)==true on input then a DefaultBlockedTriangularLinearOpWithSolveFactory object will be created and used internally.

Preconditions:

  • N > 0
  • periodModels.size()==N.
  • z_indexes.size() > 0 and z_indexes[k] >= 0 and z_indexes[k] are sorted low to high and are unique.
  • z.size()==N and z[i].size()==z_indexes.size(), for i=0...N-1

Definition at line 378 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

Referenced by Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::DefaultMultiPeriodModelEvaluator().

template<class Scalar >
void Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::reset_z ( const Array< Array< RCP< const VectorBase< Scalar > > > > &  z)

Reset z.

Parameters:
z[in] See initialize().

Preconditions:

Definition at line 465 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
int Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::Np ( ) const [virtual]
template<class Scalar >
int Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::Ng ( ) const [virtual]
template<class Scalar >
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::get_x_space ( ) const [virtual]
template<class Scalar >
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::get_f_space ( ) const [virtual]
template<class Scalar >
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::get_p_space ( int  l) const [virtual]
template<class Scalar >
RCP< const Array< std::string > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::get_p_names ( int  l) const [virtual]
template<class Scalar >
RCP< const VectorSpaceBase< Scalar > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::get_g_space ( int  j) const [virtual]
template<class Scalar >
ModelEvaluatorBase::InArgs< Scalar > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::getNominalValues ( ) const [virtual]
template<class Scalar >
ModelEvaluatorBase::InArgs< Scalar > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::getLowerBounds ( ) const [virtual]
template<class Scalar >
ModelEvaluatorBase::InArgs< Scalar > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::getUpperBounds ( ) const [virtual]
template<class Scalar >
RCP< LinearOpBase< Scalar > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::create_W_op ( ) const [virtual]
template<class Scalar >
RCP< const LinearOpWithSolveFactoryBase< Scalar > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::get_W_factory ( ) const [virtual]
template<class Scalar >
ModelEvaluatorBase::InArgs< Scalar > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::createInArgs ( ) const [virtual]
template<class Scalar >
void Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::reportFinalPoint ( const ModelEvaluatorBase::InArgs< Scalar > &  finalPoint,
const bool  wasSolved 
) [virtual]

Ignores the final point.

Implements Thyra::ModelEvaluator< Scalar >.

Definition at line 612 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
RCP< LinearOpBase< Scalar > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::create_DfDp_op_impl ( int  l) const [private, virtual]
template<class Scalar >
RCP< LinearOpBase< Scalar > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::create_DgDx_dot_op_impl ( int  j) const [private, virtual]
template<class Scalar >
RCP< LinearOpBase< Scalar > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::create_DgDx_op_impl ( int  j) const [private, virtual]
template<class Scalar >
RCP< LinearOpBase< Scalar > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::create_DgDp_op_impl ( int  j,
int  l 
) const [private, virtual]
template<class Scalar >
ModelEvaluatorBase::OutArgs< Scalar > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::createOutArgsImpl ( ) const [private, virtual]
template<class Scalar >
void Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::evalModelImpl ( const ModelEvaluatorBase::InArgs< Scalar > &  inArgs,
const ModelEvaluatorBase::OutArgs< Scalar > &  outArgs 
) const [private, virtual]
template<class Scalar >
void Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::set_z_indexes_and_create_period_l_map ( const Array< int > &  z_indexes) [private]

Definition at line 1022 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

References Thyra::toString().

template<class Scalar >
void Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::wrapNominalValuesAndBounds ( ) [private]

Definition at line 1067 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

References Thyra::assign().

template<class Scalar >
RCP< ProductVectorBase< Scalar > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::createProductVector ( const RCP< const ProductVectorSpaceBase< Scalar > > &  prodVecSpc) [static, private]

Definition at line 1145 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
int Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::period_l ( const int  l) const [inline, private]
template<class Scalar >
int Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::numPeriodZs ( ) const [inline, private]
template<class Scalar >
int Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::N ( ) const [inline, private]

Member Data Documentation

template<class Scalar >
RCP<ModelEvaluator<Scalar> > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::periodModel_ [private]

Definition at line 299 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
Array<RCP<ModelEvaluator<Scalar> > > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::periodModels_ [private]

Definition at line 300 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
Array<int> Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::z_indexes_ [private]
template<class Scalar >
Array<int> Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::period_l_map_ [private]
template<class Scalar >
z_t Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::z_ [private]

Definition at line 303 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
int Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::g_index_ [private]

Definition at line 304 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
g_weights_t Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::g_weights_ [private]

Definition at line 305 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
RCP<const ProductVectorSpaceBase<Scalar> > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::x_bar_space_ [private]
template<class Scalar >
RCP<const ProductVectorSpaceBase<Scalar> > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::f_bar_space_ [private]

Definition at line 307 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
RCP<LinearOpWithSolveFactoryBase<Scalar> > Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::W_bar_factory_ [private]

Definition at line 308 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
int Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::Np_ [private]
template<class Scalar >
int Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::Ng_ [private]

Definition at line 310 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
ModelEvaluatorBase::InArgs<Scalar> Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::nominalValues_ [private]

Definition at line 311 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
ModelEvaluatorBase::InArgs<Scalar> Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::lowerBounds_ [private]

Definition at line 312 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.

template<class Scalar >
ModelEvaluatorBase::InArgs<Scalar> Thyra::DefaultMultiPeriodModelEvaluator< Scalar >::upperBounds_ [private]

Definition at line 313 of file Thyra_DefaultMultiPeriodModelEvaluator.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines