ROL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DiffusionObjective< Real > Class Template Reference

#include <example_02.hpp>

+ Inheritance diagram for DiffusionObjective< Real >:

Public Member Functions

 DiffusionObjective (const ROL::Ptr< FEM< Real > > fem, const Real alpha=1.e-4)
 
Real value (const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
 Compute value. More...
 
void gradient_1 (ROL::Vector< Real > &g, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
 Compute gradient with respect to first component. More...
 
void gradient_2 (ROL::Vector< Real > &g, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
 Compute gradient with respect to second component. More...
 
void hessVec_11 (ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
 Apply Hessian approximation to vector. More...
 
void hessVec_12 (ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
 
void hessVec_21 (ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
 
void hessVec_22 (ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
 
- Public Member Functions inherited from ROL::Objective_SimOpt< Real >
virtual void update (const Vector< Real > &u, const Vector< Real > &z, bool flag=true, int iter=-1)
 Update objective function. u is an iterate, z is an iterate, flag = true if the iterate has changed, iter is the outer algorithm iterations count. More...
 
void update (const Vector< Real > &x, bool flag=true, int iter=-1)
 Update objective function. More...
 
Real value (const Vector< Real > &x, Real &tol)
 Compute value. More...
 
void gradient (Vector< Real > &g, const Vector< Real > &x, Real &tol)
 Compute gradient. More...
 
void hessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 Apply Hessian approximation to vector. More...
 
std::vector< std::vector< Real > > checkGradient_1 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 
std::vector< std::vector< Real > > checkGradient_1 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
 
std::vector< std::vector< Real > > checkGradient_1 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
 
std::vector< std::vector< Real > > checkGradient_2 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 
std::vector< std::vector< Real > > checkGradient_2 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
 
std::vector< std::vector< Real > > checkGradient_2 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
 
std::vector< std::vector< Real > > checkHessVec_11 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 
std::vector< std::vector< Real > > checkHessVec_11 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 
std::vector< std::vector< Real > > checkHessVec_11 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
 
std::vector< std::vector< Real > > checkHessVec_11 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
 
std::vector< std::vector< Real > > checkHessVec_12 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 
std::vector< std::vector< Real > > checkHessVec_12 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 
std::vector< std::vector< Real > > checkHessVec_12 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
 
std::vector< std::vector< Real > > checkHessVec_12 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
 
std::vector< std::vector< Real > > checkHessVec_21 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 
std::vector< std::vector< Real > > checkHessVec_21 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 
std::vector< std::vector< Real > > checkHessVec_21 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
 
std::vector< std::vector< Real > > checkHessVec_21 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
 
std::vector< std::vector< Real > > checkHessVec_22 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 
std::vector< std::vector< Real > > checkHessVec_22 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 
std::vector< std::vector< Real > > checkHessVec_22 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
 
std::vector< std::vector< Real > > checkHessVec_22 (const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
 
- Public Member Functions inherited from ROL::Objective< Real >
virtual ~Objective ()
 
virtual Real dirDeriv (const Vector< Real > &x, const Vector< Real > &d, Real &tol)
 Compute directional derivative. More...
 
virtual void invHessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 Apply inverse Hessian approximation to vector. More...
 
virtual void precond (Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 Apply preconditioner to vector. More...
 
virtual std::vector
< std::vector< Real > > 
checkGradient (const Vector< Real > &x, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference gradient check. More...
 
virtual std::vector
< std::vector< Real > > 
checkGradient (const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference gradient check. More...
 
virtual std::vector
< std::vector< Real > > 
checkGradient (const Vector< Real > &x, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference gradient check with specified step sizes. More...
 
virtual std::vector
< std::vector< Real > > 
checkGradient (const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference gradient check with specified step sizes. More...
 
virtual std::vector
< std::vector< Real > > 
checkHessVec (const Vector< Real > &x, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference Hessian-applied-to-vector check. More...
 
virtual std::vector
< std::vector< Real > > 
checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
 Finite-difference Hessian-applied-to-vector check. More...
 
virtual std::vector
< std::vector< Real > > 
checkHessVec (const Vector< Real > &x, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference Hessian-applied-to-vector check with specified step sizes. More...
 
virtual std::vector
< std::vector< Real > > 
checkHessVec (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
 Finite-difference Hessian-applied-to-vector check with specified step sizes. More...
 
virtual std::vector< Real > checkHessSym (const Vector< Real > &x, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout)
 Hessian symmetry check. More...
 
virtual std::vector< Real > checkHessSym (const Vector< Real > &x, const Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &w, const bool printToStream=true, std::ostream &outStream=std::cout)
 Hessian symmetry check. More...
 
virtual void setParameter (const std::vector< Real > &param)
 

Private Member Functions

Real dot (const std::vector< Real > &x, const std::vector< Real > &y)
 
void scale (std::vector< Real > &u, const Real alpha=0.0)
 

Private Attributes

const ROL::Ptr< FEM< Real > > FEM_
 
const Real alpha_
 

Additional Inherited Members

- Protected Member Functions inherited from ROL::Objective< Real >
const std::vector< Real > getParameter (void) const
 

Detailed Description

template<class Real>
class DiffusionObjective< Real >

Definition at line 547 of file poisson-control/example_02.hpp.

Constructor & Destructor Documentation

template<class Real >
DiffusionObjective< Real >::DiffusionObjective ( const ROL::Ptr< FEM< Real > >  fem,
const Real  alpha = 1.e-4 
)
inline

Definition at line 577 of file poisson-control/example_02.hpp.

Member Function Documentation

template<class Real >
Real DiffusionObjective< Real >::dot ( const std::vector< Real > &  x,
const std::vector< Real > &  y 
)
inlineprivate

Definition at line 556 of file poisson-control/example_02.hpp.

Referenced by DiffusionObjective< Real >::value().

template<class Real >
void DiffusionObjective< Real >::scale ( std::vector< Real > &  u,
const Real  alpha = 0.0 
)
inlineprivate
template<class Real >
Real DiffusionObjective< Real >::value ( const ROL::Vector< Real > &  u,
const ROL::Vector< Real > &  z,
Real &  tol 
)
inlinevirtual
template<class Real >
void DiffusionObjective< Real >::gradient_1 ( ROL::Vector< Real > &  g,
const ROL::Vector< Real > &  u,
const ROL::Vector< Real > &  z,
Real &  tol 
)
inlinevirtual

Compute gradient with respect to first component.

Reimplemented from ROL::Objective_SimOpt< Real >.

Definition at line 599 of file poisson-control/example_02.hpp.

References DiffusionObjective< Real >::FEM_, and ROL::Objective< Real >::getParameter().

template<class Real >
void DiffusionObjective< Real >::gradient_2 ( ROL::Vector< Real > &  g,
const ROL::Vector< Real > &  u,
const ROL::Vector< Real > &  z,
Real &  tol 
)
inlinevirtual

Compute gradient with respect to second component.

Reimplemented from ROL::Objective_SimOpt< Real >.

Definition at line 611 of file poisson-control/example_02.hpp.

References DiffusionObjective< Real >::alpha_, DiffusionObjective< Real >::FEM_, and DiffusionObjective< Real >::scale().

template<class Real >
void DiffusionObjective< Real >::hessVec_11 ( ROL::Vector< Real > &  hv,
const ROL::Vector< Real > &  v,
const ROL::Vector< Real > &  u,
const ROL::Vector< Real > &  z,
Real &  tol 
)
inlinevirtual

Apply Hessian approximation to vector.

Reimplemented from ROL::Objective_SimOpt< Real >.

Definition at line 619 of file poisson-control/example_02.hpp.

References DiffusionObjective< Real >::FEM_, and ROL::Objective< Real >::getParameter().

template<class Real >
void DiffusionObjective< Real >::hessVec_12 ( ROL::Vector< Real > &  hv,
const ROL::Vector< Real > &  v,
const ROL::Vector< Real > &  u,
const ROL::Vector< Real > &  z,
Real &  tol 
)
inlinevirtual

Reimplemented from ROL::Objective_SimOpt< Real >.

Definition at line 627 of file poisson-control/example_02.hpp.

References ROL::Vector< Real >::zero().

template<class Real >
void DiffusionObjective< Real >::hessVec_21 ( ROL::Vector< Real > &  hv,
const ROL::Vector< Real > &  v,
const ROL::Vector< Real > &  u,
const ROL::Vector< Real > &  z,
Real &  tol 
)
inlinevirtual

Reimplemented from ROL::Objective_SimOpt< Real >.

Definition at line 632 of file poisson-control/example_02.hpp.

References ROL::Vector< Real >::zero().

template<class Real >
void DiffusionObjective< Real >::hessVec_22 ( ROL::Vector< Real > &  hv,
const ROL::Vector< Real > &  v,
const ROL::Vector< Real > &  u,
const ROL::Vector< Real > &  z,
Real &  tol 
)
inlinevirtual

Member Data Documentation

template<class Real >
const ROL::Ptr<FEM<Real> > DiffusionObjective< Real >::FEM_
private
template<class Real >
const Real DiffusionObjective< Real >::alpha_
private

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