MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NLPInterfacePack_NLPSecondOrder.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
5 // Copyright (2003) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef NLP_SECOND_ORDER_INFO_H
43 #define NLP_SECOND_ORDER_INFO_H
44 
46 
47 namespace NLPInterfacePack {
48 
77 class NLPSecondOrder : virtual public NLPFirstOrder {
78 public:
79 
81  typedef Teuchos::RCP<
83 
86 
89 
91 
94 
107  void initialize(bool test_setup);
108 
110 
113 
120  virtual const mat_sym_fcty_ptr_t factory_HL() const = 0;
121 
123 
126 
139  virtual void set_HL(MatrixSymOp* HL);
146  virtual MatrixSymOp* get_HL();
154  virtual MatrixSymOp& HL();
162  virtual const MatrixSymOp& HL() const;
163 
165 
168 
182  void unset_quantities();
183 
185 
188 
218  virtual void calc_HL(
219  const Vector& x, const Vector* lambda, bool newpoint = true) const;
220 
222 
225 
231  virtual size_type num_HL_evals() const;
232 
234 
235 protected:
236 
242  : HL(NULL), Gc(NULL), Gf(NULL), f(NULL), c(NULL)
243  {}
245  SecondOrderInfo( MatrixSymOp* HL_in, const FirstOrderInfo& first_order_info )
246  :HL(HL_in), Gc(first_order_info.Gc), Gf(first_order_info.Gf)
247  ,f(first_order_info.f), c(first_order_info.c)
248  {}
250  MatrixSymOp* HL;
252  MatrixOp* Gc;
259  }; // end struct SecondOrderInfo
260 
262  const SecondOrderInfo second_order_info() const;
263 
266 
290  virtual void imp_calc_HL(
291  const Vector& x, const Vector* lambda, bool newpoint
293  ) const = 0;
294 
296 
297 private:
298 
299 #ifdef DOXYGEN_COMPILE
301 #endif
302  mutable MatrixSymOp *HL_;
303  mutable bool num_HL_evals_;
304 
305 }; // end class NLPSecondOrder
306 
307 // //////////////////
308 // Inline members
309 
310 inline
312 {
314 }
315 
316 } // end namespace NLPInterfacePack
317 
318 #endif // NLP_SECOND_ORDER_INFO_H
AbstractLinAlgPack::size_type size_type
NLPSecondOrder()
Initialize to no reference set to calculation quanities.
Teuchos::AbstractFactory< AbstractLinAlgPack::MatrixSymOp > * factory_HL
VectorMutable * c
Pointer to equality constraints residule c (may be NULL if not set)
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
MatrixOp * Gc
Pointer to Hessian of the equality constraints Gc (may be NULL if not set)
virtual MatrixSymOp & HL()
Returns non-const *this->get_HL().
const FirstOrderInfo first_order_info() const
Return objective gradient and zero order information.
Struct for zero, first and second order quantities (pointers)
void initialize(bool test_setup)
Initialize the NLP for its first use.
value_type * f
Pointer to objective function f (may be NULL if not set)
virtual void set_HL(MatrixSymOp *HL)
Set a pointer to a matrix object to be updated when this->calc_HL() is called.
MatrixSymOp * HL
Pointer to Hessiand of the Lagrangian HL) (may be NULL is not set)
Struct for zero and first order quantities (pointers)
virtual size_type num_HL_evals() const
Number of Hessian evaluations.
NLP first order information interface class {abstract}.
virtual MatrixSymOp * get_HL()
Return pointer passed to this->set_HL().
virtual void imp_calc_HL(const Vector &x, const Vector *lambda, bool newpoint, const SecondOrderInfo &second_order_info) const =0
Overridden to compute Gc(x) and perhaps Gf(x), f(x) and c(x).
void unset_quantities()
Call to unset all storage quantities (both in this class and all subclasses).
AbstractLinAlgPack::value_type value_type
VectorMutable * Gf
Pointer to gradient of objective function Gf (may be NULL if not set)
Abstract interface for mutable coordinate vectors {abstract}.
virtual void calc_HL(const Vector &x, const Vector *lambda, bool newpoint=true) const
Update the matrix for HL at the point x, lambda, lambdaI and put it in the stored reference...
Teuchos::RCP< const Teuchos::AbstractFactory< MatrixSymOp > > mat_sym_fcty_ptr_t
SecondOrderInfo(MatrixSymOp *HL_in, const FirstOrderInfo &first_order_info)
virtual const mat_sym_fcty_ptr_t factory_HL() const =0
Return a matrix factory object for creating HL.
NLP second order information interface class {abstract}.
const SecondOrderInfo second_order_info() const
Return objective gradient and zero order information.