44 #ifndef ROL_OBJECTIVE_SIMOPT_H 45 #define ROL_OBJECTIVE_SIMOPT_H 91 Real ftol = std::sqrt(ROL_EPSILON<Real>());
94 Real v = this->
value(u,z,ftol);
96 ROL::Ptr<Vector<Real> > unew = u.
clone();
101 unew->axpy(h,*(u.
basis(i)));
103 deriv = (this->
value(*unew,z,ftol) - v)/h;
111 Real ftol = std::sqrt(ROL_EPSILON<Real>());
114 Real v = this->
value(u,z,ftol);
116 ROL::Ptr<Vector<Real> > znew = z.
clone();
118 for (
int i = 0; i < g.
dimension(); i++) {
121 znew->axpy(h,*(z.
basis(i)));
123 deriv = (this->
value(u,*znew,ftol) - v)/h;
134 ROL::Ptr<Vector<Real> > g1 = gs.
get_1()->clone();
135 ROL::Ptr<Vector<Real> > g2 = gs.
get_2()->clone();
147 Real gtol = std::sqrt(ROL_EPSILON<Real>());
150 if (v.
norm() > std::sqrt(ROL_EPSILON<Real>())) {
151 h = std::max(1.0,u.
norm()/v.
norm())*tol;
154 ROL::Ptr<Vector<Real> > unew = u.
clone();
161 ROL::Ptr<Vector<Real> > g = hv.
clone();
171 Real gtol = std::sqrt(ROL_EPSILON<Real>());
174 if (v.
norm() > std::sqrt(ROL_EPSILON<Real>())) {
175 h = std::max(1.0,u.
norm()/v.
norm())*tol;
178 ROL::Ptr<Vector<Real> > znew = z.
clone();
185 ROL::Ptr<Vector<Real> > g = hv.
clone();
195 Real gtol = std::sqrt(ROL_EPSILON<Real>());
198 if (v.
norm() > std::sqrt(ROL_EPSILON<Real>())) {
199 h = std::max(1.0,u.
norm()/v.
norm())*tol;
202 ROL::Ptr<Vector<Real> > unew = u.
clone();
209 ROL::Ptr<Vector<Real> > g = hv.
clone();
219 Real gtol = std::sqrt(ROL_EPSILON<Real>());
222 if (v.
norm() > std::sqrt(ROL_EPSILON<Real>())) {
223 h = std::max(1.0,u.
norm()/v.
norm())*tol;
226 ROL::Ptr<Vector<Real> > znew = z.
clone();
233 ROL::Ptr<Vector<Real> > g = hv.
clone();
248 ROL::Ptr<Vector<Real> > h11 = (hvs.
get_1())->clone();
250 ROL::Ptr<Vector<Real> > h12 = (hvs.
get_1())->clone();
252 ROL::Ptr<Vector<Real> > h21 = (hvs.
get_2())->clone();
254 ROL::Ptr<Vector<Real> > h22 = (hvs.
get_2())->clone();
265 const bool printToStream =
true,
266 std::ostream & outStream = std::cout,
268 const int order = 1 ) {
276 const bool printToStream,
277 std::ostream & outStream,
280 std::vector<Real> steps(numSteps);
281 for(
int i=0;i<numSteps;++i) {
282 steps[i] = pow(10,-i);
292 const std::vector<Real> &steps,
293 const bool printToStream,
294 std::ostream & outStream,
296 ROL_TEST_FOR_EXCEPTION( order<1 || order>4, std::invalid_argument,
297 "Error: finite difference order must be 1,2,3, or 4" );
302 Real tol = std::sqrt(ROL_EPSILON<Real>());
304 int numSteps = steps.size();
306 std::vector<Real> tmp(numVals);
307 std::vector<std::vector<Real> > gCheck(numSteps, tmp);
311 oldFormatState.copyfmt(outStream);
315 Real val = this->
value(u,z,tol);
318 ROL::Ptr<Vector<Real> > gtmp = g.
clone();
320 Real dtg = d.
dot(gtmp->dual());
323 ROL::Ptr<Vector<Real> > unew = u.
clone();
325 for (
int i=0; i<numSteps; i++) {
335 gCheck[i][2] =
weights[order-1][0] * val;
337 for(
int j=0; j<order; ++j) {
339 unew->axpy(eta*
shifts[order-1][j], d);
342 if(
weights[order-1][j+1] != 0 ) {
344 gCheck[i][2] +=
weights[order-1][j+1] * this->
value(*unew,z,tol);
349 gCheck[i][3] = std::abs(gCheck[i][2] - gCheck[i][1]);
353 outStream << std::right
354 << std::setw(20) <<
"Step size" 355 << std::setw(20) <<
"grad'*dir" 356 << std::setw(20) <<
"FD approx" 357 << std::setw(20) <<
"abs error" 359 << std::setw(20) <<
"---------" 360 << std::setw(20) <<
"---------" 361 << std::setw(20) <<
"---------" 362 << std::setw(20) <<
"---------" 365 outStream << std::scientific << std::setprecision(11) << std::right
366 << std::setw(20) << gCheck[i][0]
367 << std::setw(20) << gCheck[i][1]
368 << std::setw(20) << gCheck[i][2]
369 << std::setw(20) << gCheck[i][3]
376 outStream.copyfmt(oldFormatState);
385 const bool printToStream =
true,
386 std::ostream & outStream = std::cout,
388 const int order = 1 ) {
396 const bool printToStream,
397 std::ostream & outStream,
400 std::vector<Real> steps(numSteps);
401 for(
int i=0;i<numSteps;++i) {
402 steps[i] = pow(10,-i);
412 const std::vector<Real> &steps,
413 const bool printToStream,
414 std::ostream & outStream,
416 ROL_TEST_FOR_EXCEPTION( order<1 || order>4, std::invalid_argument,
417 "Error: finite difference order must be 1,2,3, or 4" );
422 Real tol = std::sqrt(ROL_EPSILON<Real>());
424 int numSteps = steps.size();
426 std::vector<Real> tmp(numVals);
427 std::vector<std::vector<Real> > gCheck(numSteps, tmp);
431 oldFormatState.copyfmt(outStream);
435 Real val = this->
value(u,z,tol);
438 ROL::Ptr<Vector<Real> > gtmp = g.
clone();
440 Real dtg = d.
dot(gtmp->dual());
443 ROL::Ptr<Vector<Real> > znew = z.
clone();
445 for (
int i=0; i<numSteps; i++) {
455 gCheck[i][2] =
weights[order-1][0] * val;
457 for(
int j=0; j<order; ++j) {
459 znew->axpy(eta*
shifts[order-1][j], d);
462 if(
weights[order-1][j+1] != 0 ) {
464 gCheck[i][2] +=
weights[order-1][j+1] * this->
value(u,*znew,tol);
469 gCheck[i][3] = std::abs(gCheck[i][2] - gCheck[i][1]);
473 outStream << std::right
474 << std::setw(20) <<
"Step size" 475 << std::setw(20) <<
"grad'*dir" 476 << std::setw(20) <<
"FD approx" 477 << std::setw(20) <<
"abs error" 479 << std::setw(20) <<
"---------" 480 << std::setw(20) <<
"---------" 481 << std::setw(20) <<
"---------" 482 << std::setw(20) <<
"---------" 485 outStream << std::scientific << std::setprecision(11) << std::right
486 << std::setw(20) << gCheck[i][0]
487 << std::setw(20) << gCheck[i][1]
488 << std::setw(20) << gCheck[i][2]
489 << std::setw(20) << gCheck[i][3]
496 outStream.copyfmt(oldFormatState);
505 const bool printToStream =
true,
506 std::ostream & outStream = std::cout,
508 const int order = 1 ) {
517 const std::vector<Real> &steps,
518 const bool printToStream =
true,
519 std::ostream & outStream = std::cout,
520 const int order = 1 ) {
530 const bool printToStream,
531 std::ostream & outStream,
534 std::vector<Real> steps(numSteps);
535 for(
int i=0;i<numSteps;++i) {
536 steps[i] = pow(10,-i);
547 const std::vector<Real> &steps,
548 const bool printToStream,
549 std::ostream & outStream,
552 ROL_TEST_FOR_EXCEPTION( order<1 || order>4, std::invalid_argument,
553 "Error: finite difference order must be 1,2,3, or 4" );
559 Real tol = std::sqrt(ROL_EPSILON<Real>());
561 int numSteps = steps.size();
563 std::vector<Real> tmp(numVals);
564 std::vector<std::vector<Real> > hvCheck(numSteps, tmp);
568 oldFormatState.copyfmt(outStream);
571 ROL::Ptr<Vector<Real> > g = hv.
clone();
576 ROL::Ptr<Vector<Real> > Hv = hv.
clone();
578 Real normHv = Hv->norm();
581 ROL::Ptr<Vector<Real> > gdif = hv.
clone();
582 ROL::Ptr<Vector<Real> > gnew = hv.
clone();
583 ROL::Ptr<Vector<Real> > unew = u.
clone();
585 for (
int i=0; i<numSteps; i++) {
593 gdif->scale(
weights[order-1][0]);
595 for(
int j=0; j<order; ++j) {
598 unew->axpy(eta*
shifts[order-1][j], v);
601 if(
weights[order-1][j+1] != 0 ) {
604 gdif->axpy(
weights[order-1][j+1],*gnew);
609 gdif->scale(1.0/eta);
613 hvCheck[i][1] = normHv;
614 hvCheck[i][2] = gdif->norm();
615 gdif->axpy(-1.0, *Hv);
616 hvCheck[i][3] = gdif->norm();
620 outStream << std::right
621 << std::setw(20) <<
"Step size" 622 << std::setw(20) <<
"norm(Hess*vec)" 623 << std::setw(20) <<
"norm(FD approx)" 624 << std::setw(20) <<
"norm(abs error)" 626 << std::setw(20) <<
"---------" 627 << std::setw(20) <<
"--------------" 628 << std::setw(20) <<
"---------------" 629 << std::setw(20) <<
"---------------" 632 outStream << std::scientific << std::setprecision(11) << std::right
633 << std::setw(20) << hvCheck[i][0]
634 << std::setw(20) << hvCheck[i][1]
635 << std::setw(20) << hvCheck[i][2]
636 << std::setw(20) << hvCheck[i][3]
643 outStream.copyfmt(oldFormatState);
652 const bool printToStream =
true,
653 std::ostream & outStream = std::cout,
655 const int order = 1 ) {
662 const std::vector<Real> &steps,
663 const bool printToStream =
true,
664 std::ostream & outStream = std::cout,
665 const int order = 1 ) {
674 const bool printToStream,
675 std::ostream & outStream,
678 std::vector<Real> steps(numSteps);
679 for(
int i=0;i<numSteps;++i) {
680 steps[i] = pow(10,-i);
691 const std::vector<Real> &steps,
692 const bool printToStream,
693 std::ostream & outStream,
696 ROL_TEST_FOR_EXCEPTION( order<1 || order>4, std::invalid_argument,
697 "Error: finite difference order must be 1,2,3, or 4" );
703 Real tol = std::sqrt(ROL_EPSILON<Real>());
705 int numSteps = steps.size();
707 std::vector<Real> tmp(numVals);
708 std::vector<std::vector<Real> > hvCheck(numSteps, tmp);
712 oldFormatState.copyfmt(outStream);
715 ROL::Ptr<Vector<Real> > g = hv.
clone();
720 ROL::Ptr<Vector<Real> > Hv = hv.
clone();
722 Real normHv = Hv->norm();
725 ROL::Ptr<Vector<Real> > gdif = hv.
clone();
726 ROL::Ptr<Vector<Real> > gnew = hv.
clone();
727 ROL::Ptr<Vector<Real> > znew = z.
clone();
729 for (
int i=0; i<numSteps; i++) {
737 gdif->scale(
weights[order-1][0]);
739 for(
int j=0; j<order; ++j) {
742 znew->axpy(eta*
shifts[order-1][j], v);
745 if(
weights[order-1][j+1] != 0 ) {
748 gdif->axpy(
weights[order-1][j+1],*gnew);
753 gdif->scale(1.0/eta);
757 hvCheck[i][1] = normHv;
758 hvCheck[i][2] = gdif->norm();
759 gdif->axpy(-1.0, *Hv);
760 hvCheck[i][3] = gdif->norm();
764 outStream << std::right
765 << std::setw(20) <<
"Step size" 766 << std::setw(20) <<
"norm(Hess*vec)" 767 << std::setw(20) <<
"norm(FD approx)" 768 << std::setw(20) <<
"norm(abs error)" 770 << std::setw(20) <<
"---------" 771 << std::setw(20) <<
"--------------" 772 << std::setw(20) <<
"---------------" 773 << std::setw(20) <<
"---------------" 776 outStream << std::scientific << std::setprecision(11) << std::right
777 << std::setw(20) << hvCheck[i][0]
778 << std::setw(20) << hvCheck[i][1]
779 << std::setw(20) << hvCheck[i][2]
780 << std::setw(20) << hvCheck[i][3]
787 outStream.copyfmt(oldFormatState);
796 const bool printToStream =
true,
797 std::ostream & outStream = std::cout,
799 const int order = 1 ) {
808 const std::vector<Real> &steps,
809 const bool printToStream =
true,
810 std::ostream & outStream = std::cout,
811 const int order = 1 ) {
821 const bool printToStream,
822 std::ostream & outStream,
825 std::vector<Real> steps(numSteps);
826 for(
int i=0;i<numSteps;++i) {
827 steps[i] = pow(10,-i);
838 const std::vector<Real> &steps,
839 const bool printToStream,
840 std::ostream & outStream,
843 ROL_TEST_FOR_EXCEPTION( order<1 || order>4, std::invalid_argument,
844 "Error: finite difference order must be 1,2,3, or 4" );
850 Real tol = std::sqrt(ROL_EPSILON<Real>());
852 int numSteps = steps.size();
854 std::vector<Real> tmp(numVals);
855 std::vector<std::vector<Real> > hvCheck(numSteps, tmp);
859 oldFormatState.copyfmt(outStream);
862 ROL::Ptr<Vector<Real> > g = hv.
clone();
867 ROL::Ptr<Vector<Real> > Hv = hv.
clone();
869 Real normHv = Hv->norm();
872 ROL::Ptr<Vector<Real> > gdif = hv.
clone();
873 ROL::Ptr<Vector<Real> > gnew = hv.
clone();
874 ROL::Ptr<Vector<Real> > unew = u.
clone();
876 for (
int i=0; i<numSteps; i++) {
884 gdif->scale(
weights[order-1][0]);
886 for(
int j=0; j<order; ++j) {
889 unew->axpy(eta*
shifts[order-1][j], v);
892 if(
weights[order-1][j+1] != 0 ) {
895 gdif->axpy(
weights[order-1][j+1],*gnew);
900 gdif->scale(1.0/eta);
904 hvCheck[i][1] = normHv;
905 hvCheck[i][2] = gdif->norm();
906 gdif->axpy(-1.0, *Hv);
907 hvCheck[i][3] = gdif->norm();
911 outStream << std::right
912 << std::setw(20) <<
"Step size" 913 << std::setw(20) <<
"norm(Hess*vec)" 914 << std::setw(20) <<
"norm(FD approx)" 915 << std::setw(20) <<
"norm(abs error)" 917 << std::setw(20) <<
"---------" 918 << std::setw(20) <<
"--------------" 919 << std::setw(20) <<
"---------------" 920 << std::setw(20) <<
"---------------" 923 outStream << std::scientific << std::setprecision(11) << std::right
924 << std::setw(20) << hvCheck[i][0]
925 << std::setw(20) << hvCheck[i][1]
926 << std::setw(20) << hvCheck[i][2]
927 << std::setw(20) << hvCheck[i][3]
934 outStream.copyfmt(oldFormatState);
943 const bool printToStream =
true,
944 std::ostream & outStream = std::cout,
946 const int order = 1 ) {
955 const std::vector<Real> &steps,
956 const bool printToStream =
true,
957 std::ostream & outStream = std::cout,
958 const int order = 1 ) {
968 const bool printToStream,
969 std::ostream & outStream,
972 std::vector<Real> steps(numSteps);
973 for(
int i=0;i<numSteps;++i) {
974 steps[i] = pow(10,-i);
985 const std::vector<Real> &steps,
986 const bool printToStream,
987 std::ostream & outStream,
990 ROL_TEST_FOR_EXCEPTION( order<1 || order>4, std::invalid_argument,
991 "Error: finite difference order must be 1,2,3, or 4" );
997 Real tol = std::sqrt(ROL_EPSILON<Real>());
999 int numSteps = steps.size();
1001 std::vector<Real> tmp(numVals);
1002 std::vector<std::vector<Real> > hvCheck(numSteps, tmp);
1006 oldFormatState.copyfmt(outStream);
1009 ROL::Ptr<Vector<Real> > g = hv.
clone();
1014 ROL::Ptr<Vector<Real> > Hv = hv.
clone();
1016 Real normHv = Hv->norm();
1019 ROL::Ptr<Vector<Real> > gdif = hv.
clone();
1020 ROL::Ptr<Vector<Real> > gnew = hv.
clone();
1021 ROL::Ptr<Vector<Real> > znew = z.
clone();
1023 for (
int i=0; i<numSteps; i++) {
1025 Real eta = steps[i];
1031 gdif->scale(
weights[order-1][0]);
1033 for(
int j=0; j<order; ++j) {
1036 znew->axpy(eta*
shifts[order-1][j], v);
1039 if(
weights[order-1][j+1] != 0 ) {
1042 gdif->axpy(
weights[order-1][j+1],*gnew);
1047 gdif->scale(1.0/eta);
1050 hvCheck[i][0] = eta;
1051 hvCheck[i][1] = normHv;
1052 hvCheck[i][2] = gdif->norm();
1053 gdif->axpy(-1.0, *Hv);
1054 hvCheck[i][3] = gdif->norm();
1056 if (printToStream) {
1058 outStream << std::right
1059 << std::setw(20) <<
"Step size" 1060 << std::setw(20) <<
"norm(Hess*vec)" 1061 << std::setw(20) <<
"norm(FD approx)" 1062 << std::setw(20) <<
"norm(abs error)" 1064 << std::setw(20) <<
"---------" 1065 << std::setw(20) <<
"--------------" 1066 << std::setw(20) <<
"---------------" 1067 << std::setw(20) <<
"---------------" 1070 outStream << std::scientific << std::setprecision(11) << std::right
1071 << std::setw(20) << hvCheck[i][0]
1072 << std::setw(20) << hvCheck[i][1]
1073 << std::setw(20) << hvCheck[i][2]
1074 << std::setw(20) << hvCheck[i][3]
1081 outStream.copyfmt(oldFormatState);
Provides the interface to evaluate objective functions.
Provides the interface to evaluate simulation-based objective functions.
std::vector< std::vector< Real > > checkGradient_2(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
virtual void scale(const Real alpha)=0
Compute where .
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
std::vector< std::vector< Real > > checkGradient_1(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
const double weights[4][5]
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
basic_nullstream< char, char_traits< char > > nullstream
Defines the linear algebra or vector space interface for simulation-based optimization.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
std::vector< std::vector< Real > > checkHessVec_21(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
std::vector< std::vector< Real > > checkHessVec_12(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
virtual void hessVec_12(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
void set_1(const Vector< Real > &vec)
std::vector< std::vector< Real > > checkGradient_2(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &d, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
virtual void gradient_2(Vector< Real > &g, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Compute gradient with respect to second component.
std::vector< std::vector< Real > > checkHessVec_21(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
virtual ROL::Ptr< Vector > basis(const int i) const
Return i-th basis vector.
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
std::vector< std::vector< Real > > checkHessVec_22(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
std::vector< std::vector< Real > > checkHessVec_12(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
ROL::Ptr< const Vector< Real > > get_2() const
virtual Real dot(const Vector &x) const =0
Compute where .
std::vector< std::vector< Real > > checkHessVec_12(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
std::vector< std::vector< Real > > checkHessVec_11(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
virtual void hessVec_21(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
ROL::Ptr< const Vector< Real > > get_1() const
virtual Real value(const Vector< Real > &u, const Vector< Real > &z, Real &tol)=0
Compute value.
std::vector< std::vector< Real > > checkHessVec_11(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
std::vector< std::vector< Real > > checkHessVec_12(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const bool printToStream=true, std::ostream &outStream=std::cout, const int numSteps=ROL_NUM_CHECKDERIV_STEPS, const int order=1)
std::vector< std::vector< Real > > checkHessVec_22(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
std::vector< std::vector< Real > > checkHessVec_22(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream=true, std::ostream &outStream=std::cout, const int order=1)
virtual int dimension() const
Return dimension of the vector space.
std::vector< std::vector< Real > > checkHessVec_11(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
virtual void gradient_1(Vector< Real > &g, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Compute gradient with respect to first component.
virtual void hessVec_22(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
#define ROL_NUM_CHECKDERIV_STEPS
Number of steps for derivative checks.
std::vector< std::vector< Real > > checkGradient_1(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
virtual void update(const Vector< Real > &u, const Vector< Real > &z, bool flag=true, int iter=-1)
Update objective function. u is an iterate, z is an iterate, flag = true if the iterate has changed...
std::vector< std::vector< Real > > checkHessVec_21(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
virtual Real norm() const =0
Returns where .
Real value(const Vector< Real > &x, Real &tol)
Compute value.
std::vector< std::vector< Real > > checkHessVec_22(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const std::vector< Real > &steps, const bool printToStream, std::ostream &outStream, const int order)
std::vector< std::vector< Real > > checkGradient_2(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
virtual void hessVec_11(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &u, const Vector< Real > &z, Real &tol)
Apply Hessian approximation to vector.
std::vector< std::vector< Real > > checkHessVec_21(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
std::vector< std::vector< Real > > checkGradient_1(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &g, const Vector< Real > &d, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
std::vector< std::vector< Real > > checkHessVec_11(const Vector< Real > &u, const Vector< Real > &z, const Vector< Real > &hv, const Vector< Real > &v, const bool printToStream, std::ostream &outStream, const int numSteps, const int order)
void set_2(const Vector< Real > &vec)