ROL
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Objective_PoissonInversion< Real > Class Template Reference
+ Inheritance diagram for Objective_PoissonInversion< Real >:

Public Member Functions

 Objective_PoissonInversion (int nz=32, Real alpha=1.e-4)
 
void apply_mass (std::vector< Real > &Mz, const std::vector< Real > &z)
 
Real evaluate_target (Real x)
 
void apply_linearized_control_operator (std::vector< Real > &Bd, const std::vector< Real > &z, const std::vector< Real > &d, const std::vector< Real > &u, bool addBC=true)
 
void apply_transposed_linearized_control_operator (std::vector< Real > &Bd, const std::vector< Real > &z, const std::vector< Real > &d, const std::vector< Real > &u, bool addBC=true)
 
void solve_state_equation (std::vector< Real > &u, const std::vector< Real > &z)
 
void solve_adjoint_equation (std::vector< Real > &p, const std::vector< Real > &u, const std::vector< Real > &z)
 
void solve_state_sensitivity_equation (std::vector< Real > &w, const std::vector< Real > &v, const std::vector< Real > &u, const std::vector< Real > &z)
 
void solve_adjoint_sensitivity_equation (std::vector< Real > &q, const std::vector< Real > &w, const std::vector< Real > &v, const std::vector< Real > &p, const std::vector< Real > &u, const std::vector< Real > &z)
 
void update (const ROL::Vector< Real > &z, bool flag, int iter)
 Update objective function. More...
 
Real value (const ROL::Vector< Real > &z, Real &tol)
 Compute value. More...
 
void gradient (ROL::Vector< Real > &g, const ROL::Vector< Real > &z, Real &tol)
 Compute gradient. More...
 
void hessVec (ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &z, Real &tol)
 Apply Hessian approximation to vector. More...
 
void activateInertia (void)
 
void deactivateInertia (void)
 
void hessVec_true (ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &z, Real &tol)
 
void hessVec_inertia (ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &z, Real &tol)
 
- Public Member Functions inherited from ROL::Objective< Real >
virtual ~Objective ()
 
 Objective ()
 
virtual void update (const Vector< Real > &x, UpdateType type, int iter=-1)
 Update objective function. More...
 
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 void prox (Vector< Real > &Pv, const Vector< Real > &v, Real t, Real &tol)
 
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 Types

typedef std::vector< Real > vector
 
typedef ROL::Vector< Real > V
 
typedef ROL::StdVector< Real > SV
 
typedef vector::size_type uint
 

Private Member Functions

ROL::Ptr< const vectorgetVector (const V &x)
 
ROL::Ptr< vectorgetVector (V &x)
 

Private Attributes

uint nu_
 
uint nz_
 
Real hu_
 
Real hz_
 
Real u0_
 
Real u1_
 
Real alpha_
 
bool useCorrection_
 
Teuchos::SerialDenseMatrix
< int, Real > 
H_
 

Additional Inherited Members

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

Detailed Description

template<class Real>
class Objective_PoissonInversion< Real >

Definition at line 34 of file poisson-inversion/example_02.cpp.

Member Typedef Documentation

template<class Real>
typedef std::vector<Real> Objective_PoissonInversion< Real >::vector
private

Definition at line 36 of file poisson-inversion/example_02.cpp.

template<class Real>
typedef ROL::Vector<Real> Objective_PoissonInversion< Real >::V
private

Definition at line 37 of file poisson-inversion/example_02.cpp.

template<class Real>
typedef ROL::StdVector<Real> Objective_PoissonInversion< Real >::SV
private

Definition at line 38 of file poisson-inversion/example_02.cpp.

template<class Real>
typedef vector::size_type Objective_PoissonInversion< Real >::uint
private

Definition at line 40 of file poisson-inversion/example_02.cpp.

Constructor & Destructor Documentation

template<class Real>
Objective_PoissonInversion< Real >::Objective_PoissonInversion ( int  nz = 32,
Real  alpha = 1.e-4 
)
inline

Member Function Documentation

template<class Real>
ROL::Ptr<const vector> Objective_PoissonInversion< Real >::getVector ( const V x)
inlineprivate
template<class Real>
ROL::Ptr<vector> Objective_PoissonInversion< Real >::getVector ( V x)
inlineprivate
template<class Real>
void Objective_PoissonInversion< Real >::apply_mass ( std::vector< Real > &  Mz,
const std::vector< Real > &  z 
)
inline
template<class Real>
Real Objective_PoissonInversion< Real >::evaluate_target ( Real  x)
inline
template<class Real>
void Objective_PoissonInversion< Real >::apply_linearized_control_operator ( std::vector< Real > &  Bd,
const std::vector< Real > &  z,
const std::vector< Real > &  d,
const std::vector< Real > &  u,
bool  addBC = true 
)
inline
template<class Real>
void Objective_PoissonInversion< Real >::apply_transposed_linearized_control_operator ( std::vector< Real > &  Bd,
const std::vector< Real > &  z,
const std::vector< Real > &  d,
const std::vector< Real > &  u,
bool  addBC = true 
)
inline
template<class Real>
void Objective_PoissonInversion< Real >::solve_state_equation ( std::vector< Real > &  u,
const std::vector< Real > &  z 
)
inline
template<class Real>
void Objective_PoissonInversion< Real >::solve_adjoint_equation ( std::vector< Real > &  p,
const std::vector< Real > &  u,
const std::vector< Real > &  z 
)
inline
template<class Real>
void Objective_PoissonInversion< Real >::solve_state_sensitivity_equation ( std::vector< Real > &  w,
const std::vector< Real > &  v,
const std::vector< Real > &  u,
const std::vector< Real > &  z 
)
inline
template<class Real>
void Objective_PoissonInversion< Real >::solve_adjoint_sensitivity_equation ( std::vector< Real > &  q,
const std::vector< Real > &  w,
const std::vector< Real > &  v,
const std::vector< Real > &  p,
const std::vector< Real > &  u,
const std::vector< Real > &  z 
)
inline
template<class Real>
void Objective_PoissonInversion< Real >::update ( const ROL::Vector< Real > &  x,
bool  flag,
int  iter 
)
inlinevirtual

