MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConstrainedOptPack_QPOPT_CppDecl.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 // C declarations for QPSOL functions. These declarations should not have to change
43 // for different platforms. As long as the fortran object code uses capitalized
44 // names for its identifers then the declarations in Teuchos_F77_wrappers.h should be
45 // sufficent for portability.
46 
47 #ifndef QPOPT_CPP_DECL_H
48 #define QPOPT_CPP_DECL_H
49 
50 #include "Teuchos_F77_wrappers.h"
51 
52 namespace QPOPT_CppDecl {
53 
54 // Declarations that will link to the fortran object file.
55 // These may change for different platforms
56 
57 using FortranTypes::f_int; // INTEGER
58 using FortranTypes::f_real; // REAL
59 using FortranTypes::f_dbl_prec; // DOUBLE PRECISION
60 using FortranTypes::f_logical; // LOGICAL
61 
62 // /////////////////////////////////////////////////////////////////////////
67 
68 typedef FORTRAN_FUNC_PTR_DECL_UL_(void,QPHESS_FUNC,qphess_func) ( const f_int& N, const f_int& LDH
69  , const f_int& JTHCOL, const f_dbl_prec* HESS, const f_dbl_prec* X, f_dbl_prec* HX
70  , f_int* IW, const f_int& LENIW, f_dbl_prec* W, const f_int& LENW );
71 
73 void qpopt(
74  const f_int& N, const f_int& NCLIN
75  ,const f_int& LDA, const f_int& LDH, const f_dbl_prec* A
76  ,const f_dbl_prec* BL, const f_dbl_prec* BU, const f_dbl_prec* CVEC
77  ,const f_dbl_prec* H, FORTRAN_NAME_UL_(QPHESS_FUNC,qphess_func) QPHESS, f_int* ISTATE, f_dbl_prec* X
80  ,const f_int& LENW
81  );
82 
83 // //////////////////////////////////////////////////////////
84 // Enumerations for QPOPT options
85 
88  FP = 1,
89  LP = 2,
90  QP1 = 3,
91  QP2 = 4,
92  QP3 = 5,
93  QP4 = 6
94 };
95 
107  PROBLEM_TYPE = 10, // Use EQPOPT_problem_type
109 };
110 
111 
115  LIST = 2,
117 };
118 
127 };
128 
129 // ///////////////////////////////////////////////////////////
130 // C++ functions for setting QPOPT options.
131 
133 void reset_defaults();
134 
136 void set_int_option(EQPOPT_int_option option, const f_int&);
137 
140 
142 void set_real_option(EQPOPT_real_option option, const f_dbl_prec&);
143 
144 // ////////////////////////////////////////////////////
145 // Declarations to link with Fortran QPSOL procedures
146 
147 namespace Fortran {
148 extern "C" {
149 
150 FORTRAN_FUNC_DECL_UL(void,QPOPT,qpopt) ( const f_int& N, const f_int& NCLIN
151  , const f_int& LDA, const f_int& LDH, const f_dbl_prec* A
152  , const f_dbl_prec* BL, const f_dbl_prec* BU, const f_dbl_prec* CVEC
153  , const f_dbl_prec* H, FORTRAN_NAME_UL_(QPHESS_FUNC,qphess_func) QPHESS, f_int* ISTATE, f_dbl_prec* X
156  , const f_int& LENW );
157 
158 FORTRAN_FUNC_DECL_UL(void,QPHESS,qphess) ( const f_int& N, const f_int& LDH
159  , const f_int& JTHCOL, const f_dbl_prec* H, const f_dbl_prec* X, f_dbl_prec* HX
160  , f_int* IW, const f_int& LENIW, f_dbl_prec* W, const f_int& LENW );
161 
162 FORTRAN_FUNC_DECL_UL_(void,QPOPT_SET_DEFAULTS,qpopt_set_defaults) ();
163 
164 FORTRAN_FUNC_DECL_UL_(void,QPOPT_INT_OPT,qpopt_int_opt) (const f_int& option, const f_int& );
165 
166 FORTRAN_FUNC_DECL_UL_(void,QPOPT_LOG_OPT,qpopt_log_opt) (const f_int& option, const f_logical& );
167 
168 FORTRAN_FUNC_DECL_UL_(void,QPOPT_REAL_OPT,qpopt_real_opt) (const f_int& option, const f_dbl_prec& );
169 
170 } // end extern "C"
171 } // end namespace Fortran
172 
173 // ///////////////////////////////////////////////////////////////////////////////
174 // Inline definitions.
175 
176 inline
177 void qpopt( const f_int& N, const f_int& NCLIN
178  , const f_int& LDA, const f_int& LDH, const f_dbl_prec* A
179  , const f_dbl_prec* BL, const f_dbl_prec* BU, const f_dbl_prec* CVEC
180  , const f_dbl_prec* H, FORTRAN_NAME_UL_(QPHESS_FUNC,qphess_func) QPHESS, f_int* ISTATE, f_dbl_prec* X
181  , f_int& INFORM, f_int& ITER, f_dbl_prec& OBJ, f_dbl_prec* AX
182  , f_dbl_prec* CLAMDA, f_int* IW, const f_int& LENIW, f_dbl_prec* W
183  , const f_int& LENW )
184 {
185  Fortran::FORTRAN_FUNC_CALL_UL(QPOPT,qpopt) ( N, NCLIN, LDA, LDH, A, BL, BU, CVEC, H, QPHESS
186  , ISTATE, X, INFORM, ITER, OBJ, AX, CLAMDA, IW, LENIW, W, LENW );
187 }
188 
189 inline
191 { Fortran::FORTRAN_FUNC_CALL_UL_(QPOPT_SET_DEFAULTS,qpopt_set_defaults) (); }
192 
193 inline
194 void set_int_option(EQPOPT_int_option option, const f_int& val)
195 { Fortran::FORTRAN_FUNC_CALL_UL_(QPOPT_INT_OPT,qpopt_int_opt) ( option, val ); }
196 
197 inline
199 { Fortran::FORTRAN_FUNC_CALL_UL_(QPOPT_LOG_OPT,qpopt_log_opt) ( option, val ); }
200 
201 inline
203 { Fortran::FORTRAN_FUNC_CALL_UL_(QPOPT_REAL_OPT,qpopt_real_opt) ( option, val ); }
204 
206 
207 } // end namespace QPOPT_CppDecl
208 
209 #endif // QPOPT_CPP_DECL_H
void set_real_option(EQPOPT_real_option option, const f_dbl_prec &)
Set a real valued option.
const f_int const f_int const f_dbl_prec const f_dbl_prec f_dbl_prec * HX
void set_logical_option(EQPOPT_logical_option option, const f_logical &)
Set a logical valued option.
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec * BL
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec f_int f_dbl_prec f_int f_int f_dbl_prec f_dbl_prec f_dbl_prec * CLAMDA
const LAPACK_C_Decl::f_int LAPACK_C_Decl::f_dbl_prec const LAPACK_C_Decl::f_int & LDA
FortranTypes::f_int f_int
const f_int const f_int & JTHCOL
const f_int const f_int const f_dbl_prec const f_dbl_prec * X
FORTRAN_FUNC_DECL_UL_(void, QPOPT_SET_DEFAULTS, qpopt_set_defaults)()
FortranTypes::f_logical f_logical
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec f_int f_dbl_prec f_int & INFORM
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec FORTRAN_NAME_UL_(QPHESS_FUNC, qphess_func) QPHESS
EQPOPT_problem_type
Use to specify problem types.
FORTRAN_FUNC_DECL_UL(void, QPOPT, qpopt)(const f_int &N
void qpopt(const f_int &N, const f_int &NCLIN, const f_int &LDA, const f_int &LDH, const f_dbl_prec *A, const f_dbl_prec *BL, const f_dbl_prec *BU, const f_dbl_prec *CVEC, const f_dbl_prec *H, FORTRAN_NAME_UL_(QPHESS_FUNC, qphess_func) QPHESS, f_int *ISTATE, f_dbl_prec *X, f_int &INFORM, f_int &ITER, f_dbl_prec &OBJ, f_dbl_prec *AX, f_dbl_prec *CLAMDA, f_int *IW, const f_int &LENIW, f_dbl_prec *W, const f_int &LENW)
Call QPOPT through C++ declaration.
const f_int const f_int const f_int const f_dbl_prec * A
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec f_int f_dbl_prec f_int f_int f_dbl_prec f_dbl_prec * AX
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec f_int * ISTATE
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec * H
void set_int_option(EQPOPT_int_option option, const f_int &)
Set an integer valued option.
const f_int const f_int const f_dbl_prec const f_dbl_prec f_dbl_prec f_int const f_int f_dbl_prec * W
const f_int const f_int const f_int & LDH
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec f_int f_dbl_prec * X
const f_int const f_int const f_dbl_prec const f_dbl_prec f_dbl_prec f_int const f_int & LENIW
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec * BU
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec * CVEC
void reset_defaults()
Reset all of QPOPT's options to the defaults.
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec f_int f_dbl_prec f_int f_int f_dbl_prec f_dbl_prec f_dbl_prec f_int const f_int f_dbl_prec const f_int & LENW
const f_int const f_int & N
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec f_int f_dbl_prec f_int f_int f_dbl_prec f_dbl_prec f_dbl_prec f_int * IW
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec f_int f_dbl_prec f_int f_int f_dbl_prec f_dbl_prec f_dbl_prec f_int const f_int f_dbl_prec * W
typedef FORTRAN_FUNC_PTR_DECL_UL_(void, QPHESS_FUNC, qphess_func)(const f_int &N
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec f_int f_dbl_prec f_int f_int f_dbl_prec f_dbl_prec f_dbl_prec f_int const f_int & LENIW
const f_int const f_int const f_dbl_prec const f_dbl_prec f_dbl_prec f_int const f_int f_dbl_prec const f_int & LENW
const f_int const f_int const f_dbl_prec * HESS
FortranTypes::f_dbl_prec f_dbl_prec
const f_int const f_int const f_dbl_prec const f_dbl_prec f_dbl_prec f_int * IW
FortranTypes::f_real f_real
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec f_int f_dbl_prec f_int f_int & ITER
const f_int const f_int const f_int const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec const f_dbl_prec f_int f_dbl_prec f_int f_int f_dbl_prec & OBJ