10 #ifndef ROL_SLACKLESSOBJECTIVE_DEF_HPP
11 #define ROL_SLACKLESSOBJECTIVE_DEF_HPP
15 template<
typename Real>
18 template<
typename Real>
23 template<
typename Real>
25 obj_->update( *getOpt(x), type, iter );
28 template<
typename Real>
30 obj_->update( *getOpt(x), flag, iter );
33 template<
typename Real>
35 return obj_->value( *getOpt(x), tol );
38 template<
typename Real>
40 return obj_->dirDeriv(*getOpt(x),*getOpt(d),tol);
43 template<
typename Real>
46 obj_->gradient(*getOpt(g),*getOpt(x),tol);
49 template<
typename Real>
52 obj_->hessVec(*getOpt(hv),*getOpt(v),*getOpt(x),tol);
55 template<
typename Real>
57 obj_->invHessVec( *getOpt(ihv), *getOpt(v), *getOpt(x), tol );
60 const int nvec =
static_cast<int>(vp.
numVectors());
61 for (
int i = 1; i < nvec; ++i) {
62 Pvp.
get(i)->set(vp.
get(i)->dual());
66 template<
typename Real>
68 obj_->precond( *getOpt(Pv), *getOpt(v), *getOpt(x), tol );
71 const int nvec =
static_cast<int>(vp.
numVectors());
72 for (
int i = 1; i < nvec; ++i) {
73 Pvp.
get(i)->set(vp.
get(i)->dual());
77 template<
typename Real>
80 obj_->setParameter(param);
83 template<
typename Real>
88 template<
typename Real>
93 template<
typename Real>
97 const int nvec =
static_cast<int>(xpv.
numVectors());
98 for (
int i = 1; i < nvec; ++i) {
105 #endif // ROL__SLACKLESSOBJECTIVE_HPP
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
Real dirDeriv(const Vector< Real > &x, const Vector< Real > &d, Real &tol) override
Compute directional derivative.
Provides the interface to evaluate objective functions.
void setParameter(const std::vector< Real > ¶m) override
size_type numVectors() const
ROL::Ptr< const Vector< Real > > get(size_type i) const
Defines the linear algebra of vector space on a generic partitioned vector.
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update objective function.
void zeroSlack(Vector< Real > &x) const
Defines the linear algebra or vector space interface.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply Hessian approximation to vector.
void precond(Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply preconditioner to vector.
Real value(const Vector< Real > &x, Real &tol) override
Compute value.
Ptr< Vector< Real > > getOpt(Vector< Real > &xs) const
virtual void setParameter(const std::vector< Real > ¶m)
SlacklessObjective(const Ptr< Objective< Real >> &obj)
Ptr< Objective< Real > > getObjective(void) const
void invHessVec(Vector< Real > &ihv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply inverse Hessian approximation to vector.