00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef EXAMPLE_NLP_FIRST_ORDER_INFO_H
00030 #define EXAMPLE_NLP_FIRST_ORDER_INFO_H
00031
00032 #include "NLPInterfacePack_ExampleNLPObjGrad.hpp"
00033 #include "NLPInterfacePack_NLPFirstOrder.hpp"
00034
00035 namespace NLPInterfacePack {
00036
00060 class ExampleNLPFirstOrder
00061 : virtual public NLPFirstOrder
00062 , virtual public ExampleNLPObjGrad
00063 {
00064 public:
00065
00068 ExampleNLPFirstOrder(
00069 const VectorSpace::space_ptr_t& vec_space
00070 ,value_type xo
00071 ,bool has_bounds
00072 ,bool dep_bounded
00073 );
00074
00077
00079 void initialize(bool test_setup);
00081 bool is_initialized() const;
00082
00084
00087
00089 void set_Gc(MatrixOp* Gc);
00091 const NLPFirstOrder::mat_fcty_ptr_t factory_Gc() const;
00093 const basis_sys_ptr_t basis_sys() const;
00094
00096
00097 protected:
00098
00101
00103 void imp_calc_Gc(const Vector& x, bool newx, const FirstOrderInfo& first_order_info) const;
00104
00106
00107 private:
00108
00109
00110
00111
00112 bool initialized_;
00113 NLPFirstOrder::mat_fcty_ptr_t factory_Gc_;
00114 NLPFirstOrder::basis_sys_ptr_t basis_sys_;
00115
00116
00117
00118
00120 void assert_is_initialized() const;
00121
00122 };
00123
00124
00125
00126
00127 inline
00128 void ExampleNLPFirstOrder::assert_is_initialized() const
00129 {
00130 using NLPInterfacePack::NLP;
00131 if( !is_initialized() )
00132 throw NLP::UnInitialized("ExampleNLPFirstOrder::assert_is_initialized() : Error, "
00133 "ExampleNLPFirstOrder::initialize() has not been called yet." );
00134 }
00135
00136 }
00137
00138 #endif // EXAMPLE_NLP_FIRST_ORDER_INFO_H