Thyra::DirectionalFiniteDiffCalculator< Scalar > Class Template Reference

Utility calss for computing directional finite differences of a model. More...

#include <Thyra_DirectionalFiniteDiffCalculator.hpp>

Inheritance diagram for Thyra::DirectionalFiniteDiffCalculator< Scalar >:

[legend]
List of all members.

Public Types

typedef Teuchos::ScalarTraits<
Scalar >::magnitudeType 
ScalarMag
 
typedef DirectionalFiniteDiffCalculatorTypes::EFDMethodType EFDMethodType
 
typedef DirectionalFiniteDiffCalculatorTypes::EFDStepSelectType EFDStepSelectType
 
typedef DirectionalFiniteDiffCalculatorTypes::SelectedDerivatives SelectedDerivatives
 

Constructors/setup

 STANDARD_MEMBER_COMPOSITION_MEMBERS (EFDMethodType, fd_method_type)
 
 STANDARD_MEMBER_COMPOSITION_MEMBERS (EFDStepSelectType, fd_step_select_type)
 
 STANDARD_MEMBER_COMPOSITION_MEMBERS (ScalarMag, fd_step_size)
 Pick the size of the finite difference step.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (ScalarMag, fd_step_size_min)
 Pick the minimum step size under which the finite difference product will not be computed.
 DirectionalFiniteDiffCalculator (EFDMethodType fd_method_type=DirectionalFiniteDiffCalculatorTypes::FD_ORDER_FOUR_AUTO, EFDStepSelectType fd_step_select_type=DirectionalFiniteDiffCalculatorTypes::FD_STEP_ABSOLUTE, ScalarMag fd_step_size=-1.0, ScalarMag fd_step_size_min=-1.0)
 

Overridden from ParameterListAcceptor

void setParameterList (RCP< ParameterList > const &paramList)
 
RCP< ParameterList > getParameterList ()
 
RCP< ParameterList > unsetParameterList ()
 
RCP< const ParameterList > getParameterList () const
 
RCP< const ParameterList > getValidParameters () const
 

Finite difference functions.

ModelEvaluatorBase::OutArgs<
Scalar > 
createOutArgs (const ModelEvaluator< Scalar > &model, const SelectedDerivatives &fdDerivatives)
 Create an augmented out args object for holding finite difference objects.
void calcVariations (const ModelEvaluator< Scalar > &model, const ModelEvaluatorBase::InArgs< Scalar > &basePoint, const ModelEvaluatorBase::InArgs< Scalar > &directions, const ModelEvaluatorBase::OutArgs< Scalar > &baseFunctionValues, const ModelEvaluatorBase::OutArgs< Scalar > &variations) const
 Compute variations using directional finite differences..
void calcDerivatives (const ModelEvaluator< Scalar > &model, const ModelEvaluatorBase::InArgs< Scalar > &basePoint, const ModelEvaluatorBase::OutArgs< Scalar > &baseFunctionValues, const ModelEvaluatorBase::OutArgs< Scalar > &derivatives) const
 Compute entire derivative objects using finite differences.

Related Functions

(Note that these are not member functions.)

RCP< DirectionalFiniteDiffCalculator<
Scalar > > 
directionalFiniteDiffCalculator (const RCP< ParameterList > &paramList)
 Nonmember constructor.

Detailed Description

template<class Scalar>
class Thyra::DirectionalFiniteDiffCalculator< Scalar >

Utility calss for computing directional finite differences of a model.

This class computes finite difference approximations to the variations:

The client can leave any of the delta_x or delta_p(l) directions as NULL and they will be assumed to be zero.

Warning!</b The client should only set parameters using either the parameter list function setParameterList() or the more typesafe functions but not a mixture of the two. The behavior of setting options in two different ways is undefined and is likely to change.

ToDo: Finish documentaton!

Definition at line 86 of file Thyra_DirectionalFiniteDiffCalculator.hpp.


Member Typedef Documentation

template<class Scalar>
typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Thyra::DirectionalFiniteDiffCalculator< Scalar >::ScalarMag

Definition at line 96 of file Thyra_DirectionalFiniteDiffCalculator.hpp.

template<class Scalar>
typedef DirectionalFiniteDiffCalculatorTypes::EFDMethodType Thyra::DirectionalFiniteDiffCalculator< Scalar >::EFDMethodType

Definition at line 99 of file Thyra_DirectionalFiniteDiffCalculator.hpp.

template<class Scalar>
typedef DirectionalFiniteDiffCalculatorTypes::EFDStepSelectType Thyra::DirectionalFiniteDiffCalculator< Scalar >::EFDStepSelectType

Definition at line 102 of file Thyra_DirectionalFiniteDiffCalculator.hpp.

template<class Scalar>
typedef DirectionalFiniteDiffCalculatorTypes::SelectedDerivatives Thyra::DirectionalFiniteDiffCalculator< Scalar >::SelectedDerivatives

Definition at line 105 of file Thyra_DirectionalFiniteDiffCalculator.hpp.


Constructor & Destructor Documentation

