OptiPack Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Private Attributes | Static Private Attributes | Related Functions | List of all members
OptiPack::NonlinearCG< Scalar > Class Template Reference

Concrete class implementing several nonlinear CG algorithms. More...

#include <OptiPack_NonlinearCG_decl.hpp>

Inheritance diagram for OptiPack::NonlinearCG< Scalar >:
Inheritance graph
[legend]

Public Types

typedef ScalarTraits< Scalar >
::magnitudeType 
ScalarMag
 

Private Attributes

RCP< const
Thyra::ModelEvaluator< Scalar > > 
model_
 
int paramIndex_
 
int responseIndex_
 
RCP< GlobiPack::LineSearchBase
< Scalar > > 
linesearch_
 
NonlinearCGUtils::ESolverTypes solverType_
 
ScalarMag alpha_init_
 
bool alpha_reinit_
 
bool and_conv_tests_
 
int minIters_
 
int maxIters_
 
ScalarMag g_reduct_tol_
 
ScalarMag g_grad_tol_
 
ScalarMag g_mag_
 
int numIters_
 

Static Private Attributes

static RCP
< Teuchos::ParameterEntryValidator
solverType_validator_ = Teuchos::null
 

Related Functions

(Note that these are not member functions.)

template<typename Scalar >
const RCP< NonlinearCG< Scalar > > nonlinearCG ()
 Nonmember constructor. More...
 
template<typename Scalar >
const RCP< NonlinearCG< Scalar > > nonlinearCG (const RCP< const Thyra::ModelEvaluator< Scalar > > &model, const int paramIndex, const int responseIndex, const RCP< GlobiPack::LineSearchBase< Scalar > > &linesearch)
 Nonmember constructor. More...
 

Constructor/Initializers/Accessors

 NonlinearCG ()
 Construct with default parameters. More...
 
void initialize (const RCP< const Thyra::ModelEvaluator< Scalar > > &model, const int paramIndex, const int responseIndex, const RCP< GlobiPack::LineSearchBase< Scalar > > &linesearch)
 Initialize. More...
 
NonlinearCGUtils::ESolverTypes get_solverType () const
 
ScalarMag get_alpha_init () const
 
bool get_alpha_reinit () const
 
bool get_and_conv_tests () const
 
int get_minIters () const
 
int get_maxIters () const
 
ScalarMag get_g_reduct_tol () const
 
ScalarMag get_g_grad_tol () const
 
ScalarMag get_g_mag () const
 

Overridden from ParameterListAcceptor (simple forwarding functions)

void setParameterList (RCP< ParameterList > const &paramList)
 
RCP< const ParameterListgetValidParameters () const
 

Solve.

NonlinearCGUtils::ESolveReturn doSolve (const Ptr< Thyra::VectorBase< Scalar > > &p, const Ptr< ScalarMag > &g_opt, const Ptr< const ScalarMag > &g_reduct_tol=Teuchos::null, const Ptr< const ScalarMag > &g_grad_tol=Teuchos::null, const Ptr< const ScalarMag > &alpha_init=Teuchos::null, const Ptr< int > &numIters=Teuchos::null)
 Perform a solve. More...
 

Additional Inherited Members

- Public Member Functions inherited from Teuchos::Describable
DescribableStreamManipulatorState describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default)
 
std::ostream & operator<< (std::ostream &os, const DescribableStreamManipulatorState &d)
 
virtual std::string description () const
 
virtual void describe (FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 
void describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 
virtual ~Describable ()
 
 LabeledObject ()
 
virtual ~LabeledObject ()
 
virtual void setObjectLabel (const std::string &objectLabel)
 
virtual std::string getObjectLabel () const
 
DescribableStreamManipulatorState describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default)
 
std::ostream & operator<< (std::ostream &os, const DescribableStreamManipulatorState &d)
 
virtual std::string description () const
 
virtual void describe (FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 
void describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const
 
virtual ~Describable ()
 
 LabeledObject ()
 
virtual ~LabeledObject ()
 
virtual void setObjectLabel (const std::string &objectLabel)
 
virtual std::string getObjectLabel () const
 
- Public Member Functions inherited from Teuchos::VerboseObject< NonlinearCG< Scalar > >
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
RCP< const ParameterList
getValidVerboseObjectSublist ()
 
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
RCP< const ParameterList
getValidVerboseObjectSublist ()
 
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
void 
setupVerboseObjectSublist (ParameterList *paramList)
 
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
void 
setupVerboseObjectSublist (ParameterList *paramList)
 
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
void 
readVerboseObjectSublist (ParameterList *paramList, RCP< FancyOStream > *oStream, EVerbosityLevel *verbLevel)
 
void readVerboseObjectSublist (ParameterList *paramList, VerboseObject< NonlinearCG< Scalar > > *verboseObject)
 
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT
void 
readVerboseObjectSublist (ParameterList *paramList, RCP< FancyOStream > *oStream, EVerbosityLevel *verbLevel)
 
void readVerboseObjectSublist (ParameterList *paramList, VerboseObject< NonlinearCG< Scalar > > *verboseObject)
 
 VerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null)
 
 VerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null)
 
