|
NLPInterfacePack: C++ Interfaces and Implementation for Non-Linear Programs Version of the Day
|
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_SECOND_ORDER_INFO_H 00030 #define NLP_SECOND_ORDER_INFO_H 00031 00032 #include "NLPInterfacePack_NLPFirstOrder.hpp" 00033 00034 namespace NLPInterfacePack { 00035 00064 class NLPSecondOrder : virtual public NLPFirstOrder { 00065 public: 00066 00068 typedef Teuchos::RCP< 00069 const Teuchos::AbstractFactory<MatrixSymOp> > mat_sym_fcty_ptr_t; 00070 00073 00075 NLPSecondOrder(); 00076 00078 00081 00094 void initialize(bool test_setup); 00095 00097 00100 00107 virtual const mat_sym_fcty_ptr_t factory_HL() const = 0; 00108 00110 00113 00126 virtual void set_HL(MatrixSymOp* HL); 00133 virtual MatrixSymOp* get_HL(); 00141 virtual MatrixSymOp& HL(); 00149 virtual const MatrixSymOp& HL() const; 00150 00152 00155 00169 void unset_quantities(); 00170 00172 00175 00205 virtual void calc_HL( 00206 const Vector& x, const Vector* lambda, bool newpoint = true) const; 00207 00209 00212 00218 virtual size_type num_HL_evals() const; 00219 00221 00222 protected: 00223 00226 struct SecondOrderInfo { 00228 SecondOrderInfo() 00229 : HL(NULL), Gc(NULL), Gf(NULL), f(NULL), c(NULL) 00230 {} 00232 SecondOrderInfo( MatrixSymOp* HL_in, const FirstOrderInfo& first_order_info ) 00233 :HL(HL_in), Gc(first_order_info.Gc), Gf(first_order_info.Gf) 00234 ,f(first_order_info.f), c(first_order_info.c) 00235 {} 00237 MatrixSymOp* HL; 00239 MatrixOp* Gc; 00241 VectorMutable* Gf; 00243 value_type* f; 00245 VectorMutable* c; 00246 }; // end struct SecondOrderInfo 00247 00249 const SecondOrderInfo second_order_info() const; 00250 00253 00277 virtual void imp_calc_HL( 00278 const Vector& x, const Vector* lambda, bool newpoint 00279 ,const SecondOrderInfo& second_order_info 00280 ) const = 0; 00281 00283 00284 private: 00285 00286 #ifdef DOXYGEN_COMPILE 00287 Teuchos::AbstractFactory<AbstractLinAlgPack::MatrixSymOp> *factory_HL; 00288 #endif 00289 mutable MatrixSymOp *HL_; 00290 mutable bool num_HL_evals_; 00291 00292 }; // end class NLPSecondOrder 00293 00294 // ////////////////// 00295 // Inline members 00296 00297 inline 00298 const NLPSecondOrder::SecondOrderInfo NLPSecondOrder::second_order_info() const 00299 { 00300 return SecondOrderInfo(HL_,first_order_info()); 00301 } 00302 00303 } // end namespace NLPInterfacePack 00304 00305 #endif // NLP_SECOND_ORDER_INFO_H
1.7.4