Functions
Utils.h File Reference
#include <qpOASES_e/MessageHandling.h>
Include dependency graph for Utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

returnValue qpOASES_convertBooleanTypeToString (BooleanType value, char *const string)
 
returnValue qpOASES_convertPrintLevelToString (PrintLevel value, char *const string)
 
returnValue qpOASES_convertSubjectToStatusToString (SubjectToStatus value, char *const string)
 
static real_t qpOASES_getAbs (real_t x)
 
real_t qpOASES_getCPUtime ()
 
returnValue qpOASES_getKktViolation (int nV, int nC, const real_t *const H, const real_t *const g, const real_t *const A, const real_t *const lb, const real_t *const ub, const real_t *const lbA, const real_t *const ubA, const real_t *const x, const real_t *const y, real_t *const _stat, real_t *const feas, real_t *const cmpl)
 
returnValue qpOASES_getKktViolationSB (int nV, const real_t *const H, const real_t *const g, const real_t *const lb, const real_t *const ub, const real_t *const x, const real_t *const y, real_t *const _stat, real_t *const feas, real_t *const cmpl)
 
static real_t qpOASES_getMax (real_t x, real_t y)
 
static int qpOASES_getMaxI (int x, int y)
 
static real_t qpOASES_getMin (real_t x, real_t y)
 
static int qpOASES_getMinI (int x, int y)
 
real_t qpOASES_getNorm (const real_t *const v, int n, int type)
 
static real_t qpOASES_getSign (real_t arg)
 
int qpOASES_getSimpleStatus (returnValue returnvalue, BooleanType doPrintStatus)
 
static real_t qpOASES_getSqrt (real_t x)
 
static BooleanType qpOASES_isEqual (real_t x, real_t y, real_t TOL)
 
static BooleanType qpOASES_isZero (real_t x, real_t TOL)
 
returnValue qpOASES_myPrintf (const char *s)
 
returnValue qpOASES_normaliseConstraints (int nV, int nC, real_t *A, real_t *lbA, real_t *ubA, int type)
 
returnValue qpOASES_printCopyrightNotice ()
 
returnValue qpOASES_printI (const int *const _index, int n)
 
returnValue qpOASES_printM (const real_t *const M, int nrow, int ncol)
 
returnValue qpOASES_printNI (const int *const _index, int n, const char *name)
 
returnValue qpOASES_printNM (const real_t *const M, int nrow, int ncol, const char *name)
 
returnValue qpOASES_printNV (const real_t *const v, int n, const char *name)
 
returnValue qpOASES_printPM (const real_t *const M, int nrow, int ncol, const int *const ROW_idx, const int *const COL_idx)
 
returnValue qpOASES_printPV (const real_t *const v, int n, const int *const V_idx)
 
BEGIN_NAMESPACE_QPOASES returnValue qpOASES_printV (const real_t *const v, int n)
 
returnValue qpOASES_readFromFileI (int *data, int n, const char *datafilename)
 
returnValue qpOASES_readFromFileM (real_t *data, int nrow, int ncol, const char *datafilename)
 
returnValue qpOASES_readFromFileV (real_t *data, int n, const char *datafilename)
 
returnValue qpOASES_writeIntoFileI (const int *const integer, int n, const char *datafilename, BooleanType append)
 
returnValue qpOASES_writeIntoFileM (const real_t *const data, int nrow, int ncol, const char *datafilename, BooleanType append)
 
returnValue qpOASES_writeIntoFileV (const real_t *const data, int n, const char *datafilename, BooleanType append)
 
returnValue qpOASES_writeIntoMatFile (FILE *const matFile, const real_t *const data, int nRows, int nCols, const char *name)
 
returnValue qpOASES_writeIntoMatFileI (FILE *const matFile, const int *const data, int nRows, int nCols, const char *name)
 

Detailed Description

Author
Hans Joachim Ferreau, Andreas Potschka, Christian Kirches
Version
3.1embedded
Date
2007-2015

Declaration of some utilities for working with the different QProblem classes.

Definition in file Utils.h.

Function Documentation

returnValue qpOASES_convertBooleanTypeToString ( BooleanType  value,
char *const  string 
)

Writes a value of BooleanType into a string.

Returns
SUCCESSFUL_RETURN
Parameters
valueValue to be written.
stringInput: String of sufficient size,
Output: String containing value.

Definition at line 782 of file Utils.c.

returnValue qpOASES_convertPrintLevelToString ( PrintLevel  value,
char *const  string 
)