template<class Scalar>
Thyra::DirectionalFiniteDiffCalculator< Scalar >::DirectionalFiniteDiffCalculator ( EFDMethodType  fd_method_type = DirectionalFiniteDiffCalculatorTypes::FD_ORDER_FOUR_AUTO,
EFDStepSelectType  fd_step_select_type = DirectionalFiniteDiffCalculatorTypes::FD_STEP_ABSOLUTE,
ScalarMag  fd_step_size = -1.0,
ScalarMag  fd_step_size_min = -1.0 
)

Definition at line 456 of file Thyra_DirectionalFiniteDiffCalculator.hpp.


Member Function Documentation

template<class Scalar>
Thyra::DirectionalFiniteDiffCalculator< Scalar >::STANDARD_MEMBER_COMPOSITION_MEMBERS ( EFDMethodType  ,
fd_method_type   
)

template<class Scalar>
Thyra::DirectionalFiniteDiffCalculator< Scalar >::STANDARD_MEMBER_COMPOSITION_MEMBERS ( EFDStepSelectType  ,
fd_step_select_type   
)

template<class Scalar>
Thyra::DirectionalFiniteDiffCalculator< Scalar >::STANDARD_MEMBER_COMPOSITION_MEMBERS ( ScalarMag  ,
fd_step_size   
)

Pick the size of the finite difference step.

If fd_step_size < 0 then the implementation will try to select it based on the order of method fd_method_type() that is selected.

template<class Scalar>
Thyra::DirectionalFiniteDiffCalculator< Scalar >::STANDARD_MEMBER_COMPOSITION_MEMBERS ( ScalarMag  ,
fd_step_size_min   
)

Pick the minimum step size under which the finite difference product will not be computed.

If fd_step_size_min == 0 then the finite difference computation will always be performed. If fd_step_size_min < 0 then the minimum step size will be determined internally.

template<class Scalar>
void Thyra::DirectionalFiniteDiffCalculator< Scalar >::setParameterList ( RCP< ParameterList > const &  paramList  ) 

Definition at line 471 of file Thyra_DirectionalFiniteDiffCalculator.hpp.

template<class Scalar>
RCP< ParameterList > Thyra::DirectionalFiniteDiffCalculator< Scalar >::getParameterList (  )  [virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 489 of file Thyra_DirectionalFiniteDiffCalculator.hpp.

template<class Scalar>
RCP< ParameterList > Thyra::DirectionalFiniteDiffCalculator< Scalar >::unsetParameterList (  )  [virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 496 of file Thyra_DirectionalFiniteDiffCalculator.hpp.

template<class Scalar>
RCP< const ParameterList > Thyra::DirectionalFiniteDiffCalculator< Scalar >::getParameterList (  )  const [virtual]

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 505 of file Thyra_DirectionalFiniteDiffCalculator.hpp.

template<class Scalar>
RCP< const ParameterList > Thyra::DirectionalFiniteDiffCalculator< Scalar >::getValidParameters (  )  const [virtual]

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 512 of file Thyra_DirectionalFiniteDiffCalculator.hpp.

template<class Scalar>
ModelEvaluatorBase::OutArgs< Scalar > Thyra::DirectionalFiniteDiffCalculator< Scalar >::createOutArgs ( const ModelEvaluator< Scalar > &  model,
const SelectedDerivatives fdDerivatives 
)

Create an augmented out args object for holding finite difference objects.

Warning! The returned object must only be used with the below functions calcVariations() and calcDerivatives() and not with the original model object directly.

Definition at line 539 of file Thyra_DirectionalFiniteDiffCalculator.hpp.

template<class Scalar>
void Thyra::DirectionalFiniteDiffCalculator< Scalar >::calcVariations ( const ModelEvaluator< Scalar > &  model,
const ModelEvaluatorBase::InArgs< Scalar > &  basePoint,
const ModelEvaluatorBase::InArgs< Scalar > &  directions,
const ModelEvaluatorBase::OutArgs< Scalar > &  baseFunctionValues,
const ModelEvaluatorBase::OutArgs< Scalar > &  variations 
) const

Compute variations using directional finite differences..

The computation may fail if a NaN or Inf is encountered during any of the computations in which case a NaNInfException exception will be thrown. Otherwise the computation should be completed successfully.

If the finite difference could not be computed because of cramped bounds then a CrampedBoundsException object will be thrown.

ToDo: Discuss options!

Definition at line 550 of file Thyra_DirectionalFiniteDiffCalculator.hpp.

template<class Scalar>
void Thyra::DirectionalFiniteDiffCalculator< Scalar >::calcDerivatives ( const ModelEvaluator< Scalar > &  model,
const ModelEvaluatorBase::InArgs< Scalar > &  basePoint,
const ModelEvaluatorBase::OutArgs< Scalar > &  baseFunctionValues,
const ModelEvaluatorBase::OutArgs< Scalar > &  derivatives 
) const

Compute entire derivative objects using finite differences.

Definition at line 1037 of file Thyra_DirectionalFiniteDiffCalculator.hpp.


Friends And Related Function Documentation

template<class Scalar>
RCP< DirectionalFiniteDiffCalculator< Scalar > > directionalFiniteDiffCalculator ( const RCP< ParameterList > &  paramList  )  [related]

Nonmember constructor.

Definition at line 236 of file Thyra_DirectionalFiniteDiffCalculator.hpp.


The documentation for this class was generated from the following file:
Generated on Tue Oct 20 12:47:14 2009 for Thyra Nonlinear Model Evaluator Support by doxygen 1.4.7