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 <
dim_; i++ ) {
101 for ( uint i = 0; i <
dim_; i++ ) {
104 return 2.0 - prod/
fact_;
113 for ( uint j = 0; j <
dim_; j++ ) {
114 for ( uint i = 0; i <
dim_; i++ ) {
119 (*eg)[j] = -prod/
fact_;
133 for ( uint l = 0; l <
dim_; l++ ) {
134 for ( uint j = 0; j <
dim_; j++ ) {
136 for ( uint i = 0; i <
dim_; i++ ) {
137 if ( j != i && l != i ) {
141 (*ehv)[l] += -prod/fact_*(*ev)[j];
154 typedef std::vector<Real>
vector;
158 typedef typename vector::size_type
uint;
162 using Teuchos::dyn_cast;
165 RCP<vector> x0p = dyn_cast<SV>(x0).
getVector();
166 RCP<vector> xp = dyn_cast<SV>(x).
getVector();
179 RCP<vector> l_rcp = rcp(
new vector(n,0.0) );
180 RCP<vector> u_rcp = rcp(
new vector(n,0.0) );
182 for ( uint i = 0; i < n; i++ ) {
184 (*u_rcp)[i] =
static_cast<Real
>(i+1);
187 RCP<V> l = rcp(
new SV(l_rcp) );
188 RCP<V> u = rcp(
new SV(u_rcp) );
193 for ( uint i = 0; i < n; i++ ) {
198 for ( uint i = 0; i < n; i++ ) {
199 (*xp)[i] = (Real)(i+1);
Provides the interface to evaluate objective functions.
Teuchos::RCP< const vector > getVector(const V &x)
std::vector< Real > vector
Real value(const Vector< Real > &x, Real &tol)
Compute value.
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.
Provides the std::vector implementation of the ROL::Vector interface.
void getHS45(Teuchos::RCP< Objective< Real > > &obj, Teuchos::RCP< BoundConstraint< Real > > &con, Vector< Real > &x0, Vector< Real > &x)
Provides the interface to apply upper and lower bound constraints.
W. Hock and K. Schittkowski 45th test function.
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Teuchos::RCP< vector > getVector(V &x)
Objective_HS45(uint dim=5)