Writes a value of PrintLevel into a string.

Returns
SUCCESSFUL_RETURN
Parameters
valueValue to be written.
stringInput: String of sufficient size,
Output: String containing value.

Definition at line 840 of file Utils.c.

returnValue qpOASES_convertSubjectToStatusToString ( SubjectToStatus  value,
char *const  string 
)

Writes a value of SubjectToStatus into a string.

Returns
SUCCESSFUL_RETURN
Parameters
valueValue to be written.
stringInput: String of sufficient size,
Output: String containing value.

Definition at line 798 of file Utils.c.

static real_t qpOASES_getAbs ( real_t  x)
inlinestatic

Returns the absolute value of a real_t-valued argument.

Returns
Absolute value of a real_t-valued argument
Parameters
xreal_t-valued argument.

Definition at line 468 of file Utils.h.

real_t qpOASES_getCPUtime ( )

Returns the current system time.

Returns
current system time

Definition at line 606 of file Utils.c.

returnValue qpOASES_getKktViolation ( int  nV,
int  nC,
const real_t *const  H,
const real_t *const  g,
const real_t *const  A,
const real_t *const  lb,
const real_t *const  ub,
const real_t *const  lbA,
const real_t *const  ubA,
const real_t *const  x,
const real_t *const  y,
real_t *const  _stat,
real_t *const  feas,
real_t *const  cmpl 
)

Computes the maximum violation of the KKT optimality conditions of given iterate for given QP data.

Parameters
nVNumber of variables.
nCNumber of constraints.
HHessian matrix (may be NULL if Hessian is zero or identity matrix).
gGradient vector.
AConstraint matrix.
lbLower bound vector (on variables).
ubUpper bound vector (on variables).
lbALower constraints' bound vector.
ubAUpper constraints' bound vector.
xPrimal trial vector.
yDual trial vector.
_statOutput: maximum value of stationarity condition residual.
feasOutput: maximum value of primal feasibility violation.
cmplOutput: maximum value of complementarity residual.

Definition at line 658 of file Utils.c.

returnValue qpOASES_getKktViolationSB ( int  nV,
const real_t *const  H,
const real_t *const  g,
const real_t *const  lb,
const real_t *const  ub,
const real_t *const  x,
const real_t *const  y,
real_t *const  _stat,
real_t *const  feas,
real_t *const  cmpl 
)

Computes the maximum violation of the KKT optimality conditions of given iterate for given QP data.

Parameters
nVNumber of variables.
HHessian matrix (may be NULL if Hessian is zero or identity matrix).
gGradient vector.
lbLower bound vector (on variables).
ubUpper bound vector (on variables).
xPrimal trial vector.
yDual trial vector.
_statOutput: maximum value of stationarity condition residual.
feasOutput: maximum value of primal feasibility violation.
cmplOutput: maximum value of complementarity residual.

Definition at line 764 of file Utils.c.

static real_t qpOASES_getMax ( real_t  x,
real_t  y 
)
inlinestatic

Returns maximum of two reals.

Returns
Maximum of two reals
Parameters
xFirst real number.
ySecond real number.

Definition at line 436 of file Utils.h.

static int qpOASES_getMaxI ( int  x,
int  y 
)
inlinestatic

Returns maximum of two integers.

Returns
Maximum of two integers
Parameters
xFirst integer.
ySecond integer.

Definition at line 414 of file Utils.h.

static real_t qpOASES_getMin ( real_t  x,
real_t  y 
)
inlinestatic

Returns minimum of two reals.

Returns
Minimum of two reals
Parameters
xFirst real number.
ySecond real number.

Definition at line 452 of file Utils.h.

static int qpOASES_getMinI ( int  x,
int  y 
)
inlinestatic

Returns minimum of two integers.

Returns
Minimum of two integers
Parameters
xFirst integer.
ySecond integer.

Definition at line 425 of file Utils.h.

real_t qpOASES_getNorm ( const real_t *const  v,
int  n,
int  type 
)

Returns the N-norm of a vector.

Returns
>= 0.0: successful
Parameters
vVector.
nVector's dimension.
typeNorm type, 1: one-norm, 2: Euclidean norm.

Definition at line 629 of file Utils.c.

static real_t qpOASES_getSign ( real_t  arg)
inlinestatic

Returns sign of a real-valued argument.

Returns
1.0: argument is non-negative
-1.0: argument is negative
Parameters
argreal-valued argument whose sign is to be determined.

