73 typedef typename vector::size_type
uint;
79 Teuchos::RCP<const vector>
getVector(
const V& x ) {
80 using Teuchos::dyn_cast;
85 using Teuchos::dyn_cast;
92 for ( uint i = 0; i <
u_size_; i++ ) {
93 u_vec_.push_back(25.0 + std::pow((-50.0*std::log(0.01*(Real)(i+1))),2.0/3.0));
102 Real val = 0.0, f = 0.0;
103 for ( uint i = 0; i <
u_size_; i++ ) {
104 f = -0.01*(Real)(i+1) + std::exp(-1.0/(*ex)[0] * std::pow(u_vec_[i]-(*ex)[1],(*ex)[2]));
117 Real f = 0.0, df1 = 0.0, df2 = 0.0, df3 = 0.0, tmp = 0.0;
118 for ( uint i = 0; i <
u_size_; i++ ) {
119 tmp = std::pow(u_vec_[i]-(*ex)[1],(*ex)[2])/(*ex)[0];
120 f = -0.01*(Real)(i+1) + std::exp(-tmp);
121 df1 = std::exp(-tmp)*tmp/(*ex)[0];
122 df2 = std::exp(-tmp)*(*ex)[2]*std::pow(u_vec_[i]-(*ex)[1],(*ex)[2]-1.0)/(*ex)[0];
123 df3 = std::exp(-tmp)*tmp*std::log(u_vec_[i]-(*ex)[1]);
124 (*eg)[0] += 2.0*f*df1;
125 (*eg)[1] += 2.0*f*df2;
126 (*eg)[2] += 2.0*f*df3;
152 typedef std::vector<Real>
vector;
157 using Teuchos::dyn_cast;
160 RCP<vector> x0p = dyn_cast<SV>(x0).
getVector();
161 RCP<vector> xp = dyn_cast<SV>(x).
getVector();
172 RCP<vector> l_rcp = rcp(
new vector(n,0.0) );
173 RCP<vector> u_rcp = rcp(
new vector(n,0.0) );
174 l_rcp->push_back(0.1);
175 l_rcp->push_back(0.0);
176 l_rcp->push_back(0.0);
177 u_rcp->push_back(100.0);
178 u_rcp->push_back(25.6);
179 u_rcp->push_back(5.0);
181 RCP<V> l = rcp(
new SV(l_rcp) );
182 RCP<V> u = rcp(
new SV(u_rcp) );
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.
std::vector< Real > vector
Provides the std::vector implementation of the ROL::Vector interface.
Teuchos::RCP< vector > getVector(V &x)
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.
Teuchos::RCP< const vector > getVector(const V &x)
void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.