42 #include <qpOASES/MessageHandling.hpp> 43 #include <qpOASES/Utils.hpp> 53 #ifndef __SUPPRESSANYOUTPUT__ 91 {
RET_QPOBJECT_NOT_SETUP,
"The QP object has not been setup correctly, use another constructor", VS_VISIBLE },
110 {
RET_QP_NOT_SOLVED,
"Problems occurred while solving QP with standard solver", VS_VISIBLE },
152 {
RET_LI_RESOLVED,
"Linear independence of active constraint matrix successfully resolved", VS_VISIBLE },
153 {
RET_ENSURELI_FAILED,
"Failed to ensure linear independence of active constraint matrix", VS_VISIBLE },
178 {
RET_NO_REGSTEP_NWSR,
"No additional regularisation step could be performed due to limits", VS_VISIBLE },
179 {
RET_FEWER_REGSTEPS_NWSR,
"Fewer additional regularisation steps have been performed due to limits", VS_VISIBLE },
181 {
RET_ZERO_HESSIAN_ASSUMED,
"Zero Hessian matrix assumed as null pointer passed without specifying hessianType", VS_VISIBLE },
185 {
RET_FIX_BOUNDS_FOR_LP,
"All initial bounds must be fixed when solving an (unregularised) LP", VS_VISIBLE },
210 {
RET_ENSURELI_DROPPED,
"Linear independence resolved by dropping blocking constraint", VS_VISIBLE },
217 {
RET_SIMPLE_STATUS_P1,
"QP problem could not be solved within given number of iterations", VS_VISIBLE },
219 {
RET_SIMPLE_STATUS_M1,
"QP problem could not be solved due to an internal error", VS_VISIBLE },
220 {
RET_SIMPLE_STATUS_M2,
"QP problem is infeasible (and thus could not be solved)", VS_VISIBLE },
318 #ifndef __SUPPRESSANYOUTPUT__ 348 const char* additionaltext,
349 const char* functionname,
350 const char* filename,
351 const unsigned long linenumber,
361 return throwMessage( Enumber,additionaltext,functionname,filename,linenumber,localVisibilityStatus,
"ERROR" );
371 const char* additionaltext,
372 const char* functionname,
373 const char* filename,
374 const unsigned long linenumber,
384 return throwMessage( Wnumber,additionaltext,functionname,filename,linenumber,localVisibilityStatus,
"WARNING" );
394 const char* additionaltext,
395 const char* functionname,
396 const char* filename,
397 const unsigned long linenumber,
407 return throwMessage( Inumber,additionaltext,functionname,filename,linenumber,localVisibilityStatus,
"INFO" );
434 #ifndef __SUPPRESSANYOUTPUT__ 441 snprintf( myPrintfString,
MAX_STRING_LENGTH,
" %d - %s \n",(
int)keypos,returnValueList[keypos].data );
462 const char* additionaltext,
463 const char* functionname,
464 const char* filename,
465 const unsigned long linenumber,
467 const char* RETstring
470 #ifndef __SUPPRESSANYOUTPUT__ 479 if ( numberOfWhitespaces < 0 )
480 numberOfWhitespaces = 0;
482 if ( numberOfWhitespaces > 40 )
483 numberOfWhitespaces = 40;
488 memset( whitespaces,
' ', (
size_t) numberOfWhitespaces );
489 whitespaces[numberOfWhitespaces] =
'\0';
494 if ( returnValueList[keypos].key == RETnumber )
507 if ( ( returnValueList[keypos].globalVisibilityStatus ==
VS_VISIBLE ) && ( localVisibilityStatus ==
VS_VISIBLE ) )
521 if ( additionaltext == 0 )
525 RETstring,functionname,filename,(
int_t)linenumber,returnValueList[keypos].data
529 RETstring,returnValueList[keypos].data
538 RETstring,functionname,filename,(
int_t)linenumber,returnValueList[keypos].data,additionaltext
542 RETstring,returnValueList[keypos].data,additionaltext
549 if ( RETstring[0] ==
'E' )
573 #ifndef __SUPPRESSANYOUTPUT__ 580 if ( returnValueList[keypos].key == _returnValue )
588 return "Unknown error code";
591 return (returnValueList[keypos].data != 0) ? returnValueList[keypos].
data :
"No message for this error code";
595 return "No message for this error code";
607 #if defined(__DSPACE__) || defined(__XPCTARGET__) 618 #ifndef __XPCTARGET__
VisibilityStatus infoVisibility
returnValue throwError(returnValue Enumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
returnValue throwInfo(returnValue Inumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
Allows to pass back messages to the calling function.
Data structure for entries in global message list.
BEGIN_NAMESPACE_QPOASES FILE * stdFile
void setOutputFile(myFILE *_outputFile)
returnValue throwWarning(returnValue Wnumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
MessageHandling globalMessageHandler(myStderr, VS_VISIBLE, VS_VISIBLE, VS_VISIBLE)
returnValue myPrintf(const char *s)
static const char * getErrorCodeMessage(const returnValue _returnValue)
VisibilityStatus warningVisibility
MessageHandling & operator=(const MessageHandling &rhs)
MessageHandling * getGlobalMessageHandler()
void setInfoVisibilityStatus(VisibilityStatus _infoVisibility)
returnValue setErrorCount(int _errorCount)
Handles all kind of error messages, warnings and other information.
returnValue listAllMessages()
VisibilityStatus errorVisibility
void rhs(const real_t *x, real_t *f)
#define END_NAMESPACE_QPOASES
const uint_t MAX_STRING_LENGTH
void setErrorVisibilityStatus(VisibilityStatus _errorVisibility)
returnValue throwMessage(returnValue RETnumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus, const char *RETstring)
MessageHandling::ReturnValueList returnValueList[]
void setWarningVisibilityStatus(VisibilityStatus _warningVisibility)
#define BEGIN_NAMESPACE_QPOASES