Definition at line 400 of file Utils.h.

int qpOASES_getSimpleStatus ( returnValue  returnvalue,
BooleanType  doPrintStatus 
)

Converts a returnValue from an QProblem(B) object into a more simple status flag.

Returns
0: QP problem solved 1: QP could not be solved within given number of iterations -1: QP could not be solved due to an internal error -2: QP is infeasible (and thus could not be solved) -3: QP is unbounded (and thus could not be solved)
Parameters
returnvalueReturnValue to be analysed.
doPrintStatusFlag indicating whether simple status shall be printed to screen.

Definition at line 882 of file Utils.c.

static real_t qpOASES_getSqrt ( real_t  x)
inlinestatic

Returns the square-root of a real number.

Returns
Square-root of a real number
Parameters
xNon-negative real number.

Definition at line 481 of file Utils.h.

static BooleanType qpOASES_isEqual ( real_t  x,
real_t  y,
real_t  TOL 
)
inlinestatic

Tests whether two real-valued arguments are (numerically) equal.

Returns
BT_TRUE: arguments differ not more than TOL
BT_FALSE: arguments differ more than TOL
Parameters
xFirst real number.
ySecond real number.
TOLTolerance for comparison.

Definition at line 371 of file Utils.h.

static BooleanType qpOASES_isZero ( real_t  x,
real_t  TOL 
)
inlinestatic

Tests whether a real-valued argument is (numerically) zero.

Returns
BT_TRUE: argument differs from 0.0 not more than TOL
BT_FALSE: argument differs from 0.0 more than TOL
Parameters
xReal number.
TOLTolerance for comparison.

Definition at line 386 of file Utils.h.

returnValue qpOASES_myPrintf ( const char *  s)

Prints a string to desired output target (useful also for MATLAB output!).

Returns
SUCCESSFUL_RETURN
Parameters
sString to be written.

Definition at line 269 of file Utils.c.

returnValue qpOASES_normaliseConstraints ( int  nV,
int  nC,
real_t A,
real_t lbA,
real_t ubA,
int  type 
)

Normalises QP constraints.

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS
Parameters
nVNumber of variables.
nCNumber of constraints.
AInput: Constraint matrix,
Output: Normalised constraint matrix.
lbAInput: Constraints' lower bound vector,
Output: Normalised constraints' lower bound vector.
ubAInput: Constraints' upper bound vector,
Output: Normalised constraints' upper bound vector.
typeNorm type, 1: one-norm, 2: Euclidean norm.
returnValue qpOASES_printCopyrightNotice ( )

Prints qpOASES copyright notice.

Returns
SUCCESSFUL_RETURN

Definition at line 296 of file Utils.c.

returnValue qpOASES_printI ( const int *const  _index,
int  n 
)

Prints an index array.

Returns
SUCCESSFUL_RETURN
Parameters
_indexIndex array to be printed.
nLength of index array.

Definition at line 217 of file Utils.c.

returnValue qpOASES_printM ( const real_t *const  M,
int  nrow,
int  ncol 
)

Prints a matrix.

Returns
SUCCESSFUL_RETURN
Parameters
MMatrix to be printed.
nrowRow number of matrix.
ncolColumn number of matrix.

Definition at line 147 of file Utils.c.

returnValue qpOASES_printNI ( const int *const  _index,
int  n,
const char *  name 
)

Prints a named index array.

Returns
SUCCESSFUL_RETURN
Parameters
_indexIndex array to be printed.
nLength of index array.
nameName of index array.

Definition at line 244 of file Utils.c.

returnValue qpOASES_printNM ( const real_t *const  M,
int  nrow,
int  ncol,
const char *  name 
)

Prints a named matrix.

Returns
SUCCESSFUL_RETURN
Parameters
MMatrix to be printed.
nrowRow number of matrix.
ncolColumn number of matrix.
nameName of matrix.

Definition at line 192 of file Utils.c.

returnValue qpOASES_printNV ( const real_t *const  v,
int  n,
const char *  name 
)

Prints a named vector.

Returns
SUCCESSFUL_RETURN
Parameters
vVector to be printed.
nLength of vector.
nameName of vector.

Definition at line 123 of file Utils.c.

returnValue qpOASES_printPM ( const real_t *const  M,
int  nrow,
int  ncol,
const int *const  ROW_idx,
const int *const  COL_idx 
)

Prints a permuted matrix.