virtual const VerboseObjectsetVerbLevel (const EVerbosityLevel verbLevel) const
 
virtual const VerboseObjectsetVerbLevel (const EVerbosityLevel verbLevel) const
 
virtual const VerboseObjectsetOverridingVerbLevel (const EVerbosityLevel verbLevel) const
 
virtual const VerboseObjectsetOverridingVerbLevel (const EVerbosityLevel verbLevel) const
 
virtual EVerbosityLevel getVerbLevel () const
 
virtual EVerbosityLevel getVerbLevel () const
 
- Public Member Functions inherited from Teuchos::ParameterListAcceptorDefaultBase
RCP< ParameterListgetNonconstParameterList ()
 
RCP< ParameterListunsetParameterList ()
 
RCP< const ParameterListgetParameterList () const
 
RCP< ParameterListgetNonconstParameterList ()
 
RCP< ParameterListunsetParameterList ()
 
RCP< const ParameterListgetParameterList () const
 
- Static Public Member Functions inherited from Teuchos::VerboseObject< NonlinearCG< Scalar > >
static void setDefaultVerbLevel (const EVerbosityLevel defaultVerbLevel)
 
static void setDefaultVerbLevel (const EVerbosityLevel defaultVerbLevel)
 
static EVerbosityLevel getDefaultVerbLevel ()
 
static EVerbosityLevel getDefaultVerbLevel ()
 
- Static Public Attributes inherited from Teuchos::Describable
static const EVerbosityLevel verbLevel_default
 
- Protected Member Functions inherited from Teuchos::VerboseObject< NonlinearCG< Scalar > >
void initializeVerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null)
 
void initializeVerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null)
 
- Protected Member Functions inherited from Teuchos::ParameterListAcceptorDefaultBase
void setMyParamList (const RCP< ParameterList > &paramList)
 
RCP< ParameterListgetMyNonconstParamList ()
 
RCP< const ParameterListgetMyParamList () const
 
void setMyParamList (const RCP< ParameterList > &paramList)
 
RCP< ParameterListgetMyNonconstParamList ()
 
RCP< const ParameterListgetMyParamList () const
 

Detailed Description

template<typename Scalar>
class OptiPack::NonlinearCG< Scalar >

Concrete class implementing several nonlinear CG algorithms.

ToDo: Finish Documentation!

Definition at line 88 of file OptiPack_NonlinearCG_decl.hpp.

Member Typedef Documentation

template<typename Scalar>
typedef ScalarTraits<Scalar>::magnitudeType OptiPack::NonlinearCG< Scalar >::ScalarMag

Definition at line 96 of file OptiPack_NonlinearCG_decl.hpp.

Constructor & Destructor Documentation

template<typename Scalar >
OptiPack::NonlinearCG< Scalar >::NonlinearCG ( )

Construct with default parameters.

Definition at line 70 of file OptiPack_NonlinearCG_def.hpp.

Member Function Documentation

template<typename Scalar>
void OptiPack::NonlinearCG< Scalar >::initialize ( const RCP< const Thyra::ModelEvaluator< Scalar > > &  model,
const int  paramIndex,
const int  responseIndex,
const RCP< GlobiPack::LineSearchBase< Scalar > > &  linesearch 
)

Initialize.

Definition at line 87 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar >
NonlinearCGUtils::ESolverTypes OptiPack::NonlinearCG< Scalar >::get_solverType ( ) const

Definition at line 103 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar >
NonlinearCG< Scalar >::ScalarMag OptiPack::NonlinearCG< Scalar >::get_alpha_init ( ) const

Definition at line 111 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar >
bool OptiPack::NonlinearCG< Scalar >::get_alpha_reinit ( ) const

Definition at line 118 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar >
bool OptiPack::NonlinearCG< Scalar >::get_and_conv_tests ( ) const

Definition at line 125 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar >
int OptiPack::NonlinearCG< Scalar >::get_minIters ( ) const

Definition at line 132 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar >
int OptiPack::NonlinearCG< Scalar >::get_maxIters ( ) const

Definition at line 139 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar >
NonlinearCG< Scalar >::ScalarMag OptiPack::NonlinearCG< Scalar >::get_g_reduct_tol ( ) const

Definition at line 147 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar >
NonlinearCG< Scalar >::ScalarMag OptiPack::NonlinearCG< Scalar >::get_g_grad_tol ( ) const

