ROL
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 void prox (Vector< Real > &Pv, const Vector< Real > &v, Real t, Real &tol)
 Compute the proximity operator.
virtual void proxJacVec (Vector< Real > &Jv, const Vector< Real > &v, const Vector< Real > &x, Real t, Real &tol)
 Apply the Jacobian of the proximity operator.
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 std::vector< std::vector< Real > > checkProxJacVec (const Vector< Real > &x, const Vector< Real > &v, Real t=Real(1), bool printToStream=true, std::ostream &outStream=std::cout, int numSteps=ROL_NUM_CHECKDERIV_STEPS)
 Finite-difference proximity operator Jacobian-applied-to-vector 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 34 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 36 of file poisson-inversion/example_02.cpp.

◆ V

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

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

◆ SV

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

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

◆ uint

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

◆ Objective_PoissonInversion()

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

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

References alpha_, hu_, hz_, nu_, nz_, u0_, u1_, and useCorrection_.

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

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

References getVector().

◆ apply_mass()

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

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

References hu_, and nu_.

Referenced by solve_adjoint_equation(), and solve_adjoint_sensitivity_equation().

◆ evaluate_target()

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

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

Referenced by solve_adjoint_equation(), and value().

◆ 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

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

References hu_, nu_, nz_, u0_, and u1_.

Referenced by gradient(), and hessVec_true().

◆ solve_state_equation()

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

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

References hu_, nu_, nz_, u0_, and u1_.

Referenced by gradient(), hessVec_true(), main(), and value().

◆ 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

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

References apply_mass(), evaluate_target(), hu_, and nu_.

Referenced by gradient(), and hessVec_true().

◆ 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

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

References apply_linearized_control_operator(), hu_, and nu_.

Referenced by hessVec_true().

◆ 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

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

References apply_linearized_control_operator(), apply_mass(), hu_, and nu_.

Referenced by hessVec_true().

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

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

◆ value()

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

Compute value.

This function returns the objective function value.

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

Implements ROL::Objective< Real >.

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

References alpha_, evaluate_target(), getVector(), hu_, hz_, nu_, nz_, and solve_state_equation().

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

References alpha_, apply_transposed_linearized_control_operator(), getVector(), hz_, nu_, nz_, solve_adjoint_equation(), and 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 351 of file poisson-inversion/example_02.cpp.

References hessVec_inertia(), hessVec_true(), and useCorrection_.

◆ activateInertia()

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

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

References useCorrection_.

◆ deactivateInertia()

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

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

References useCorrection_.

Referenced by main().

◆ 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

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

References getVector(), H_, and nz_.

Referenced by hessVec().

Member Data Documentation

◆ nu_

◆ nz_

◆ hu_

◆ hz_

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

◆ u0_

◆ u1_

◆ 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

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

Referenced by hessVec_inertia(), and update().


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