75 for (
int i = 0; i <
u_size_; i++ ) {
76 u_vec_.push_back(25.0 + std::pow((-50.0*std::log(0.01*(Real)(i+1))),2.0/3.0));
81 Teuchos::RCP<const std::vector<Real> > ex =
84 Real val = 0.0, f = 0.0;
85 for (
int i = 0; i < this->
u_size_; i++ ) {
86 f = -0.01*(Real)(i+1) + std::exp(-1.0/(*ex)[0] * std::pow(this->
u_vec_[i]-(*ex)[1],(*ex)[2]));
93 Teuchos::RCP<const std::vector<Real> > ex =
95 Teuchos::RCP<std::vector<Real> > eg =
96 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(g)).getVector());
99 Real f = 0.0, df1 = 0.0, df2 = 0.0, df3 = 0.0, tmp = 0.0;
100 for (
int i = 0; i < this->
u_size_; i++ ) {
101 tmp = std::pow(this->
u_vec_[i]-(*ex)[1],(*ex)[2])/(*ex)[0];
102 f = -0.01*(Real)(i+1) + std::exp(-tmp);
103 df1 = std::exp(-tmp)*tmp/(*ex)[0];
104 df2 = std::exp(-tmp)*(*ex)[2]*std::pow(this->
u_vec_[i]-(*ex)[1],(*ex)[2]-1.0)/(*ex)[0];
105 df3 = std::exp(-tmp)*tmp*std::log(this->
u_vec_[i]-(*ex)[1]);
106 (*eg)[0] += 2.0*f*df1;
107 (*eg)[1] += 2.0*f*df2;
108 (*eg)[2] += 2.0*f*df3;
113 Teuchos::RCP<const std::vector<Real> > ex =
115 Teuchos::RCP<const std::vector<Real> > ev =
117 Teuchos::RCP<std::vector<Real> > ehv =
118 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(hv)).getVector());
123 Teuchos::RCP<const std::vector<Real> > ex =
125 Teuchos::RCP<const std::vector<Real> > ev =
127 Teuchos::RCP<std::vector<Real> > ehv =
128 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(hv)).getVector());
137 Teuchos::RCP<std::vector<Real> > x0p =
138 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(x0)).getVector());
139 Teuchos::RCP<std::vector<Real> > xp =
140 Teuchos::rcp_const_cast<std::vector<Real> >((Teuchos::dyn_cast<
StdVector<Real> >(x)).getVector());
149 std::vector<Real> l, u;
Contains definitions for std::vector bound constraints.
Provides the interface to evaluate objective functions.
void getHS25(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
std::vector< Real > u_vec_
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.
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Provides the std::vector implementation of the ROL::Vector interface.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
W. Hock and K. Schittkowski 25th test function.
Provides the interface to apply upper and lower bound constraints.
void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.