54 #include "Teuchos_oblackholestream.hpp"
55 #include "Teuchos_GlobalMPISession.hpp"
56 #include "Teuchos_XMLParameterListHelpers.hpp"
57 #include "Teuchos_LAPACK.hpp"
80 return std::sqrt(this->
dot(r,r));
83 Real
dot(
const std::vector<Real> &x,
const std::vector<Real> &y) {
85 Real c = (((int)x.size()==this->
nx_) ? 4.0 : 2.0);
86 for (
unsigned i=0; i<x.size(); i++) {
88 ip += this->
dx_/6.0*(c*x[i] + x[i+1])*y[i];
90 else if ( i == x.size()-1 ) {
91 ip += this->
dx_/6.0*(x[i-1] + c*x[i])*y[i];
94 ip += this->
dx_/6.0*(x[i-1] + 4.0*x[i] + x[i+1])*y[i];
100 void update(std::vector<Real> &u,
const std::vector<Real> &s,
const Real alpha=1.0) {
101 for (
unsigned i=0; i<u.size(); i++) {
106 void scale(std::vector<Real> &u,
const Real alpha=0.0) {
107 for (
unsigned i=0; i<u.size(); i++) {
113 const std::vector<Real> &z) {
115 r.resize(this->
nx_,0.0);
116 for (
int i=0; i<this->
nx_; i++) {
119 r[i] = this->
nu_/this->
dx_*(2.0*u[i]-u[i+1]);
121 else if (i==this->nx_-1) {
122 r[i] = this->
nu_/this->
dx_*(2.0*u[i]-u[i-1]);
125 r[i] = this->
nu_/this->
dx_*(2.0*u[i]-u[i-1]-u[i+1]);
129 r[i] += u[i+1]*(u[i]+u[i+1])/6.0;
132 r[i] -= u[i-1]*(u[i-1]+u[i])/6.0;
135 r[i] -= this->
dx_/6.0*(z[i]+4.0*z[i+1]+z[i+2]);
137 r[i] -= this->
dx_*this->
f_;
140 r[0] -= this->
u0_*u[ 0]/6.0 + this->
u0_*this->
u0_/6.0 + this->
nu_*this->
u0_/this->
dx_;
141 r[this->nx_-1] += this->
u1_*u[this->nx_-1]/6.0 + this->
u1_*this->
u1_/6.0 - this->
nu_*this->
u1_/this->
dx_;
145 const std::vector<Real> &u) {
148 d.resize(this->
nx_,this->
nu_*2.0/this->
dx_);
150 dl.resize(this->
nx_-1,-this->
nu_/this->
dx_);
152 du.resize(this->
nx_-1,-this->
nu_/this->
dx_);
154 for (
int i=0; i<this->
nx_; i++) {
156 dl[i] += (-2.0*u[i]-u[i+1])/6.0;
161 du[i-1] += (u[i-1]+2.0*u[i])/6.0;
165 d[0] -= this->
u0_/6.0;
166 d[this->nx_-1] += this->
u1_/6.0;
169 void linear_solve(std::vector<Real> &u, std::vector<Real> &dl, std::vector<Real> &d, std::vector<Real> &du,
170 const std::vector<Real> &r,
const bool transpose =
false) {
171 u.assign(r.begin(),r.end());
173 Teuchos::LAPACK<int,Real> lp;
174 std::vector<Real> du2(this->
nx_-2,0.0);
175 std::vector<int> ipiv(this->
nx_,0);
179 lp.GTTRF(this->
nx_,&dl[0],&d[0],&du[0],&du2[0],&ipiv[0],&info);
184 lp.GTTRS(trans,this->
nx_,nhrs,&dl[0],&d[0],&du[0],&du2[0],&ipiv[0],&u[0],ldb,&info);
191 dx_ = 1.0/((Real)nx+1.0);
196 Teuchos::RCP<std::vector<Real> > cp =
197 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
ROL::StdVector<Real> >(c)).getVector());
198 Teuchos::RCP<const std::vector<Real> > up =
200 Teuchos::RCP<const std::vector<Real> > zp =
206 Teuchos::RCP<std::vector<Real> > up =
207 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
ROL::StdVector<Real> >(u)).getVector());
208 up->assign(up->size(),z.
norm()/up->size());
209 Teuchos::RCP<const std::vector<Real> > zp =
212 std::vector<Real> r(up->size(),0.0);
219 std::vector<Real> d(this->
nx_,0.0);
220 std::vector<Real> dl(this->
nx_-1,0.0);
221 std::vector<Real> du(this->
nx_-1,0.0);
223 Real alpha = 1.0, tmp = 0.0;
224 std::vector<Real> s(this->
nx_,0.0);
225 std::vector<Real> utmp(this->
nx_,0.0);
226 for (
int i=0; i<maxit; i++) {
235 utmp.assign(up->begin(),up->end());
236 this->
update(utmp,s,-alpha);
239 while ( rnorm > (1.0-1.e-4*alpha)*tmp && alpha > std::sqrt(
ROL::ROL_EPSILON) ) {
241 utmp.assign(up->begin(),up->end());
242 this->
update(utmp,s,-alpha);
247 up->assign(utmp.begin(),utmp.end());
248 if ( rnorm < rtol ) {
258 Teuchos::RCP<std::vector<Real> > jvp =
259 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
ROL::StdVector<Real> >(jv)).getVector());
260 Teuchos::RCP<const std::vector<Real> > vp =
262 Teuchos::RCP<const std::vector<Real> > up =
264 Teuchos::RCP<const std::vector<Real> > zp =
267 for (
int i = 0; i < this->
nx_; i++) {
268 (*jvp)[i] = this->
nu_/this->
dx_*2.0*(*vp)[i];
270 (*jvp)[i] += -this->
nu_/this->
dx_*(*vp)[i-1]
271 -(*up)[i-1]/6.0*(*vp)[i]
272 -((*up)[i]+2.0*(*up)[i-1])/6.0*(*vp)[i-1];
274 if ( i < this->nx_-1 ) {
275 (*jvp)[i] += -this->
nu_/this->
dx_*(*vp)[i+1]
276 +(*up)[i+1]/6.0*(*vp)[i]
277 +((*up)[i]+2.0*(*up)[i+1])/6.0*(*vp)[i+1];
280 (*jvp)[0] -= this->
u0_/6.0*(*vp)[0];
281 (*jvp)[this->nx_-1] += this->
u1_/6.0*(*vp)[this->nx_-1];
286 Teuchos::RCP<std::vector<Real> > jvp =
287 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
ROL::StdVector<Real> >(jv)).getVector());
288 Teuchos::RCP<const std::vector<Real> > vp =
290 Teuchos::RCP<const std::vector<Real> > up =
292 Teuchos::RCP<const std::vector<Real> > zp =
294 for (
int i=0; i<this->
nx_; i++) {
296 (*jvp)[i] = -this->
dx_/6.0*((*vp)[i]+4.0*(*vp)[i+1]+(*vp)[i+2]);
302 Teuchos::RCP<std::vector<Real> > ijvp =
303 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
ROL::StdVector<Real> >(ijv)).getVector());
304 Teuchos::RCP<const std::vector<Real> > vp =
306 Teuchos::RCP<const std::vector<Real> > up =
308 Teuchos::RCP<const std::vector<Real> > zp =
311 std::vector<Real> d(this->
nx_,0.0);
312 std::vector<Real> dl(this->
nx_-1,0.0);
313 std::vector<Real> du(this->
nx_-1,0.0);
321 Teuchos::RCP<std::vector<Real> > jvp =
322 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
ROL::StdVector<Real> >(ajv)).getVector());
323 Teuchos::RCP<const std::vector<Real> > vp =
325 Teuchos::RCP<const std::vector<Real> > up =
327 Teuchos::RCP<const std::vector<Real> > zp =
330 for (
int i = 0; i < this->
nx_; i++) {
331 (*jvp)[i] = this->
nu_/this->
dx_*2.0*(*vp)[i];
333 (*jvp)[i] += -this->
nu_/this->
dx_*(*vp)[i-1]
334 -(*up)[i-1]/6.0*(*vp)[i]
335 +((*up)[i-1]+2.0*(*up)[i])/6.0*(*vp)[i-1];
337 if ( i < this->nx_-1 ) {
338 (*jvp)[i] += -this->
nu_/this->
dx_*(*vp)[i+1]
339 +(*up)[i+1]/6.0*(*vp)[i]
340 -((*up)[i+1]+2.0*(*up)[i])/6.0*(*vp)[i+1];
343 (*jvp)[0] -= this->
u0_/6.0*(*vp)[0];
344 (*jvp)[this->nx_-1] += this->
u1_/6.0*(*vp)[this->nx_-1];
349 Teuchos::RCP<std::vector<Real> > jvp =
350 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
ROL::StdVector<Real> >(jv)).getVector());
351 Teuchos::RCP<const std::vector<Real> > vp =
353 Teuchos::RCP<const std::vector<Real> > up =
355 Teuchos::RCP<const std::vector<Real> > zp =
357 for (
int i=0; i<this->
nx_+2; i++) {
359 (*jvp)[i] = -this->
dx_/6.0*(*vp)[i];
362 (*jvp)[i] = -this->
dx_/6.0*(4.0*(*vp)[i-1]+(*vp)[i]);
364 else if ( i == this->nx_ ) {
365 (*jvp)[i] = -this->
dx_/6.0*(4.0*(*vp)[i-1]+(*vp)[i-2]);
367 else if ( i == this->nx_+1 ) {
368 (*jvp)[i] = -this->
dx_/6.0*(*vp)[i-2];
371 (*jvp)[i] = -this->
dx_/6.0*((*vp)[i-2]+4.0*(*vp)[i-1]+(*vp)[i]);
378 Teuchos::RCP<std::vector<Real> > iajvp =
379 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
ROL::StdVector<Real> >(iajv)).getVector());
380 Teuchos::RCP<const std::vector<Real> > vp =
382 Teuchos::RCP<const std::vector<Real> > up =
385 std::vector<Real> d(this->
nx_,0.0);
386 std::vector<Real> du(this->
nx_-1,0.0);
387 std::vector<Real> dl(this->
nx_-1,0.0);
395 Teuchos::RCP<std::vector<Real> > ahwvp =
396 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
ROL::StdVector<Real> >(ahwv)).getVector());
397 Teuchos::RCP<const std::vector<Real> > wp =
399 Teuchos::RCP<const std::vector<Real> > vp =
401 Teuchos::RCP<const std::vector<Real> > up =
403 Teuchos::RCP<const std::vector<Real> > zp =
405 for (
int i=0; i<this->
nx_; i++) {
409 (*ahwvp)[i] += ((*wp)[i]*(*vp)[i+1] - (*wp)[i+1]*(2.0*(*vp)[i]+(*vp)[i+1]))/6.0;
412 (*ahwvp)[i] += ((*wp)[i-1]*((*vp)[i-1]+2.0*(*vp)[i]) - (*wp)[i]*(*vp)[i-1])/6.0;
449 case 1: val = ((x<0.5) ? 1.0 : 0.0);
break;
450 case 2: val = 1.0;
break;
451 case 3: val = std::abs(std::sin(8.0*M_PI*x));
break;
452 case 4: val = std::exp(-0.5*(x-0.5)*(x-0.5));
break;
457 Real
dot(
const std::vector<Real> &x,
const std::vector<Real> &y) {
459 Real c = (((int)x.size()==this->
nx_) ? 4.0 : 2.0);
460 for (
unsigned i=0; i<x.size(); i++) {
462 ip += this->
dx_/6.0*(c*x[i] + x[i+1])*y[i];
464 else if ( i == x.size()-1 ) {
465 ip += this->
dx_/6.0*(x[i-1] + c*x[i])*y[i];
468 ip += this->
dx_/6.0*(x[i-1] + 4.0*x[i] + x[i+1])*y[i];
474 void apply_mass(std::vector<Real> &Mu,
const std::vector<Real> &u ) {
475 Mu.resize(u.size(),0.0);
476 Real c = (((int)u.size()==this->
nx_) ? 4.0 : 2.0);
477 for (
unsigned i=0; i<u.size(); i++) {
479 Mu[i] = this->
dx_/6.0*(c*u[i] + u[i+1]);
481 else if ( i == u.size()-1 ) {
482 Mu[i] = this->
dx_/6.0*(u[i-1] + c*u[i]);
485 Mu[i] = this->
dx_/6.0*(u[i-1] + 4.0*u[i] + u[i+1]);
496 dx_ = 1.0/((Real)nx+1.0);
500 Teuchos::RCP<const std::vector<Real> > up =
502 Teuchos::RCP<const std::vector<Real> > zp =
505 Real res1 = 0.0, res2 = 0.0, res3 = 0.0;
506 Real valu = 0.0, valz = this->
dot(*zp,*zp);
507 for (
int i=0; i<this->
nx_; i++) {
511 valu += this->
dx_/6.0*(4.0*res1 + res2)*res1;
513 else if ( i == this->nx_-1 ) {
516 valu += this->dx_/6.0*(res1 + 4.0*res2)*res2;
522 valu += this->dx_/6.0*(res1 + 4.0*res2 + res3)*res2;
525 return 0.5*(valu + this->
alpha_*valz);
530 Teuchos::RCP<std::vector<Real> > gup = Teuchos::rcp_const_cast<std::vector<Real> >(
533 Teuchos::RCP<const std::vector<Real> > up =
535 Teuchos::RCP<const std::vector<Real> > zp =
538 std::vector<Real> diff(this->
nx_,0.0);
539 for (
int i=0; i<this->
nx_; i++) {
547 Teuchos::RCP<std::vector<Real> > gzp = Teuchos::rcp_const_cast<std::vector<Real> >(
550 Teuchos::RCP<const std::vector<Real> > up =
552 Teuchos::RCP<const std::vector<Real> > zp =
555 for (
int i=0; i<this->
nx_+2; i++) {
557 (*gzp)[i] = this->
alpha_*this->
dx_/6.0*(2.0*(*zp)[i]+(*zp)[i+1]);
559 else if (i==this->nx_+1) {
560 (*gzp)[i] = this->
alpha_*this->
dx_/6.0*(2.0*(*zp)[i]+(*zp)[i-1]);
563 (*gzp)[i] = this->
alpha_*this->
dx_/6.0*((*zp)[i-1]+4.0*(*zp)[i]+(*zp)[i+1]);
570 Teuchos::RCP<std::vector<Real> > hvup = Teuchos::rcp_const_cast<std::vector<Real> >(
573 Teuchos::RCP<const std::vector<Real> > vup =
591 Teuchos::RCP<std::vector<Real> > hvzp = Teuchos::rcp_const_cast<std::vector<Real> >(
594 Teuchos::RCP<const std::vector<Real> > vzp =
597 for (
int i=0; i<this->
nx_+2; i++) {
599 (*hvzp)[i] = this->
alpha_*this->
dx_/6.0*(2.0*(*vzp)[i]+(*vzp)[i+1]);
601 else if (i==this->nx_+1) {
602 (*hvzp)[i] = this->
alpha_*this->
dx_/6.0*(2.0*(*vzp)[i]+(*vzp)[i-1]);
605 (*hvzp)[i] = this->
alpha_*this->
dx_/6.0*((*vzp)[i-1]+4.0*(*vzp)[i]+(*vzp)[i+1]);
613 int main(
int argc,
char *argv[]) {
615 Teuchos::GlobalMPISession mpiSession(&argc, &argv);
618 int iprint = argc - 1;
619 Teuchos::RCP<std::ostream> outStream;
620 Teuchos::oblackholestream bhs;
622 outStream = Teuchos::rcp(&std::cout,
false);
624 outStream = Teuchos::rcp(&bhs,
false);
639 Teuchos::RCP<std::vector<RealT> > z_rcp = Teuchos::rcp(
new std::vector<RealT> (nx+2, 1.0) );
640 Teuchos::RCP<std::vector<RealT> > gz_rcp = Teuchos::rcp(
new std::vector<RealT> (nx+2, 1.0) );
641 Teuchos::RCP<std::vector<RealT> > yz_rcp = Teuchos::rcp(
new std::vector<RealT> (nx+2, 1.0) );
642 for (
int i=0; i<nx+2; i++) {
649 Teuchos::RCP<ROL::Vector<RealT> > zp = Teuchos::rcp(&z,
false);
650 Teuchos::RCP<ROL::Vector<RealT> > gzp = Teuchos::rcp(&z,
false);
651 Teuchos::RCP<ROL::Vector<RealT> > yzp = Teuchos::rcp(&yz,
false);
653 Teuchos::RCP<std::vector<RealT> > u_rcp = Teuchos::rcp(
new std::vector<RealT> (nx, 1.0) );
654 Teuchos::RCP<std::vector<RealT> > gu_rcp = Teuchos::rcp(
new std::vector<RealT> (nx, 1.0) );
655 Teuchos::RCP<std::vector<RealT> > yu_rcp = Teuchos::rcp(
new std::vector<RealT> (nx, 1.0) );
656 for (
int i=0; i<nx; i++) {
663 Teuchos::RCP<ROL::Vector<RealT> > up = Teuchos::rcp(&u,
false);
664 Teuchos::RCP<ROL::Vector<RealT> > gup = Teuchos::rcp(&u,
false);
665 Teuchos::RCP<ROL::Vector<RealT> > yup = Teuchos::rcp(&yu,
false);
667 Teuchos::RCP<std::vector<RealT> > c_rcp = Teuchos::rcp(
new std::vector<RealT> (nx, 1.0) );
668 Teuchos::RCP<std::vector<RealT> > l_rcp = Teuchos::rcp(
new std::vector<RealT> (nx, 1.0) );
684 std::string filename =
"input.xml";
685 Teuchos::RCP<Teuchos::ParameterList> parlist_tr = Teuchos::rcp(
new Teuchos::ParameterList() );
686 Teuchos::updateParametersFromXmlFile( filename, Teuchos::Ptr<Teuchos::ParameterList>(&*parlist_tr) );
700 con.
solve(u,z,zerotol);
706 std::vector<std::string> output = algo.
run(x, g, l, c, obj, con,
true, *outStream);
711 catch (std::logic_error err) {
712 *outStream << err.what() <<
"\n";
717 std::cout <<
"End Result: TEST FAILED\n";
719 std::cout <<
"End Result: TEST PASSED\n";
Provides the interface to evaluate simulation-based objective functions.
void compute_pde_jacobian(std::vector< Real > &dl, std::vector< Real > &d, std::vector< Real > &du, const std::vector< Real > &u)
void applyAdjointHessian_21(ROL::Vector< Real > &ahwv, const ROL::Vector< Real > &w, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Apply the adjoint of the partial constraint Hessian at , , to vector in direction ...
void scale(const Real alpha)
Compute where .
void linear_solve(std::vector< Real > &u, std::vector< Real > &dl, std::vector< Real > &d, std::vector< Real > &du, const std::vector< Real > &r, const bool transpose=false)
Real evaluate_target(Real x)
Defines the linear algebra or vector space interface for simulation-based optimization.
void applyAdjointHessian_22(ROL::Vector< Real > &ahwv, const ROL::Vector< Real > &w, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Apply the adjoint of the partial constraint Hessian at , , to vector in direction ...
void applyInverseJacobian_1(ROL::Vector< Real > &ijv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Apply the inverse partial constraint Jacobian at , , to the vector .
Real dot(const std::vector< Real > &x, const std::vector< Real > &y)
Contains definitions of custom data types in ROL.
virtual std::vector< std::vector< Real > > checkApplyAdjointJacobian(const Vector< Real > &x, const Vector< Real > &v, const Vector< Real > &c, const Vector< Real > &ajv, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS)
Finite-difference check for the application of the adjoint of constraint Jacobian.
EqualityConstraint_BurgersControl(int nx=128, Real nu=1.e-2, Real u0=1.0, Real u1=0.0, Real f=0.0)
Real compute_norm(const std::vector< Real > &r)
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
void compute_residual(std::vector< Real > &r, const std::vector< Real > &u, const std::vector< Real > &z)
void applyAdjointHessian_11(ROL::Vector< Real > &ahwv, const ROL::Vector< Real > &w, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Apply the adjoint of the partial constraint Hessian at , , to vector in direction ...
Defines the equality constraint operator interface for simulation-based optimization.
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.
void hessVec_22(ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Real value(const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Compute value.
virtual std::vector< std::vector< Real > > checkApplyJacobian(const Vector< Real > &x, const Vector< Real > &v, const Vector< Real > &jv, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
Finite-difference check for the constraint Jacobian application.
void gradient_1(ROL::Vector< Real > &g, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Compute gradient with respect to first component.
void applyInverseAdjointJacobian_1(ROL::Vector< Real > &iajv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Apply the inverse of the adjoint of the partial constraint Jacobian at , , to the vector ...
void applyAdjointJacobian_1(ROL::Vector< Real > &ajv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Apply the adjoint of the partial constraint Jacobian at , , to the vector . This is the primary inter...
void applyAdjointJacobian_2(ROL::Vector< Real > &jv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Apply the adjoint of the partial constraint Jacobian at , , to vector . This is the primary interface...
Provides the std::vector implementation of the ROL::Vector interface.
void applyJacobian_1(ROL::Vector< Real > &jv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Apply the partial constraint Jacobian at , , to the vector .
virtual std::vector< std::string > run(Vector< Real > &x, Objective< Real > &obj, bool print=false, std::ostream &outStream=std::cout)
Run algorithm on unconstrained problems (Type-U). This is the primary Type-U interface.
Real dot(const std::vector< Real > &x, const std::vector< Real > &y)
Implements the computation of optimization steps with composite-step trust-region SQP methods...
Objective_BurgersControl(Real alpha=1.e-4, int nx=128)
void hessVec_21(ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
int main(int argc, char *argv[])
void hessVec_12(ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
void gradient_2(ROL::Vector< Real > &g, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Compute gradient with respect to second component.
void solve(ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Given , solve for .
void scale(std::vector< Real > &u, const Real alpha=0.0)
void applyJacobian_2(ROL::Vector< Real > &jv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Apply the partial constraint Jacobian at , , to the vector .
void hessVec_11(ROL::Vector< Real > &hv, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Apply Hessian approximation to vector.
void value(ROL::Vector< Real > &c, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Evaluate the constraint operator at .
void apply_mass(std::vector< Real > &Mu, const std::vector< Real > &u)
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 Real norm() const =0
Returns where .
virtual std::vector< std::vector< Real > > checkApplyAdjointHessian(const Vector< Real > &x, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &hv, const std::vector< Real > &step, const bool printToScreen=true, std::ostream &outStream=std::cout, const int order=1)
Finite-difference check for the application of the adjoint of constraint Hessian. ...
void update(std::vector< Real > &u, const std::vector< Real > &s, const Real alpha=1.0)
void applyAdjointHessian_12(ROL::Vector< Real > &ahwv, const ROL::Vector< Real > &w, const ROL::Vector< Real > &v, const ROL::Vector< Real > &u, const ROL::Vector< Real > &z, Real &tol)
Apply the adjoint of the partial constraint Hessian at , , to vector in direction ...
static const double ROL_EPSILON
Platform-dependent machine epsilon.