NLPInterfacePack_ExampleNLPFirstOrder.hpp

Go to the documentation of this file.
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 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   // Private data members
00111 
00112   bool                                initialized_;  // flag for if initialized has been called.
00113   NLPFirstOrder::mat_fcty_ptr_t       factory_Gc_;   // Factory for Gc
00114   NLPFirstOrder::basis_sys_ptr_t      basis_sys_;    // The basis system
00115 
00116   // /////////////////////////////////////////
00117   // Private member functions
00118 
00120   void assert_is_initialized() const;
00121 
00122 };  // end class ExampleNLPFirstOrder
00123 
00124 // ///////////////////////////////////////////////
00125 // Inline member functions
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 } // end namespace NLPInterfacePack
00137 
00138 #endif  // EXAMPLE_NLP_FIRST_ORDER_INFO_H

Generated on Tue Oct 20 12:51:48 2009 for MOOCHO (Single Doxygen Collection) by doxygen 1.4.7