qpOASES  3.1.1
include/qpOASES/Types.hpp
Go to the documentation of this file.
00001 /*
00002  *  This file is part of qpOASES.
00003  *
00004  *  qpOASES -- An Implementation of the Online Active Set Strategy.
00005  *  Copyright (C) 2007-2015 by Hans Joachim Ferreau, Andreas Potschka,
00006  *  Christian Kirches et al. All rights reserved.
00007  *
00008  *  qpOASES is free software; you can redistribute it and/or
00009  *  modify it under the terms of the GNU Lesser General Public
00010  *  License as published by the Free Software Foundation; either
00011  *  version 2.1 of the License, or (at your option) any later version.
00012  *
00013  *  qpOASES is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  *  See the GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public
00019  *  License along with qpOASES; if not, write to the Free Software
00020  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00021  *
00022  */
00023 
00024 
00035 #ifndef QPOASES_TYPES_HPP
00036 #define QPOASES_TYPES_HPP
00037 
00038 
00039 /* If your compiler does not support the snprintf() function,
00040  * uncomment the following line and try to compile again. */
00041 /* #define __NO_SNPRINTF__ */
00042 
00043 
00044 /* Uncomment the following line for setting the __DSPACE__ flag. */
00045 /* #define __DSPACE__ */
00046 
00047 /* Uncomment the following line for setting the __XPCTARGET__ flag. */
00048 /* #define __XPCTARGET__ */
00049 
00050 
00051 /* Uncomment the following line for setting the __NO_FMATH__ flag. */
00052 /* #define __NO_FMATH__ */
00053 
00054 /* Uncomment the following line to enable debug information. */
00055 /* #define __DEBUG__ */
00056 
00057 /* Uncomment the following line to enable suppress any kind of console output. */
00058 /* #define __SUPPRESSANYOUTPUT__ */
00059 
00060 
00063 #define __ALWAYS_INITIALISE_WITH_ALL_EQUALITIES__
00064 
00065 
00066 /* Uncomment the following line to activate the use of an alternative Givens 
00067  * plane rotation requiring only three multiplications. */
00068 /* #define __USE_THREE_MULTS_GIVENS__ */
00069 
00070 /* Uncomment the following line to activate the use of single precision arithmetic. */
00071 /* #define __USE_SINGLE_PRECISION__ */
00072 
00073 
00074 
00075 /* Work-around for Borland BCC 5.5 compiler. */
00076 #ifdef __BORLANDC__
00077 #if __BORLANDC__ < 0x0561
00078   #define __STDC__ 1
00079 #endif
00080 #endif
00081 
00082 
00083 /* Work-around for Microsoft compilers. */
00084 #ifdef _MSC_VER
00085   #define __NO_SNPRINTF__
00086   #pragma warning( disable : 4061 4100 4250 4514 4996 )
00087 #endif
00088 
00089 
00090 #ifdef __DSPACE__
00091 
00093     #define BEGIN_NAMESPACE_QPOASES
00094     
00096     #define END_NAMESPACE_QPOASES
00097 
00099     #define USING_NAMESPACE_QPOASES
00100 
00102     #define REFER_NAMESPACE_QPOASES ::
00103 
00104 #else
00105 
00107     #define BEGIN_NAMESPACE_QPOASES  namespace qpOASES {
00108 
00110     #define END_NAMESPACE_QPOASES    }
00111     
00113     #define USING_NAMESPACE_QPOASES  using namespace qpOASES;
00114     
00116     #define REFER_NAMESPACE_QPOASES  qpOASES::
00117 
00118 #endif
00119 
00120 
00121 /* Avoid any printing on embedded platforms. */
00122 #if defined(__DSPACE__) || defined(__XPCTARGET__) 
00123   #define __SUPPRESSANYOUTPUT__
00124   #define __NO_SNPRINTF__
00125 #endif
00126 
00127 
00128 #ifdef __NO_SNPRINTF__
00129   #if (!defined(_MSC_VER)) || defined(__DSPACE__) || defined(__XPCTARGET__) 
00130     /* If snprintf is not available, provide an empty implementation... */
00131     int snprintf( char* s, size_t n, const char* format, ... );
00132   #else
00133     /* ... or substitute snprintf by _snprintf for Microsoft compilers. */
00134     #define snprintf _snprintf    
00135   #endif
00136 #endif /* __NO_SNPRINTF__ */
00137 
00138 
00139 
00141 #define RR( I,J )  R[(I)+nV*(J)]
00142 
00144 #define QQ( I,J )  Q[(I)+nV*(J)]
00145 
00147 #define TT( I,J )  T[(I)*sizeT+(J)]
00148 
00149 
00150 
00151 BEGIN_NAMESPACE_QPOASES
00152 
00153 
00155 #ifdef __USE_SINGLE_PRECISION__
00156 typedef float real_t;
00157 #else
00158 typedef double real_t;
00159 #endif /* __USE_SINGLE_PRECISION__ */
00160 
00161 
00163 enum BooleanType
00164 {
00165     BT_FALSE,                   
00166     BT_TRUE                     
00167 };
00168 
00169 
00172 enum PrintLevel
00173 {
00174     PL_DEBUG_ITER = -2,         
00175     PL_TABULAR,                 
00176     PL_NONE,                    
00177     PL_LOW,                     
00178     PL_MEDIUM,                  
00179     PL_HIGH                     
00180 };
00181 
00182 
00184 enum VisibilityStatus
00185 {
00186     VS_HIDDEN,                  
00187     VS_VISIBLE                  
00188 };
00189 
00190 
00193 enum QProblemStatus
00194 {
00195     QPS_NOTINITIALISED,         
00196     QPS_PREPARINGAUXILIARYQP,   
00198     QPS_AUXILIARYQPSOLVED,      
00200     QPS_PERFORMINGHOMOTOPY,     
00202     QPS_HOMOTOPYQPSOLVED,       
00203     QPS_SOLVED                  
00204 };
00205 
00206 
00208 enum HessianType
00209 {
00210     HST_ZERO,               
00211     HST_IDENTITY,           
00212     HST_POSDEF,             
00213     HST_POSDEF_NULLSPACE,   
00214     HST_SEMIDEF,            
00215     HST_INDEF,              
00216     HST_UNKNOWN             
00217 };
00218 
00219 
00221 enum SubjectToType
00222 {
00223     ST_UNBOUNDED,       
00224     ST_BOUNDED,         
00225     ST_EQUALITY,        
00226     ST_DISABLED,        
00227     ST_UNKNOWN          
00228 };
00229 
00230 
00232 enum SubjectToStatus
00233 {
00234     ST_LOWER = -1,          
00235     ST_INACTIVE,            
00236     ST_UPPER,               
00237     ST_INFEASIBLE_LOWER,    
00238     ST_INFEASIBLE_UPPER,    
00239     ST_UNDEFINED            
00240 };
00241 
00252 struct TabularOutput {
00253     int idxAddB;        
00254     int idxRemB;        
00255     int idxAddC;        
00256     int idxRemC;        
00257     int excAddB;        
00258     int excRemB;        
00259     int excAddC;        
00260     int excRemC;        
00261 };
00262 
00263 
00264 
00279 typedef struct {
00280     long numericFormat;     
00281     long nRows;             
00282     long nCols;             
00283     long imaginaryPart;     
00284     long nCharName;         
00285 } MatMatrixHeader;
00286 
00287 
00288 
00289 
00290 END_NAMESPACE_QPOASES
00291 
00292 
00293 #endif  /* QPOASES_TYPES_HPP */
00294 
00295 
00296 /*
00297  *  end of file
00298  */