55 namespace OptionsFromStreamPack {
56 class OptionsFromStream;
59 namespace NLPInterfacePack {
321 {
public:
UnInitialized(
const std::string& what_arg) : std::logic_error(what_arg) {}};
333 {
public:
NoBounds(
const std::string& what_arg) : std::logic_error(what_arg) {}};
395 virtual void initialize(
bool test_setup =
false );
474 virtual const Vector&
xl()
const = 0;
483 virtual const Vector&
xu()
const = 0;
616 virtual const Vector&
c()
const;
686 virtual void calc_f(
const Vector& x,
bool newx =
true)
const;
709 virtual void calc_c(
const Vector& x,
bool newx =
true)
const;
908 virtual const Permutation&
P_var()
const;
923 virtual const Permutation&
P_equ()
const;
989 :
f(f_in),
c(c_in),
h(h_in)
1106 #ifdef DOXYGEN_COMPILE
virtual value_type & f()
Returns non-const *this->get_f().
Extracts options from a text stream and then allows convenient access to them.
Thrown if an incompatible object is used.
AbstractLinAlgPack::size_type size_type
virtual void calc_c(const Vector &x, bool newx=true) const
Update the constraint residual vector for c at the point x and put it in the stored reference...
VectorMutable * c
Pointer to constraints residual c (Will be NULL if not set)
virtual size_type ns() const
Return the number of slack variables (i.e. number of general inequalities).
virtual void report_final_solution(const Vector &x, const Vector *lambda, const Vector *nu, bool is_optimal)
Used by the solver to report the final solution and multipliers.
ZeroOrderInfo(value_type *f_in, VectorMutable *c_in, VectorMutable *h_in)
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
UnInitialized(const std::string &what_arg)
AbstractLinAlgPack::VectorSpace * space_c_breve
virtual size_type num_c_evals() const
Gives the number of constraint function c(x) evaluations called by the solver since initialize() was ...
virtual value_type scale_f() const =0
Return the scaling being used for the objective function.
virtual VectorMutable & c_breve()
Returns non-const *this->get_c_breve().
virtual VectorMutable * get_c_breve()
Return pointer passed to this->set_c_breve().
virtual vec_space_ptr_t space_x() const =0
Vector space object for unknown variables x (dimension n).
AbstractLinAlgPack::Vector Vector
virtual vec_space_ptr_t space_c_breve() const
Vector space object for the original equalities c_breve(x_breve)
virtual void get_init_lagrange_mult(VectorMutable *lambda, VectorMutable *nu) const
Get the initial value of the Lagrange multipliers lambda.
const ZeroOrderInfo zero_order_info() const
Return pointer to set quantities.
virtual void imp_calc_c_breve(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info_breve) const
Overridden to compute c_breve(x_breve) and perhaps f(x) and/or h_breve(x_breve)
AbstractLinAlgPack::VectorSpace * space_c
virtual void imp_calc_f(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const =0
Overridden to compute f(x) (and perhaps other quantities if set).
void assert_ref_set(T *p, std::string info) const
Assert referece has been set for a quanity.
ZeroOrderInfo first_order_info_breve_
virtual void set_options(const options_ptr_t &options)
Set the options that this NLP may be interested in.
virtual void imp_calc_h_breve(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info_breve) const
Overridden to compute h_breve(x_breve) and perhaps f(x) and/or c_breve(x_breve).
AbstractLinAlgPack::VectorSpace * space_x
virtual void imp_calc_c(const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const =0
Overridden to compute c(x) and perhaps f(x) and/or h(x) (if multiple calculaiton = true)...
virtual void unset_quantities()
Call to unset all storage quantities (both in this class and all subclasses).
ZeroOrderInfo first_order_info_
Abstract interface for objects that represent a space for mutable coordinate vectors.
virtual const Vector & hl_breve() const
Returns a reference to the vector of lower bounds on the general inequality constraints h_breve(x_bre...
virtual void calc_f(const Vector &x, bool newx=true) const
Update the value for the objective f at the point x and put it in the stored reference.
virtual size_type n() const
Return the number of variables.
virtual vec_space_ptr_t space_c() const =0
Vector space object for general equality constraints c(x) (dimension m).
virtual const Vector & xl() const =0
Returns the lower bounds on the variables x.
const ZeroOrderInfo zero_order_info_breve() const
Return pointer to set hat quantities.
AbstractLinAlgPack::VectorMutable VectorMutable
virtual size_type num_bounded_x() const =0
Returns the number of variables in x(i) for which xl(i)> -infinite_bound() or xu(i) < +infinite_bound...
Teuchos::RCP< const OptionsFromStreamPack::OptionsFromStream > options_ptr_t
virtual void set_c(VectorMutable *c)
Set a pointer to a vector to be updated when this->calc_c() is called.
virtual bool force_xinit_in_bounds() const =0
Returns if the initial point must be within the bounds.
virtual const Vector & xu() const =0
Returns a reference to the vector of upper bounds on the variables x.
InvalidInitialization(const std::string &what_arg)
virtual value_type * get_f()
Return pointer passed to this->set_f().
Teuchos::RCP< const VectorSpace > vec_space_ptr_t
virtual ~NLP()
Destructor that cleans all the memory it owns.
Struct for objective and constriants (pointer).
virtual const options_ptr_t & get_options() const
Get the OptionsFromStream object being used to extract the options from.
NLP interface class {abstract}.
virtual vec_space_ptr_t space_h_breve() const
Vector space object for the original inequalities h_breve(x_breve)
Thrown if any member functions are called before initialize() has been called.
virtual const Permutation & P_var() const
Return the permutation object for the variables.
void assert_role_name_set(const ContainedClass *role_name_, const char func_name[], const char name[])
Assert that the reference is set.
virtual value_type max_var_bounds_viol() const =0
Set the maximum absolute value for which the variable bounds may be violated by when computing functi...
NLP()
Initialize to no reference set to calculation quanities.
virtual void set_c_breve(VectorMutable *c_breve)
Set a pointer to a vector to be updated when this->calc_c_breve() is called.
virtual const Permutation & P_equ() const
Return the permutation object for the constraints.
virtual const Vector & hu_breve() const
Returns a reference to the vector of upper bounds on the general inequality constraints h_breve(x_bre...
virtual void calc_h_breve(const Vector &x, bool newx=true) const
Update the constraint residual vector for h_breve at the point x and put it in the stored reference...
AbstractLinAlgPack::value_type value_type
Abstract interface for mutable coordinate vectors {abstract}.
value_type * f
Pointer to objective function f (Will be NULL if not set)
virtual void set_h_breve(VectorMutable *h_breve)
Set a pointer to a vector to be updated when this->calc_h_breve() is called.
IncompatibleType(const std::string &what_arg)
virtual bool is_initialized() const =0
Return if this is initialized.
virtual void calc_c_breve(const Vector &x, bool newx=true) const
Update the constraint residual vector for c_breve at the point x and put it in the stored reference...
virtual const Vector & xinit() const =0
Returns a reference to the vector of the initial guess for the solution x.
Thrown some bounds do not existe.
AbstractLinAlgPack::VectorSpace * space_h_breve
Thrown from initialize() if some logical error occured.
virtual size_type m() const
Return the number of general equality constraints.
virtual void initialize(bool test_setup=false)
Initialize the NLP before it is used.
virtual size_type num_f_evals() const
Gives the number of object function f(x) evaluations called by the solver since initialize() was call...
virtual VectorMutable * get_h_breve()
Return pointer passed to this->set_h_breve().
static value_type infinite_bound()
Value for an infinite bound.
virtual VectorMutable * get_c()
Return pointer passed to this->set_c().
VectorMutable * h
Pointer to inequality constraints h (Will be NULL if not set)
virtual void set_f(value_type *f)
Set a pointer to an value to be updated when this->calc_f() is called.
NoBounds(const std::string &what_arg)
virtual VectorMutable & c()
Returns non-const *this->get_c().
virtual VectorMutable & h_breve()
Returns non-const *this->get_h_breve().