Update objective function.

This function updates the objective function at new iterations.

Parameters
[in]xis the new iterate.
[in]flagis true if the iterate has changed.
[in]iteris the outer algorithm iterations count.

Reimplemented from ROL::Objective< Real >.

Definition at line 247 of file poisson-inversion/example_02.cpp.

References ROL::Vector< Real >::basis(), ROL::Vector< Real >::clone(), Objective_PoissonInversion< Real >::H_, Objective_PoissonInversion< Real >::hessVec_true(), Objective_PoissonInversion< Real >::nz_, and Objective_PoissonInversion< Real >::useCorrection_.

template<class Real>
Real Objective_PoissonInversion< Real >::value ( const ROL::Vector< Real > &  x,
Real &  tol 
)
inlinevirtual
template<class Real>
void Objective_PoissonInversion< Real >::gradient ( ROL::Vector< Real > &  g,
const ROL::Vector< Real > &  x,
Real &  tol 
)
inlinevirtual

Compute gradient.

This function returns the objective function gradient.

Parameters
[out]gis the gradient.
[in]xis the current iterate.
[in]tolis a tolerance for inexact objective function computation.

The default implementation is a finite-difference approximation based on the function value. This requires the definition of a basis \(\{\phi_i\}\) for the optimization vectors x and the definition of a basis \(\{\psi_j\}\) for the dual optimization vectors (gradient vectors g). The bases must be related through the Riesz map, i.e., \( R \{\phi_i\} = \{\psi_j\}\), and this must be reflected in the implementation of the ROL::Vector::dual() method.

Reimplemented from ROL::Objective< Real >.

Definition at line 328 of file poisson-inversion/example_02.cpp.

References Objective_PoissonInversion< Real >::alpha_, Objective_PoissonInversion< Real >::apply_transposed_linearized_control_operator(), Objective_PoissonInversion< Real >::getVector(), Objective_PoissonInversion< Real >::hz_, Objective_PoissonInversion< Real >::nu_, Objective_PoissonInversion< Real >::nz_, Objective_PoissonInversion< Real >::solve_adjoint_equation(), and Objective_PoissonInversion< Real >::solve_state_equation().

template<class Real>
void Objective_PoissonInversion< Real >::hessVec ( ROL::Vector< Real > &  hv,
const ROL::Vector< Real > &  v,
const ROL::Vector< Real > &  x,
Real &  tol 
)
inlinevirtual

Apply Hessian approximation to vector.

This function applies the Hessian of the objective function to the vector \(v\).

Parameters
[out]hvis the the action of the Hessian on \(v\).
[in]vis the direction vector.
[in]xis the current iterate.
[in]tolis a tolerance for inexact objective function computation.

Reimplemented from ROL::Objective< Real >.

Definition at line 351 of file poisson-inversion/example_02.cpp.

References Objective_PoissonInversion< Real >::hessVec_inertia(), Objective_PoissonInversion< Real >::hessVec_true(), and Objective_PoissonInversion< Real >::useCorrection_.

template<class Real>
void Objective_PoissonInversion< Real >::activateInertia ( void  )
inline
template<class Real>
void Objective_PoissonInversion< Real >::deactivateInertia ( void  )
inline
template<class Real>
void Objective_PoissonInversion< Real >::hessVec_true ( ROL::Vector< Real > &  hv,
const ROL::Vector< Real > &  v,
const ROL::Vector< Real > &  z,
Real &  tol 
)
inline
template<class Real>
void Objective_PoissonInversion< Real >::hessVec_inertia ( ROL::Vector< Real > &  hv,
const ROL::Vector< Real > &  v,
const ROL::Vector< Real > &  z,
Real &  tol 
)
inline

Member Data Documentation

template<class Real>
uint Objective_PoissonInversion< Real >::nu_
private
template<class Real>
uint Objective_PoissonInversion< Real >::nz_
private
template<class Real>
Real Objective_PoissonInversion< Real >::hu_
private
template<class Real>
Real Objective_PoissonInversion< Real >::hz_
private
template<class Real>
Real Objective_PoissonInversion< Real >::u0_
private
template<class Real>
Real Objective_PoissonInversion< Real >::u1_
private
template<class Real>
Real Objective_PoissonInversion< Real >::alpha_
private
template<class Real>
bool Objective_PoissonInversion< Real >::useCorrection_
private
template<class Real>
Teuchos::SerialDenseMatrix<int, Real> Objective_PoissonInversion< Real >::H_
private

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