ROL
|
#include <ROL_HelperFunctions.hpp>
Public Member Functions | |
ProjectedObjective (Objective< Real > &obj, BoundConstraint< Real > &con, Teuchos::RCP< Secant< Real > > &secant, bool useSecantPrecond=false, bool useSecantHessVec=false, Real eps=0.0) | |
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... | |
Real | dirDeriv (const Vector< Real > &x, const Vector< Real > &d, Real &tol) |
Compute directional derivative. More... | |
void | hessVec (Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Apply Hessian approximation to vector. More... | |
void | invHessVec (Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Apply inverse Hessian approximation to vector. More... | |
void | precond (Vector< Real > &Mv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Apply preconditioner to vector. More... | |
void | reducedHessVec (Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &p, const Vector< Real > &d, const Vector< Real > &x, Real &tol) |
Apply the reduced Hessian to a vector, v. The reduced Hessian first removes elements of v corresponding to the feasible indices from the point p in the direction -d. Hv the Hessian times a vector v input vector p starting point for tangent cone d negative of search direction x current iteration vector tol objective function tolerance. More... | |
void | reducedHessVec (Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &p, const Vector< Real > &x, Real &tol) |
Apply the reduced Hessian to a vector, v. The reduced Hessian first removes elements of v corresponding to the feasible indices from the point p. Hv the Hessian times a vector v input vector p starting point for tangent cone x current iteration vector tol objective function tolerance. More... | |
void | reducedInvHessVec (Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &p, const Vector< Real > &d, const Vector< Real > &x, Real &tol) |
Apply the reduced inverse Hessian to a vector, v. The reduced inverse Hessian first removes elements of v corresponding to the feasible indices from the point p in the direction -d. Hv the inverse Hessian times a vector v input vector p starting point for tangent cone d negative of search direction x current iteration vector tol objective function tolerance. More... | |
void | reducedInvHessVec (Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &p, const Vector< Real > &x, Real &tol) |
Apply the reduced inverse Hessian to a vector, v. The reduced inverse Hessian first removes elements of v corresponding to the feasible indices from the point p. Hv the inverse Hessian times a vector v input vector p starting point for tangent cone x current iteration vector tol objective function tolerance. More... | |
void | reducedPrecond (Vector< Real > &Mv, const Vector< Real > &v, const Vector< Real > &p, const Vector< Real > &d, const Vector< Real > &x, Real &tol) |
Apply the reduced preconditioner to a vector, v. The reduced preconditioner first removes elements of v corresponding to the feasible indices from the point p in the direction -d. Hv the preconditioner times a vector v input vector p starting point for tangent cone d negative of search direction x current iteration vector tol objective function tolerance. More... | |
void | reducedPrecond (Vector< Real > &Mv, const Vector< Real > &v, const Vector< Real > &p, const Vector< Real > &x, Real &tol) |
Apply the reduced preconditioner to a vector, v. The reduced preconditioner first removes elements of v corresponding to the feasible indices from the point p. Hv the preconditioner times a vector v input vector p starting point for tangent cone x current iteration vector tol objective function tolerance. More... | |
void | project (Vector< Real > &x) |
void | pruneActive (Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x) |
void | pruneActive (Vector< Real > &v, const Vector< Real > &x) |
void | pruneInactive (Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x) |
void | pruneInactive (Vector< Real > &v, const Vector< Real > &x) |
bool | isFeasible (const Vector< Real > &v) |
bool | isConActivated (void) |
void | computeProjectedStep (Vector< Real > &v, const Vector< Real > &x) |
![]() | |
virtual | ~Objective () |
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... | |
Private Attributes | |
Teuchos::RCP< Objective< Real > > | obj_ |
Teuchos::RCP< BoundConstraint< Real > > | con_ |
Teuchos::RCP< Secant< Real > > | secant_ |
Teuchos::RCP< ROL::Vector< Real > > | primalV_ |
Teuchos::RCP< ROL::Vector< Real > > | dualV_ |
bool | isInitialized_ |
bool | useSecantPrecond_ |
bool | useSecantHessVec_ |
Real | eps_ |
Definition at line 220 of file ROL_HelperFunctions.hpp.
|
inline |
Definition at line 235 of file ROL_HelperFunctions.hpp.
|
inlinevirtual |
Update objective function.
This function updates the objective function at new iterations.
[in] | x | is the new iterate. |
[in] | flag | is true if the iterate has changed. |
[in] | iter | is the outer algorithm iterations count. |
Reimplemented from ROL::Objective< Real >.
Definition at line 247 of file ROL_HelperFunctions.hpp.
Referenced by ROL::TrustRegion< Real >::update(), ROL::TrustRegionStep< Real >::update(), and ROL::TrustRegion< Real >::updateObj().
|
inlinevirtual |
Compute value.
This function returns the objective function value.
[in] | x | is the current iterate. |
[in] | tol | is a tolerance for inexact objective function computation. |
Implements ROL::Objective< Real >.
Definition at line 252 of file ROL_HelperFunctions.hpp.
Referenced by ROL::TrustRegion< Real >::update(), and ROL::TrustRegionStep< Real >::update().
|
inlinevirtual |
Compute gradient.
This function returns the objective function gradient.
[out] | g | is the gradient. |
[in] | x | is the current iterate. |
[in] | tol | is 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 256 of file ROL_HelperFunctions.hpp.
|
inlinevirtual |
Compute directional derivative.
This function returns the directional derivative of the objective function in the \(d\) direction.
[in] | x | is the current iterate. |
[in] | d | is the direction. |
[in] | tol | is a tolerance for inexact objective function computation. |
Reimplemented from ROL::Objective< Real >.
Definition at line 260 of file ROL_HelperFunctions.hpp.
|
inlinevirtual |
Apply Hessian approximation to vector.
This function applies the Hessian of the objective function to the vector \(v\).
[out] | hv | is the the action of the Hessian on \(v\). |
[in] | v | is the direction vector. |
[in] | x | is the current iterate. |
[in] | tol | is a tolerance for inexact objective function computation. |
Reimplemented from ROL::Objective< Real >.
Definition at line 264 of file ROL_HelperFunctions.hpp.
Referenced by ROL::CauchyPoint< Real >::cauchypoint_CGT(), ROL::CauchyPoint< Real >::cauchypoint_M(), ROL::CauchyPoint< Real >::cauchypoint_unc(), ROL::TrustRegion< Real >::getPredictedReduction(), ROL::ProjectedObjective< Real >::reducedHessVec(), and ROL::TrustRegion< Real >::update().
|
inlinevirtual |
Apply inverse Hessian approximation to vector.
This function applies the inverse Hessian of the objective function to the vector \(v\).
[out] | hv | is the action of the inverse Hessian on \(v\). |
[in] | v | is the direction vector. |
[in] | x | is the current iterate. |
[in] | tol | is a tolerance for inexact objective function computation. |
Reimplemented from ROL::Objective< Real >.
Definition at line 273 of file ROL_HelperFunctions.hpp.
Referenced by ROL::ProjectedObjective< Real >::reducedInvHessVec().
|
inlinevirtual |
Apply preconditioner to vector.
This function applies a preconditioner for the Hessian of the objective function to the vector \(v\).
[out] | Pv | is the action of the Hessian preconditioner on \(v\). |
[in] | v | is the direction vector. |
[in] | x | is the current iterate. |
[in] | tol | is a tolerance for inexact objective function computation. |
Reimplemented from ROL::Objective< Real >.
Definition at line 282 of file ROL_HelperFunctions.hpp.
Referenced by ROL::ProjectedObjective< Real >::reducedPrecond().
|
inline |
Apply the reduced Hessian to a vector, v. The reduced Hessian first removes elements of v corresponding to the feasible indices from the point p in the direction -d. Hv the Hessian times a vector v input vector p starting point for tangent cone d negative of search direction x current iteration vector tol objective function tolerance.
Definition at line 302 of file ROL_HelperFunctions.hpp.
References ROL::Vector< Real >::clone(), ROL::Vector< Real >::dual(), ROL::ProjectedObjective< Real >::hessVec(), and ROL::Vector< Real >::plus().
Referenced by ROL::DogLeg< Real >::run(), ROL::DoubleDogLeg< Real >::run(), ROL::TruncatedCG< Real >::run(), and ROL::TrustRegion< Real >::update().
|
inline |
Apply the reduced Hessian to a vector, v. The reduced Hessian first removes elements of v corresponding to the feasible indices from the point p. Hv the Hessian times a vector v input vector p starting point for tangent cone x current iteration vector tol objective function tolerance.
Definition at line 342 of file ROL_HelperFunctions.hpp.
References ROL::Vector< Real >::clone(), ROL::Vector< Real >::dual(), ROL::ProjectedObjective< Real >::hessVec(), and ROL::Vector< Real >::plus().
|
inline |
Apply the reduced inverse Hessian to a vector, v. The reduced inverse Hessian first removes elements of v corresponding to the feasible indices from the point p in the direction -d. Hv the inverse Hessian times a vector v input vector p starting point for tangent cone d negative of search direction x current iteration vector tol objective function tolerance.
Definition at line 383 of file ROL_HelperFunctions.hpp.
References ROL::Vector< Real >::clone(), ROL::Vector< Real >::dual(), ROL::ProjectedObjective< Real >::invHessVec(), and ROL::Vector< Real >::plus().
Referenced by ROL::DogLeg< Real >::run(), and ROL::DoubleDogLeg< Real >::run().
|
inline |
Apply the reduced inverse Hessian to a vector, v. The reduced inverse Hessian first removes elements of v corresponding to the feasible indices from the point p. Hv the inverse Hessian times a vector v input vector p starting point for tangent cone x current iteration vector tol objective function tolerance.
Definition at line 423 of file ROL_HelperFunctions.hpp.
References ROL::Vector< Real >::clone(), ROL::Vector< Real >::dual(), ROL::ProjectedObjective< Real >::invHessVec(), and ROL::Vector< Real >::plus().
|
inline |
Apply the reduced preconditioner to a vector, v. The reduced preconditioner first removes elements of v corresponding to the feasible indices from the point p in the direction -d. Hv the preconditioner times a vector v input vector p starting point for tangent cone d negative of search direction x current iteration vector tol objective function tolerance.
Definition at line 464 of file ROL_HelperFunctions.hpp.
References ROL::Vector< Real >::clone(), ROL::Vector< Real >::dual(), ROL::Vector< Real >::plus(), and ROL::ProjectedObjective< Real >::precond().
Referenced by ROL::TruncatedCG< Real >::run().
|
inline |
Apply the reduced preconditioner to a vector, v. The reduced preconditioner first removes elements of v corresponding to the feasible indices from the point p. Hv the preconditioner times a vector v input vector p starting point for tangent cone x current iteration vector tol objective function tolerance.
Definition at line 504 of file ROL_HelperFunctions.hpp.
References ROL::Vector< Real >::clone(), ROL::Vector< Real >::dual(), ROL::Vector< Real >::plus(), and ROL::ProjectedObjective< Real >::precond().
|
inline |
Definition at line 534 of file ROL_HelperFunctions.hpp.
Referenced by ROL::CauchyPoint< Real >::cauchypoint_CGT(), and ROL::TrustRegion< Real >::update().
|
inline |
Definition at line 538 of file ROL_HelperFunctions.hpp.
Referenced by ROL::CauchyPoint< Real >::cauchypoint_CGT(), ROL::TruncatedCG< Real >::run(), and ROL::TrustRegion< Real >::update().
|
inline |
Definition at line 542 of file ROL_HelperFunctions.hpp.
|
inline |
Definition at line 546 of file ROL_HelperFunctions.hpp.
|
inline |
Definition at line 550 of file ROL_HelperFunctions.hpp.
|
inline |
Definition at line 554 of file ROL_HelperFunctions.hpp.
Referenced by ROL::TrustRegion< Real >::getPredictedReduction(), and ROL::TrustRegion< Real >::update().
|
inline |
Definition at line 558 of file ROL_HelperFunctions.hpp.
Referenced by ROL::TrustRegion< Real >::getPredictedReduction(), ROL::CauchyPoint< Real >::run(), ROL::TruncatedCG< Real >::run(), and ROL::TrustRegion< Real >::update().
|
inline |
Definition at line 562 of file ROL_HelperFunctions.hpp.
Referenced by ROL::CauchyPoint< Real >::cauchypoint_M(), and ROL::TrustRegion< Real >::getPredictedReduction().
|
private |
Definition at line 222 of file ROL_HelperFunctions.hpp.
|
private |
Definition at line 223 of file ROL_HelperFunctions.hpp.
|
private |
Definition at line 224 of file ROL_HelperFunctions.hpp.
|
private |
Definition at line 226 of file ROL_HelperFunctions.hpp.
|
private |
Definition at line 227 of file ROL_HelperFunctions.hpp.
|
private |
Definition at line 228 of file ROL_HelperFunctions.hpp.
|
private |
Definition at line 230 of file ROL_HelperFunctions.hpp.
|
private |
Definition at line 231 of file ROL_HelperFunctions.hpp.
|
private |
Definition at line 232 of file ROL_HelperFunctions.hpp.