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.
 
Real value (const ROL::Vector< Real > &z, Real &tol)
 Compute value.
 
void gradient (ROL::Vector< Real > &g, const ROL::Vector< Real > &z, Real &tol)
 Compute gradient.
 
void hessVec (ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &z, Real &tol)
 Apply Hessian approximation to vector.
 
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.
 
virtual Real dirDeriv (const Vector< Real > &x, const Vector< Real > &d, Real &tol)
 Compute directional derivative.
 
virtual void invHessVec (Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 Apply inverse Hessian approximation to vector.
 
virtual void precond (Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
 Apply preconditioner to vector.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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 68 of file poisson-inversion/example_02.cpp.

Member Typedef Documentation

◆ vector

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

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

◆ V

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

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

◆ SV

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

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

◆ uint

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

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

Constructor & Destructor Documentation

◆ Objective_PoissonInversion()

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

Member Function Documentation

◆ getVector() [1/2]

template<class Real >
ROL::Ptr< const vector > Objective_PoissonInversion< Real >::getVector ( const V & x)
inlineprivate

◆ getVector() [2/2]

template<class Real >
ROL::Ptr< vector > Objective_PoissonInversion< Real >::getVector ( V & x)
inlineprivate

◆ apply_mass()

template<class Real >
void Objective_PoissonInversion< Real >::apply_mass ( std::vector< Real > & Mz,
const std::vector< Real > & z )
inline

◆ evaluate_target()

template<class Real >
Real Objective_PoissonInversion< Real >::evaluate_target ( Real x)
inline

◆ apply_linearized_control_operator()

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

◆ apply_transposed_linearized_control_operator()

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

◆ solve_state_equation()

template<class Real >
void Objective_PoissonInversion< Real >::solve_state_equation ( std::vector< Real > & u,
const std::vector< Real > & z )
inline

◆ solve_adjoint_equation()

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

◆ solve_state_sensitivity_equation()

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

◆ solve_adjoint_sensitivity_equation()

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

◆ update()

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 281 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_.

◆ value()

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

◆ gradient()

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 362 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().

◆ hessVec()

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 385 of file poisson-inversion/example_02.cpp.

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

◆ activateInertia()

template<class Real >
void Objective_PoissonInversion< Real >::activateInertia ( void )
inline

◆ deactivateInertia()

template<class Real >
void Objective_PoissonInversion< Real >::deactivateInertia ( void )
inline

◆ hessVec_true()

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

◆ hessVec_inertia()

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

◆ nu_

template<class Real >
uint Objective_PoissonInversion< Real >::nu_
private

◆ nz_

template<class Real >
uint Objective_PoissonInversion< Real >::nz_
private

◆ hu_

template<class Real >
Real Objective_PoissonInversion< Real >::hu_
private

◆ hz_

template<class Real >
Real Objective_PoissonInversion< Real >::hz_
private

◆ u0_

template<class Real >
Real Objective_PoissonInversion< Real >::u0_
private

◆ u1_

template<class Real >
Real Objective_PoissonInversion< Real >::u1_
private

◆ alpha_

template<class Real >
Real Objective_PoissonInversion< Real >::alpha_
private

◆ useCorrection_

template<class Real >
bool Objective_PoissonInversion< Real >::useCorrection_
private

◆ H_

template<class Real >
Teuchos::SerialDenseMatrix<int, Real> Objective_PoissonInversion< Real >::H_
private

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