// @HEADER // ***************************************************************************** // Rapid Optimization Library (ROL) Package // // Copyright 2014 NTESS and the ROL contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef HS_PROBLEM_003_HPP #define HS_PROBLEM_003_HPP #include "ROL_NonlinearProgram.hpp" namespace HS { namespace HS_003 { template class Obj { public: template ScalarT value( const std::vector &x, Real &tol ) { ScalarT a = x[1]-x[0]; return x[1]+a*a*1e-5; } }; } template class Problem_003 : public ROL::NonlinearProgram { typedef ROL::Objective OBJ; typedef ROL::Vector V; typedef ROL::NonlinearProgram NP; public: Problem_003() : NP( dimension_x() ) { NP::setLower(1,0); } int dimension_x() { return 2; } const ROL::Ptr getObjective() { return ROL::makePtr>(); } const ROL::Ptr getInitialGuess() { Real x[] = {10.0,1.0}; return NP::createOptVector(x); }; bool initialGuessIsFeasible() { return true; } Real getInitialObjectiveValue() { return Real(1.00081); } Real getSolutionObjectiveValue() { return Real(0); } ROL::Ptr getSolutionSet() { Real x[] = {0,0}; return ROL::CreatePartitionedVector(NP::createOptVector(x)); } }; } // namespace HS #endif // HS_PROBLEM_003_HPP