Definition at line 155 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar >
NonlinearCG< Scalar >::ScalarMag OptiPack::NonlinearCG< Scalar >::get_g_mag ( ) const

Definition at line 163 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar >
void OptiPack::NonlinearCG< Scalar >::setParameterList ( RCP< ParameterList > const &  paramList)
virtual

Implements Teuchos::ParameterListAcceptor.

Definition at line 173 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar >
RCP< const ParameterList > OptiPack::NonlinearCG< Scalar >::getValidParameters ( ) const
virtual

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 203 of file OptiPack_NonlinearCG_def.hpp.

template<typename Scalar>
NonlinearCGUtils::ESolveReturn OptiPack::NonlinearCG< Scalar >::doSolve ( const Ptr< Thyra::VectorBase< Scalar > > &  p,
const Ptr< ScalarMag > &  g_opt,
const Ptr< const ScalarMag > &  g_reduct_tol = Teuchos::null,
const Ptr< const ScalarMag > &  g_grad_tol = Teuchos::null,
const Ptr< const ScalarMag > &  alpha_init = Teuchos::null,
const Ptr< int > &  numIters = Teuchos::null 
)

Perform a solve.

Parameters
p[in/out] On input p is the initial guess for the solution. On output, will be the final estimate for the solution.
g_opt[out] On output, *g_opt will be set to the final value of the objective function.
tol[in] If !is_null(tol), then *tol will be the tolerance used to determine the convergence of the algorithm by comparing to norm(g_grad) (where norm(...) is the natural norm defined by the vector spaces scalar product). If is_null(tol), then the tolerance will be determined in some other way.
alpha_init[in] If !is_null(alpha_init), then *alpha_init will be the initial line search step length on the very first nonlinear CG iteration. If is_null(alpha_init), the initial step length will be determined automatically.
numIters[out] If nonnull(numIters), then on output *numIters gives the number of iterations taken by the algorithm.
Returns
Returns true if the solution was found. Returns false if a line search failure is encountered.

Definition at line 257 of file OptiPack_NonlinearCG_def.hpp.

Friends And Related Function Documentation

template<typename Scalar >
const RCP< NonlinearCG< Scalar > > nonlinearCG ( )
related

Nonmember constructor.

Definition at line 218 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar >
const RCP< NonlinearCG< Scalar > > nonlinearCG ( const RCP< const Thyra::ModelEvaluator< Scalar > > &  model,
const int  paramIndex,
const int  responseIndex,
const RCP< GlobiPack::LineSearchBase< Scalar > > &  linesearch 
)
related

Nonmember constructor.

Definition at line 230 of file OptiPack_NonlinearCG_decl.hpp.

Member Data Documentation

template<typename Scalar>
RCP<const Thyra::ModelEvaluator<Scalar> > OptiPack::NonlinearCG< Scalar >::model_
private

Definition at line 189 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
int OptiPack::NonlinearCG< Scalar >::paramIndex_
private

Definition at line 190 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
int OptiPack::NonlinearCG< Scalar >::responseIndex_
private

Definition at line 191 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
RCP<GlobiPack::LineSearchBase<Scalar> > OptiPack::NonlinearCG< Scalar >::linesearch_
private

Definition at line 192 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
NonlinearCGUtils::ESolverTypes OptiPack::NonlinearCG< Scalar >::solverType_
private

Definition at line 194 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
ScalarMag OptiPack::NonlinearCG< Scalar >::alpha_init_
private

Definition at line 195 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
bool OptiPack::NonlinearCG< Scalar >::alpha_reinit_
private

Definition at line 196 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
bool OptiPack::NonlinearCG< Scalar >::and_conv_tests_
private

Definition at line 197 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
int OptiPack::NonlinearCG< Scalar >::minIters_
private

Definition at line 198 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
int OptiPack::NonlinearCG< Scalar >::maxIters_
private

Definition at line 199 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
ScalarMag OptiPack::NonlinearCG< Scalar >::g_reduct_tol_
private

Definition at line 200 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
ScalarMag OptiPack::NonlinearCG< Scalar >::g_grad_tol_
private

Definition at line 201 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
ScalarMag OptiPack::NonlinearCG< Scalar >::g_mag_
private

Definition at line 202 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
int OptiPack::NonlinearCG< Scalar >::numIters_
mutableprivate

Definition at line 204 of file OptiPack_NonlinearCG_decl.hpp.

template<typename Scalar>
RCP< Teuchos::ParameterEntryValidator > OptiPack::NonlinearCG< Scalar >::solverType_validator_ = Teuchos::null
staticprivate

Definition at line 207 of file OptiPack_NonlinearCG_decl.hpp.


The documentation for this class was generated from the following files: