NLPInterfacePack_NLPWBCounterExample.hpp

00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00005 //                  Copyright (2003) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef NLP_WB_COUNTER_EXAMPLE_H
00030 #define NLP_WB_COUNTER_EXAMPLE_H
00031 
00032 #include "NLPInterfacePack_NLPSerialPreprocessExplJac.hpp"
00033 
00034 namespace NLPInterfacePack {
00035 
00068 class NLPWBCounterExample : public NLPSerialPreprocessExplJac {
00069 public:
00070 
00073 
00088   NLPWBCounterExample(
00089     value_type   xinit[3]
00090     ,value_type   a                  = 0.0
00091     ,value_type   b                  = 1.0
00092     ,bool         nlp_selects_basis  = true
00093     ,bool         linear_obj         = true
00094     );
00095 
00097 
00100 
00102   void initialize(bool test_setup);
00104   bool is_initialized() const;
00106   value_type max_var_bounds_viol() const;
00107 
00109 
00112   
00114   bool nlp_selects_basis() const;
00115 
00117 
00118 protected:
00119 
00122 
00124   bool imp_nlp_has_changed() const;
00126   size_type imp_n_orig() const;
00128   size_type imp_m_orig() const;
00130   size_type imp_mI_orig() const;
00132   const DVectorSlice imp_xinit_orig() const;
00134   bool imp_has_var_bounds() const;
00136   const DVectorSlice imp_xl_orig() const;
00138   const DVectorSlice imp_xu_orig() const;
00140   const DVectorSlice imp_hl_orig() const;
00142   const DVectorSlice imp_hu_orig() const;
00144   void imp_calc_f_orig(
00145     const DVectorSlice &x_full, bool newx, const ZeroOrderInfoSerial &zero_order_info ) const;
00147   void imp_calc_c_orig(
00148     const DVectorSlice &x_full, bool newx, const ZeroOrderInfoSerial &zero_order_info ) const;
00150   void imp_calc_h_orig(
00151     const DVectorSlice &x_full, bool newx, const ZeroOrderInfoSerial &zero_order_info ) const;
00153   void imp_calc_Gf_orig(
00154     const DVectorSlice &x_full, bool newx, const ObjGradInfoSerial &obj_grad_info ) const;
00156   bool imp_get_next_basis(
00157     IVector *var_perm_full, IVector *equ_perm_full, size_type *rank_full, size_type *rank );
00159   void imp_report_orig_final_solution(
00160     const DVectorSlice &x_orig, const DVectorSlice *lambda_orig
00161     ,const DVectorSlice *lambdaI_orig, const DVectorSlice *nu_orig, bool is_optimal ) const;
00162 
00164   
00167 
00169   size_type imp_Gc_nz_orig() const;
00171   size_type imp_Gh_nz_orig() const;
00173   void imp_calc_Gc_orig(
00174     const DVectorSlice& x_full, bool newx, const FirstOrderExplInfo& first_order_expl_info ) const;
00176   void imp_calc_Gh_orig(
00177     const DVectorSlice& x_full, bool newx, const FirstOrderExplInfo& first_order_expl_info ) const;
00178 
00180 
00181 private:
00182 
00183   // /////////////////////////////////////////
00184   // Private data members
00185 
00186   bool         is_initialized_;                 // Flag for if this is initialized
00187   bool         nlp_selects_basis_;              // Flag for if this selects first basis
00188   bool         basis_selection_was_given_;      // Flag for if this already selected a basis
00189   bool         linear_obj_;                     // Flag for if objective is linear or quadratic
00190   size_type    n_orig_, m_orig_, Gc_orig_nz_;   // NLP sizes and number nonzeros in Jacobian
00191   value_type   a_, b_;                          // Constants for constraints
00192   DVector      xinit_orig_, xl_orig_, xu_orig_; // Guess, and bounds on x_orig
00193 
00194   // /////////////////////////////////////////
00195   // Private member functions
00196 
00197   // Not defined and not to be called
00198   NLPWBCounterExample();
00199   NLPWBCounterExample(const NLPWBCounterExample&);
00200   NLPWBCounterExample& operator=(const NLPWBCounterExample&);
00201 
00202 };  // end class NLPWBCounterExample
00203 
00204 } // end namespace NLPInterfacePack
00205 
00206 #endif  // NLP_WB_COUNTER_EXAMPLE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
Generated on Wed Apr 13 10:18:07 2011 for MOOCHO by  doxygen 1.6.3