44 #ifndef ROL_REDUCEDDYNAMICOBJECTIVE_HPP 45 #define ROL_REDUCEDDYNAMICOBJECTIVE_HPP 47 #include "ROL_Ptr.hpp" 78 template<
typename Real>
83 const Ptr<DynamicObjective<Real>>
obj_;
84 const Ptr<DynamicConstraint<Real>>
con_;
85 const Ptr<Vector<Real>>
u0_;
136 ROL::ParameterList &pl)
140 timeStamp_ ( timeStamp ),
141 Nt_ ( timeStamp.size() ),
142 useSketch_ ( pl.get(
"Use Sketching", true) ),
143 rankState_ ( pl.get(
"State Rank", 10) ),
144 stateSketch_ ( nullPtr ),
145 rankAdjoint_ ( pl.get(
"Adjoint Rank", 10) ),
146 adjointSketch_ ( nullPtr ),
147 rankStateSens_ ( pl.get(
"State Sensitivity Rank", 10) ),
148 stateSensSketch_ ( nullPtr ),
149 useInexact_ ( pl.get(
"Adaptive Rank", false) ),
150 updateFactor_ ( pl.get(
"Rank Update Factor", 2.0) ),
151 maxRank_ ( pl.get(
"Maximum Rank", Nt_) ),
152 isValueComputed_ ( false ),
153 isStateComputed_ ( false ),
154 isAdjointComputed_ ( false ),
155 useHessian_ ( pl.get(
"Use Hessian", true) ),
156 useSymHess_ ( pl.get(
"Use Only Sketched Sensitivity", true) ) {
157 uhist_.clear(); lhist_.clear(); whist_.clear(); phist_.clear();
159 stateSketch_ = makePtr<Sketch<Real>>(*
u0_,
static_cast<int>(
Nt_)-1,rankState_);
160 uhist_.push_back(u0_->clone());
161 uhist_.push_back(u0_->clone());
162 lhist_.push_back(cvec->dual().clone());
163 adjointSketch_ = makePtr<Sketch<Real>>(*
u0_,
static_cast<int>(
Nt_)-1,rankAdjoint_);
165 stateSensSketch_ = makePtr<Sketch<Real>>(*
u0_,
static_cast<int>(
Nt_)-1,rankStateSens_);
166 whist_.push_back(u0_->clone());
167 whist_.push_back(u0_->clone());
168 phist_.push_back(cvec->dual().clone());
173 uhist_.push_back(u0_->clone());
174 lhist_.push_back(cvec->dual().clone());
176 whist_.push_back(u0_->clone());
177 phist_.push_back(cvec->dual().clone());
181 cprimal_ = cvec->clone();
182 crhs_ = cvec->clone();
183 udual_ = u0_->dual().clone();
184 rhs_ = u0_->dual().clone();
185 zdual_ = zvec->dual().clone();
194 stateSketch_->update();
196 adjointSketch_->update();
198 stateSensSketch_->update();
202 for (
size_type i = 0; i < uhist_.size(); ++i) {
205 val_ =
static_cast<Real
>(0);
206 isValueComputed_ =
false;
207 isStateComputed_ =
false;
209 isAdjointComputed_ =
false;
214 if (!isValueComputed_) {
218 uhist_[0]->set(*u0_);
220 stateSketch_->update();
227 index = (useSketch_ ? 1 : k);
229 con_->update(*uhist_[index-1], *uhist_[index], *xp.
get(k), timeStamp_[k]);
230 obj_->update(*uhist_[index-1], *uhist_[index], *xp.
get(k), timeStamp_[k]);
232 con_->solve(*cprimal_, *uhist_[index-1], *uhist_[index], *xp.
get(k), timeStamp_[k]);
234 valk = obj_->value(*uhist_[index-1], *uhist_[index], *xp.
get(k), timeStamp_[k]);
239 stateSketch_->advance(one,*uhist_[1],static_cast<int>(k)-1,one);
240 uhist_[0]->set(*uhist_[1]);
243 isValueComputed_ =
true;
244 isStateComputed_ =
true;
253 size_type uindex = (useSketch_ ? 1 : Nt_-1);
254 size_type lindex = (useSketch_ ? 0 : Nt_-1);
257 if (useSketch_ && useInexact_) {
262 uhist_[1]->set(*uhist_[0]);
263 stateSketch_->reconstruct(*uhist_[0],static_cast<int>(Nt_)-3);
264 if (isAdjointComputed_) {
265 adjointSketch_->reconstruct(*lhist_[0],static_cast<int>(Nt_)-2);
269 con_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
270 obj_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
272 if (!isAdjointComputed_) {
274 *uhist_[uindex-1], *uhist_[uindex],
275 *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
277 adjointSketch_->advance(one,*lhist_[0],static_cast<int>(Nt_)-2,one);
282 *uhist_[uindex-1], *uhist_[uindex],
283 *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
286 if (!isAdjointComputed_) {
289 *uhist_[uindex-1], *uhist_[uindex],
290 *xp.
get(k+1), timeStamp_[k+1]);
292 uindex = (useSketch_ ? 1 : k);
293 lindex = (useSketch_ ? 0 : k);
296 uhist_[1]->set(*uhist_[0]);
298 uhist_[0]->set(*u0_);
301 stateSketch_->reconstruct(*uhist_[0],static_cast<int>(k)-2);
303 if (isAdjointComputed_) {
304 adjointSketch_->reconstruct(*lhist_[0],static_cast<int>(k)-1);
308 con_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(k), timeStamp_[k]);
309 obj_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(k), timeStamp_[k]);
311 if (!isAdjointComputed_) {
313 *uhist_[uindex-1], *uhist_[uindex],
314 *xp.
get(k), timeStamp_[k]);
316 adjointSketch_->advance(one,*lhist_[0],static_cast<int>(k)-1,one);
321 *uhist_[uindex-1], *uhist_[uindex],
322 *xp.
get(k), timeStamp_[k]);
324 isAdjointComputed_ =
true;
340 stateSensSketch_->update();
342 uhist_[0]->set(*u0_);
346 uindex = (useSketch_ ? 1 : k);
347 lindex = (useSketch_ ? 0 : k);
350 stateSketch_->reconstruct(*uhist_[1],static_cast<int>(k)-1);
351 adjointSketch_->reconstruct(*lhist_[0],static_cast<int>(k)-1);
354 con_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(k), timeStamp_[k]);
355 obj_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(k), timeStamp_[k]);
358 *vp.
get(k), *whist_[uindex-1],
359 *uhist_[uindex-1], *uhist_[uindex],
360 *xp.
get(k), timeStamp_[k]);
363 *vp.
get(k), *lhist_[lindex],
364 *uhist_[uindex-1], *uhist_[uindex],
365 *xp.
get(k), timeStamp_[k]);
369 *whist_[uindex-1], *whist_[uindex],
370 *uhist_[uindex-1], *uhist_[uindex],
371 *xp.
get(k), timeStamp_[k]);
375 stateSensSketch_->advance(one,*whist_[1],static_cast<int>(k)-1,one);
376 whist_[0]->set(*whist_[1]);
377 uhist_[0]->set(*uhist_[1]);
382 uindex = (useSketch_ ? 1 : Nt_-1);
383 lindex = (useSketch_ ? 0 : Nt_-1);
386 uhist_[1]->set(*uhist_[0]);
387 stateSketch_->reconstruct(*uhist_[0],static_cast<int>(Nt_)-3);
389 adjointSketch_->reconstruct(*lhist_[0],static_cast<int>(Nt_)-2);
391 whist_[1]->set(*whist_[0]);
392 stateSensSketch_->reconstruct(*whist_[0],static_cast<int>(Nt_)-3);
395 con_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
396 obj_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
399 *vp.
get(Nt_-1), *lhist_[lindex],
400 *whist_[uindex-1], *whist_[uindex],
401 *uhist_[uindex-1], *uhist_[uindex],
402 *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
406 *whist_[uindex-1], *whist_[uindex],
407 *uhist_[uindex-1], *uhist_[uindex],
408 *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
412 *uhist_[uindex-1], *uhist_[uindex],
413 *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
418 *whist_[uindex-1], *whist_[uindex],
419 *uhist_[uindex-1], *uhist_[uindex],
420 *xp.
get(k+1), timeStamp_[k+1],
423 *vp.
get(k+1), *lhist_[lindex],
424 *uhist_[uindex-1], *uhist_[uindex],
425 *xp.
get(k+1), timeStamp_[k+1],
428 *uhist_[uindex-1], *uhist_[uindex],
429 *xp.
get(k+1), timeStamp_[k+1],
433 uhist_[1]->set(*uhist_[0]);
434 whist_[1]->set(*whist_[0]);
436 uhist_[0]->set(*u0_);
440 stateSketch_->reconstruct(*uhist_[0],static_cast<int>(k)-2);
441 stateSensSketch_->reconstruct(*whist_[0],static_cast<int>(k)-2);
443 adjointSketch_->reconstruct(*lhist_[0],static_cast<int>(k)-1);
445 uindex = (useSketch_ ? 1 : k);
446 lindex = (useSketch_ ? 0 : k);
448 con_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(k), timeStamp_[k]);
449 obj_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(k), timeStamp_[k]);
452 *whist_[uindex-1], *whist_[uindex],
453 *uhist_[uindex-1], *uhist_[uindex],
454 *xp.
get(k), timeStamp_[k],
457 *vp.
get(k), *lhist_[lindex],
458 *uhist_[uindex-1], *uhist_[uindex],
459 *xp.
get(k), timeStamp_[k],
463 *uhist_[uindex-1], *uhist_[uindex],
464 *xp.
get(k), timeStamp_[k]);
468 *whist_[uindex-1], *whist_[uindex],
469 *uhist_[uindex-1], *uhist_[uindex],
470 *xp.
get(k), timeStamp_[k]);
474 *uhist_[uindex-1], *uhist_[uindex],
475 *xp.
get(k), timeStamp_[k]);
488 if (!isStateComputed_) {
492 uhist_[0]->set(*u0_);
499 index = (useSketch_ ? 1 : k);
501 con_->update(*uhist_[index-1], *uhist_[index], *xp.
get(k), timeStamp_[k]);
502 obj_->update(*uhist_[index-1], *uhist_[index], *xp.
get(k), timeStamp_[k]);
504 con_->solve(*cprimal_, *uhist_[index-1], *uhist_[index], *xp.
get(k), timeStamp_[k]);
507 stateSketch_->advance(one,*uhist_[index],static_cast<int>(k)-1,one);
508 uhist_[index-1]->set(*uhist_[index]);
511 isStateComputed_ =
true;
517 Real err(0), cnorm(0);
520 err =
static_cast<Real
>(0);
521 uhist_[0]->set(*u0_);
523 stateSketch_->reconstruct(*uhist_[1],static_cast<int>(k));
524 con_->value(*cprimal_, *uhist_[0], *uhist_[1], *xp.
get(k), timeStamp_[k]);
525 cnorm = cprimal_->norm();
526 err = (cnorm > err ? cnorm : err);
534 stateSketch_->setRank(rankState_);
551 obj_->gradient_un(*udual_, uold, unew, z, ts);
552 con_->applyInverseAdjointJacobian_un(l, *udual_, uold, unew, z, ts);
559 obj_->gradient_uo(rhs, uold, unew, z, ts);
560 con_->applyAdjointJacobian_uo(*udual_, l, uold, unew, z, ts);
561 rhs.
axpy(-one,*udual_);
567 obj_->gradient_un(*udual_, uold, unew, z, ts);
569 con_->applyInverseAdjointJacobian_un(l, rhs, uold, unew, z, ts);
573 if (!isAdjointComputed_) {
576 size_type uindex = (useSketch_ ? 1 : Nt_-1);
577 size_type lindex = (useSketch_ ? 0 : Nt_-1);
582 uhist_[1]->set(*uhist_[0]);
583 stateSketch_->reconstruct(*uhist_[0],static_cast<int>(Nt_)-3);
586 con_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
587 obj_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
590 *uhist_[uindex-1], *uhist_[uindex],
591 *xp.
get(Nt_-1), timeStamp_[Nt_-1]);
593 adjointSketch_->advance(one,*lhist_[lindex],static_cast<int>(Nt_)-2,one);
599 *uhist_[uindex-1], *uhist_[uindex],
600 *xp.
get(k+1), timeStamp_[k+1]);
603 uhist_[1]->set(*uhist_[0]);
605 uhist_[0]->set(*u0_);
608 stateSketch_->reconstruct(*uhist_[0],static_cast<int>(k)-2);
611 uindex = (useSketch_ ? 1 : k);
612 lindex = (useSketch_ ? 0 : k);
614 con_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(k), timeStamp_[k]);
615 obj_->update(*uhist_[uindex-1], *uhist_[uindex], *xp.
get(k), timeStamp_[k]);
618 *uhist_[uindex-1], *uhist_[uindex],
619 *xp.
get(k), timeStamp_[k]);
621 adjointSketch_->advance(one,*lhist_[lindex],static_cast<int>(k)-1,one);
624 isAdjointComputed_ =
true;
635 obj_->gradient_z(g, uold, unew, z, ts);
636 con_->applyAdjointJacobian_z(*zdual_, l, uold, unew, z, ts);
637 g.
axpy(-one,*zdual_);
648 con_->applyJacobian_z(*crhs_, v, uold, unew, z, ts);
649 con_->applyJacobian_uo(*cprimal_, wold, uold, unew, z, ts);
650 crhs_->axpy(-one, *cprimal_);
651 con_->applyInverseJacobian_un(wnew, *crhs_, uold, unew, z, ts);
664 con_->applyAdjointHessian_z_un(*rhs_, l, v, uold, unew, z, ts);
665 obj_->hessVec_un_z(*udual_, v, uold, unew, z, ts);
666 rhs_->axpy(-one, *udual_);
668 con_->applyAdjointHessian_un_un(*udual_, l, wnew, uold, unew, z, ts);
669 rhs_->axpy(-one, *udual_);
670 obj_->hessVec_un_un(*udual_, wnew, uold, unew, z, ts);
672 con_->applyAdjointHessian_uo_un(*udual_, l, wold, uold, unew, z, ts);
673 rhs_->axpy(-one, *udual_);
674 obj_->hessVec_un_uo(*udual_, wold, uold, unew, z, ts);
677 con_->applyInverseAdjointJacobian_un(p, *rhs_, uold, unew, z, ts);
684 const bool sumInto =
false) {
688 obj_->hessVec_un_uo(Hv, wold, uold, unew, z, ts);
691 obj_->hessVec_un_uo(*udual_, wold, uold, unew, z, ts);
694 con_->applyAdjointHessian_uo_un(*udual_, l, wold, uold, unew, z, ts);
695 Hv.
axpy(-one,*udual_);
697 obj_->hessVec_un_un(*udual_, wnew, uold, unew, z, ts);
699 con_->applyAdjointHessian_un_un(*udual_, l, wnew, uold, unew, z, ts);
700 Hv.
axpy(-one,*udual_);
707 const bool sumInto =
false) {
711 con_->applyAdjointHessian_z_un(Hv, l, v, uold, unew, z, ts);
714 con_->applyAdjointHessian_z_un(*udual_, l, v, uold, unew, z, ts);
717 obj_->hessVec_un_z(*udual_, v, uold, unew, z, ts);
718 Hv.
axpy(-one, *udual_);
724 const bool sumInto =
false) {
727 con_->applyAdjointJacobian_uo(Hv, p, uold, unew, z, ts);
731 con_->applyAdjointJacobian_uo(*udual_, p, uold, unew, z, ts);
732 Hv.
axpy(-one, *udual_);
740 const bool sumInto =
false) {
744 obj_->hessVec_uo_un(Hv, wnew, uold, unew, z, ts);
747 obj_->hessVec_uo_un(*udual_, wnew, uold, unew, z, ts);
750 con_->applyAdjointHessian_un_uo(*udual_, l, wnew, uold, unew, z, ts);
751 Hv.
axpy(-one,*udual_);
753 obj_->hessVec_uo_uo(*udual_, wold, uold, unew, z, ts);
755 con_->applyAdjointHessian_uo_uo(*udual_, l, wold, uold, unew, z, ts);
756 Hv.
axpy(-one,*udual_);
763 const bool sumInto =
false) {
767 con_->applyAdjointHessian_z_uo(Hv, l, v, uold, unew, z, ts);
770 con_->applyAdjointHessian_z_uo(*udual_, l, v, uold, unew, z, ts);
773 obj_->hessVec_uo_z(*udual_, v, uold, unew, z, ts);
774 Hv.
axpy(-one,*udual_);
781 con_->applyInverseAdjointJacobian_un(p, rhs, uold, unew, z, ts);
793 obj_->hessVec_z_z(Hv, v, uold, unew, z, ts);
794 con_->applyAdjointHessian_z_z(*zdual_, l, v, uold, unew, z, ts);
795 Hv.
axpy(-one, *zdual_);
804 obj_->hessVec_z_uo(*zdual_, wold, uold, unew, z, ts);
805 Hv.
axpy(-one, *zdual_);
806 con_->applyAdjointHessian_uo_z(*zdual_, l, wold, uold, unew, z, ts);
809 obj_->hessVec_z_un(*zdual_, wnew, uold, unew, z, ts);
810 Hv.
axpy(-one, *zdual_);
811 con_->applyAdjointHessian_un_z(*zdual_, l, wnew, uold, unew, z, ts);
818 con_->applyAdjointJacobian_z(*zdual_, p, uold, unew, z, ts);
825 #endif // ROL_REDUCEDDYNAMICOBJECTIVE_HPP void advanceAdjointSens(Vector< Real > &p, Vector< Real > &rhs, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
Provides the interface to evaluate objective functions.
Ptr< Sketch< Real > > stateSensSketch_
static Ptr< PartitionedVector > create(std::initializer_list< Vp > vs)
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
typename PV< Real >::size_type size_type
virtual void scale(const Real alpha)=0
Compute where .
void computeOldStateHessLag(Vector< Real > &Hv, const Vector< Real > &l, const Vector< Real > &wold, const Vector< Real > &wnew, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts, const bool sumInto=false)
Defines the reduced time-dependent objective function interface for simulation-based optimization...
virtual void plus(const Vector &x)=0
Compute , where .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Ptr< Vector< Real > > udual_
Defines the time-dependent constraint operator interface for simulation-based optimization.
void computeNewStateJacobian(Vector< Real > &Hv, const Vector< Real > &p, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts, const bool sumInto=false)
Defines the linear algebra of vector space on a generic partitioned vector.
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
void addAdjointSens(Vector< Real > &Hv, const Vector< Real > &p, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
Ptr< Vector< Real > > crhs_
const std::vector< TimeStamp< Real > > timeStamp_
Contains local time step information.
Ptr< Vector< Real > > zdual_
Defines the linear algebra or vector space interface.
Defines the time-dependent objective function interface for simulation-based optimization. Computes time-local contributions of value, gradient, Hessian-vector product etc to a larger composite objective defined over the simulation time. In contrast to other objective classes Objective_TimeSimOpt has a default implementation of value which returns zero, as time-dependent simulation based optimization problems may have an objective value which depends only on the final state of the system.
void advanceAdjoint(Vector< Real > &l, Vector< Real > &rhs, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
void computeNewStateHessLag(Vector< Real > &Hv, const Vector< Real > &l, const Vector< Real > &wold, const Vector< Real > &wnew, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts, const bool sumInto=false)
void solveState(const Vector< Real > &x)
Ptr< Sketch< Real > > adjointSketch_
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Real updateSketch(const Vector< Real > &x, const Real tol)
typename std::vector< Real >::size_type size_type
PartitionedVector< Real > & partition(Vector< Real > &x) const
Ptr< Vector< Real > > makeDynamicVector(const Vector< Real > &x) const
void computeNewMixedHessLag(Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts, const bool sumInto=false)
const Ptr< DynamicObjective< Real > > obj_
Ptr< Vector< Real > > cprimal_
const Ptr< DynamicConstraint< Real > > con_
void advanceStateSens(Vector< Real > &wnew, const Vector< Real > &v, const Vector< Real > &wold, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
void computeControlHessLag(Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
std::vector< Ptr< Vector< Real > > > whist_
void solveAdjoint(const Vector< Real > &x)
void setTerminalCondition(Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
std::vector< Ptr< Vector< Real > > > uhist_
ReducedDynamicObjective(const Ptr< DynamicObjective< Real >> &obj, const Ptr< DynamicConstraint< Real >> &con, const Ptr< Vector< Real >> &u0, const Ptr< Vector< Real >> &zvec, const Ptr< Vector< Real >> &cvec, const std::vector< TimeStamp< Real >> &timeStamp, ROL::ParameterList &pl)
std::vector< Ptr< Vector< Real > > > lhist_
Ptr< Vector< Real > > rhs_
const Ptr< Vector< Real > > u0_
void setTerminalConditionHess(Vector< Real > &p, const Vector< Real > &v, const Vector< Real > &l, const Vector< Real > &wold, const Vector< Real > &wnew, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
std::vector< Ptr< Vector< Real > > > phist_
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
void computeAdjointRHS(Vector< Real > &rhs, const Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
ROL::Ptr< const Vector< Real > > get(size_type i) const
void computeOldMixedHessLag(Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts, const bool sumInto=false)
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
const PartitionedVector< Real > & partition(const Vector< Real > &x) const
void addMixedHessLag(Vector< Real > &Hv, const Vector< Real > &l, const Vector< Real > &wold, const Vector< Real > &wnew, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
void updateGradient(Vector< Real > &g, const Vector< Real > &l, const Vector< Real > &uold, const Vector< Real > &unew, const Vector< Real > &z, const TimeStamp< Real > &ts)
Ptr< Sketch< Real > > stateSketch_