Returns
SUCCESSFUL_RETURN
Parameters
MMatrix to be printed.
nrowRow number of matrix.
ncolColumn number of matrix.
ROW_idxRow pemutation vector.
COL_idxColumn pemutation vector.

Definition at line 170 of file Utils.c.

returnValue qpOASES_printPV ( const real_t *const  v,
int  n,
const int *const  V_idx 
)

Prints a permuted vector.

Returns
SUCCESSFUL_RETURN
Parameters
vVector to be printed.
nLength of vector.
V_idxPemutation vector.

Definition at line 96 of file Utils.c.

BEGIN_NAMESPACE_QPOASES returnValue qpOASES_printV ( const real_t *const  v,
int  n 
)

Prints a vector.

Returns
SUCCESSFUL_RETURN
Parameters
vVector to be printed.
nLength of vector.

Definition at line 70 of file Utils.c.

returnValue qpOASES_readFromFileI ( int *  data,
int  n,
const char *  datafilename 
)

Reads an integer (column) vector from file.

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_OPEN_FILE
RET_UNABLE_TO_READ_FILE
Parameters
dataVector to be read from file.
nLength of vector.
datafilenameData file name.

Definition at line 379 of file Utils.c.

returnValue qpOASES_readFromFileM ( real_t data,
int  nrow,
int  ncol,
const char *  datafilename 
)

Reads a real_t matrix from file.

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_OPEN_FILE
RET_UNABLE_TO_READ_FILE
Parameters
dataMatrix to be read from file.
nrowRow number of matrix.
ncolColumn number of matrix.
datafilenameData file name.

Definition at line 314 of file Utils.c.

returnValue qpOASES_readFromFileV ( real_t data,
int  n,
const char *  datafilename 
)

Reads a real_t vector from file.

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_OPEN_FILE
RET_UNABLE_TO_READ_FILE
Parameters
dataVector to be read from file.
nLength of vector.
datafilenameData file name.

Definition at line 367 of file Utils.c.

returnValue qpOASES_writeIntoFileI ( const int *const  integer,
int  n,
const char *  datafilename,
BooleanType  append 
)

Writes an integer (column) vector into a file.

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_OPEN_FILE
Parameters
integerInteger vector to be written into file.
nLength of vector.
datafilenameData file name.
appendIndicates if integer shall be appended if the file already exists (otherwise it is overwritten).

Definition at line 489 of file Utils.c.

returnValue qpOASES_writeIntoFileM ( const real_t *const  data,
int  nrow,
int  ncol,
const char *  datafilename,
BooleanType  append 
)

Writes a real_t matrix into a file.

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_OPEN_FILE
Parameters
dataMatrix to be written into file.
nrowRow number of matrix.
ncolColumn number of matrix.
datafilenameData file name.
appendIndicates if data shall be appended if the file already exists (otherwise it is overwritten).

Definition at line 423 of file Utils.c.

returnValue qpOASES_writeIntoFileV ( const real_t *const  data,
int  n,
const char *  datafilename,
BooleanType  append 
)

Writes a real_t vector into a file.

Returns
SUCCESSFUL_RETURN
RET_UNABLE_TO_OPEN_FILE
Parameters
dataVector to be written into file.
nLength of vector.
datafilenameData file name.
appendIndicates if data shall be appended if the file already exists (otherwise it is overwritten).

Definition at line 478 of file Utils.c.

returnValue qpOASES_writeIntoMatFile ( FILE *const  matFile,
const real_t *const  data,
int  nRows,
int  nCols,
const char *  name 
)

Writes a real_t matrix/vector into a Matlab binary file.

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS RET_UNABLE_TO_WRITE_FILE
Parameters
matFilePointer to Matlab binary file.
dataData to be written into file.
nRowsRow number of matrix.
nColsColumn number of matrix.
nameMatlab name of matrix/vector to be stored.

Definition at line 540 of file Utils.c.

returnValue qpOASES_writeIntoMatFileI ( FILE *const  matFile,
const int *const  data,
int  nRows,
int  nCols,
const char *  name 
)

Writes in integer matrix/vector into a Matlab binary file.

Returns
SUCCESSFUL_RETURN
RET_INVALID_ARGUMENTS RET_UNABLE_TO_WRITE_FILE
Parameters
matFilePointer to Matlab binary file.
dataData to be written into file.
nRowsRow number of matrix.
nColsColumn number of matrix.
nameMatlab name of matrix/vector to be stored.

Definition at line 587 of file Utils.c.



acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:22