72 Teuchos::RCP<const std::vector<Real> > ex =
74 return std::sin((*ex)[0] + (*ex)[1]) + std::pow((*ex)[0]-(*ex)[1],2.0) - 1.5*(*ex)[0] + 2.5*(*ex)[1] + 1.0;
78 Teuchos::RCP<const std::vector<Real> > ex =
80 Teuchos::RCP<std::vector<Real> > eg =
81 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(g)).getVector());
82 (*eg)[0] = std::cos((*ex)[0] + (*ex)[1]) + 2.0*((*ex)[0]-(*ex)[1]) - 1.5;
83 (*eg)[1] = std::cos((*ex)[0] + (*ex)[1]) - 2.0*((*ex)[0]-(*ex)[1]) + 2.5;;
87 Teuchos::RCP<const std::vector<Real> > ex =
89 Teuchos::RCP<const std::vector<Real> > ev =
91 Teuchos::RCP<std::vector<Real> > ehv =
92 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(hv)).getVector());
94 Real h11 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
95 Real h22 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
96 Real h12 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
97 Real h21 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
99 (*ehv)[0] = h11 * (*ev)[0] + h12 * (*ev)[1];
100 (*ehv)[1] = h21 * (*ev)[0] + h22 * (*ev)[1];
104 Teuchos::RCP<const std::vector<Real> > ex =
106 Teuchos::RCP<const std::vector<Real> > ev =
108 Teuchos::RCP<std::vector<Real> > ehv =
109 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(hv)).getVector());
111 Real h11 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
112 Real h22 = -std::sin((*ex)[0] + (*ex)[1]) + 2.0;
113 Real h12 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
114 Real h21 = -std::sin((*ex)[0] + (*ex)[1]) - 2.0;
116 (*ehv)[0] = 1.0/(h11*h22 - h12*h21) * (h22 * (*ev)[0] - h12 * (*ev)[1]);
117 (*ehv)[1] = 1.0/(h11*h22 - h12*h21) * (-h21 * (*ev)[0] + h11 * (*ev)[1]);
125 Teuchos::RCP<std::vector<Real> > x0p =
126 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(x0)).getVector());
127 Teuchos::RCP<std::vector<Real> > xp =
128 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(x)).getVector());
137 std::vector<Real> l, u;
147 (*xp)[0] = -M_PI/3.0 + 1.0/2.0;
148 (*xp)[1] = -M_PI/3.0 - 1.0/2.0;
Contains definitions for std::vector bound constraints.
Provides the interface to evaluate objective functions.
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
Contains definitions of custom data types in ROL.
Defines the linear algebra or vector space interface.
Provides the std::vector implementation of the ROL::Vector interface.
W. Hock and K. Schittkowski 5th test function.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.
Provides the interface to apply upper and lower bound constraints.
void getHS5(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Real value(const Vector< Real > &x, Real &tol)
Compute value.