NLPInterfacePack_CalcFiniteDiffProd.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 CALC_FINITE_DIFF_FIRST_DERIVATIVE_PRODUCT_H
00030 #define CALC_FINITE_DIFF_FIRST_DERIVATIVE_PRODUCT_H
00031 
00032 #include "NLPInterfacePack_Types.hpp"
00033 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00034 
00035 namespace NLPInterfacePack {
00036 
00107 class CalcFiniteDiffProd {
00108 public:
00109 
00111   enum EFDMethodOrder {
00112     FD_ORDER_ONE           
00113     ,FD_ORDER_TWO          
00114     ,FD_ORDER_TWO_CENTRAL  
00115     ,FD_ORDER_TWO_AUTO     
00116     ,FD_ORDER_FOUR         
00117     ,FD_ORDER_FOUR_CENTRAL 
00118     ,FD_ORDER_FOUR_AUTO    
00119   };
00121   enum EFDStepSelect {
00122     FD_STEP_ABSOLUTE      
00123     ,FD_STEP_RELATIVE     
00124   };
00126   STANDARD_MEMBER_COMPOSITION_MEMBERS( EFDMethodOrder, fd_method_order );
00128   STANDARD_MEMBER_COMPOSITION_MEMBERS( EFDStepSelect, fd_step_select );
00135   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, fd_step_size );
00143   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, fd_step_size_min );
00145   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, fd_step_size_f );
00147   STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, fd_step_size_c );
00148 
00150   CalcFiniteDiffProd(
00151     EFDMethodOrder              fd_method_order  = FD_ORDER_FOUR_AUTO
00152     ,EFDStepSelect              fd_step_select   = FD_STEP_ABSOLUTE
00153     ,value_type                 fd_step_size     = -1.0
00154     ,value_type                 fd_step_size_min = -1.0
00155     ,value_type                 fd_step_size_f   = -1.0
00156     ,value_type                 fd_step_size_c   = -1.0
00157     );
00158 
00160   virtual ~CalcFiniteDiffProd() {}
00161 
00211   virtual bool calc_deriv_product(
00212     const Vector       &xo
00213     ,const Vector      *xl
00214     ,const Vector      *xu
00215     ,const Vector      &v
00216     ,const value_type  *fo
00217     ,const Vector      *co
00218     ,bool              check_nan_inf
00219     ,NLP               *nlp
00220     ,value_type        *Gf_prod
00221     ,VectorMutable     *Gc_prod
00222     ,std::ostream      *out
00223     ,bool              trace    = false
00224     ,bool              dump_all = false
00225     ) const;
00226 
00227 };  // end class CalcFiniteDiffProd
00228 
00229 } // end namespace NLPInterfacePack
00230 
00231 #endif  // CALC_FINITE_DIFF_FIRST_DERIVATIVE_PRODUCT_H

Generated on Wed May 12 21:51:00 2010 for NLPInterfacePack: C++ Interfaces and Implementation for Non-Linear Programs by  doxygen 1.4.7