|
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_FIRST_ORDER_DIRECT_TESTER_H 00030 #define NLP_FIRST_ORDER_DIRECT_TESTER_H 00031 00032 #include <iosfwd> 00033 00034 #include "NLPInterfacePack_Types.hpp" 00035 #include "NLPInterfacePack_CalcFiniteDiffProd.hpp" 00036 #include "Teuchos_StandardCompositionMacros.hpp" 00037 #include "Teuchos_StandardMemberCompositionMacros.hpp" 00038 00039 namespace NLPInterfacePack { 00040 00154 class NLPDirectTester { 00155 public: 00156 00158 enum ETestingMethod { 00159 FD_COMPUTE_ALL 00160 ,FD_DIRECTIONAL 00161 }; 00162 00164 STANDARD_COMPOSITION_MEMBERS( CalcFiniteDiffProd, calc_fd_prod ); 00166 STANDARD_MEMBER_COMPOSITION_MEMBERS( ETestingMethod, Gf_testing_method ); 00168 STANDARD_MEMBER_COMPOSITION_MEMBERS( ETestingMethod, Gc_testing_method ); 00170 STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, Gf_warning_tol ); 00172 STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, Gf_error_tol ); 00174 STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, Gc_warning_tol ); 00176 STANDARD_MEMBER_COMPOSITION_MEMBERS( value_type, Gc_error_tol ); 00178 STANDARD_MEMBER_COMPOSITION_MEMBERS( size_type, num_fd_directions ); 00180 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, dump_all ); 00181 00183 NLPDirectTester( 00184 const calc_fd_prod_ptr_t &calc_fd_prod = Teuchos::null 00185 ,ETestingMethod Gf_testing_method = FD_DIRECTIONAL 00186 ,ETestingMethod Gc_testing_method = FD_DIRECTIONAL 00187 ,value_type Gf_warning_tol = 1e-6 00188 ,value_type Gf_error_tol = 1e-1 00189 ,value_type Gc_warning_tol = 1e-6 00190 ,value_type Gc_error_tol = 1e-1 00191 ,size_type num_fd_directions = 1 00192 ,bool dump_all = false 00193 ); 00194 00245 bool finite_diff_check( 00246 NLPDirect *nlp 00247 ,const Vector &xo 00248 ,const Vector *xl 00249 ,const Vector *xu 00250 ,const Vector *c 00251 ,const Vector *Gf 00252 ,const Vector *py 00253 ,const Vector *rGf 00254 ,const MatrixOp *GcU 00255 ,const MatrixOp *D 00256 ,const MatrixOp *Uz 00257 ,bool print_all_warnings 00258 ,std::ostream *out 00259 ) const; 00260 00261 }; // end class NLPDirectTester 00262 00263 } // end namespace NLPInterfacePack 00264 00265 #endif // NLP_FIRST_ORDER_DIRECT_TESTER_H
1.7.4