00001 // Copyright (C) 2007, 2008 International Business Machines and others. 00002 // All Rights Reserved. 00003 // This code is published under the Eclipse Public License. 00004 // 00005 // $Id: IpCGPenaltyCq.hpp 1861 2010-12-21 21:34:47Z andreasw $ 00006 // 00007 // Authors: Andreas Waechter IBM 2007-06-04 00008 // derived from IpIpoptCalculatedQuantities.hpp 00009 00010 #ifndef __IPCGPENALTYCQ_HPP__ 00011 #define __IPCGPENALTYCQ_HPP__ 00012 00013 #include "IpIpoptCalculatedQuantities.hpp" 00014 #include "IpCGPenaltyData.hpp" 00015 00016 namespace Ipopt 00017 { 00018 00022 class CGPenaltyCq : public IpoptAdditionalCq 00023 { 00024 public: 00025 00029 CGPenaltyCq(IpoptNLP* ip_nlp, 00030 IpoptData* ip_data, 00031 IpoptCalculatedQuantities* ip_cg); 00032 00034 virtual ~CGPenaltyCq(); 00036 00040 bool Initialize(const Journalist& jnlst, 00041 const OptionsList& options, 00042 const std::string& prefix); 00043 00046 00048 Number curr_jac_cd_norm(Index nrm_type); 00050 Number curr_scaled_y_Amax(); 00052 Number curr_added_y_nrm2(); 00053 00055 Number curr_penalty_function(); 00057 Number trial_penalty_function(); 00060 Number curr_direct_deriv_penalty_function(); 00063 Number curr_fast_direct_deriv_penalty_function(); 00064 00066 Number dT_times_barH_times_d(); 00067 00068 00072 Number curr_cg_pert_fact(); 00073 00075 Number compute_curr_cg_penalty(const Number ); 00076 00078 Number compute_curr_cg_penalty_scale(); 00080 00083 static void RegisterOptions(const SmartPtr<RegisteredOptions>& roptions); 00085 00086 private: 00096 CGPenaltyCq(); 00097 00099 CGPenaltyCq(const CGPenaltyCq&); 00100 00102 void operator=(const CGPenaltyCq&); 00104 00109 IpoptNLP* ip_nlp_; 00110 IpoptData* ip_data_; 00111 IpoptCalculatedQuantities* ip_cq_; 00113 00115 CGPenaltyData& CGPenData() 00116 { 00117 CGPenaltyData& cg_pen_data = 00118 static_cast<CGPenaltyData&>(ip_data_->AdditionalData()); 00119 DBG_ASSERT(dynamic_cast<CGPenaltyData*>(&ip_data_->AdditionalData())); 00120 return cg_pen_data; 00121 } 00122 00125 CachedResults<Number> curr_fast_direct_deriv_penalty_function_cache_; 00126 CachedResults<Number> curr_jac_cd_norm_cache_; 00127 CachedResults<Number> curr_scaled_y_Amax_cache_; 00128 CachedResults<Number> curr_added_y_nrm2_cache_; 00130 CachedResults<Number> curr_penalty_function_cache_; 00132 CachedResults<Number> trial_penalty_function_cache_; 00135 CachedResults<Number> curr_direct_deriv_penalty_function_cache_; 00137 CachedResults<Number> curr_cg_pert_fact_cache_; 00139 00142 Number reference_infeasibility_; 00144 00147 bool initialize_called_; 00148 }; 00149 00150 } // namespace Ipopt 00151 00152 #endif