Functions
external_packages/qpOASES-3.2.0/include/qpOASES/Utils.hpp File Reference
#include <qpOASES/MessageHandling.hpp>
#include <qpOASES/Utils.ipp>
Include dependency graph for external_packages/qpOASES-3.2.0/include/qpOASES/Utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

returnValue convertBooleanTypeToString (BooleanType value, char *const string)
 
returnValue convertPrintLevelToString (PrintLevel value, char *const string)
 
returnValue convertSubjectToStatusToString (SubjectToStatus value, char *const string)
 
real_t getAbs (real_t x)
 
real_t getCPUtime ()
 
returnValue getKktViolation (int_t nV, int_t 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 &stat, real_t &feas, real_t &cmpl, const real_t *const workingSetB=0, const real_t *const workingSetC=0, BooleanType hasIdentityHessian=BT_FALSE)
 
returnValue getKktViolation (int_t 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 &stat, real_t &feas, real_t &cmpl, const real_t *const workingSetB=0, BooleanType hasIdentityHessian=BT_FALSE)
 
int_t getMax (int_t x, int_t y)
 
real_t getMax (real_t x, real_t y)
 
int_t getMin (int_t x, int_t y)
 
real_t getMin (real_t x, real_t y)
 
real_t getNorm (const real_t *const v, int_t n, int_t type=2)
 
real_t getSign (real_t arg)
 
int_t getSimpleStatus (returnValue returnvalue, BooleanType doPrintStatus=BT_FALSE)
 
real_t getSqrt (real_t x)
 
BooleanType isEqual (real_t x, real_t y, real_t TOL=ZERO)
 
BooleanType isZero (real_t x, real_t TOL=ZERO)
 
returnValue myPrintf (const char *s)
 
returnValue normaliseConstraints (int_t nV, int_t nC, real_t *A, real_t *lbA, real_t *ubA, int_t type=1)
 
BEGIN_NAMESPACE_QPOASES returnValue print (const real_t *const v, int_t n, const char *name=0)
 
returnValue print (const real_t *const v, int_t n, const int_t *const V_idx, const char *name=0)
 
returnValue print (const real_t *const M, int_t nrow, int_t ncol, const char *name=0)
 
returnValue print (const real_t *const M, int_t nrow, int_t ncol, const int_t *const ROW_idx, const int_t *const COL_idx, const char *name=0)
 
returnValue print (const int_t *const index, int_t n, const char *name=0)
 
returnValue printCopyrightNotice ()
 
returnValue readFromFile (real_t *data, int_t nrow, int_t ncol, const char *datafilename)
 
returnValue readFromFile (real_t *data, int_t n, const char *datafilename)
 
returnValue readFromFile (int_t *data, int_t n, const char *datafilename)
 
returnValue writeIntoFile (const real_t *const data, int_t nrow, int_t ncol, const char *datafilename, BooleanType append=BT_FALSE)
 
returnValue writeIntoFile (const real_t *const data, int_t n, const char *datafilename, BooleanType append=BT_FALSE)
 
returnValue writeIntoFile (const int_t *const integer, int_t n, const char *datafilename, BooleanType append=BT_FALSE)
 
returnValue writeIntoMatFile (FILE *const matFile, const real_t *const data, int_t nRows, int_t nCols, const char *name)
 
returnValue writeIntoMatFile (FILE *const matFile, const int_t *const data, int_t nRows, int_t nCols, const char *name)
 

Function Documentation

returnValue 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 627 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue 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 663 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue 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 638 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

real_t getAbs ( real_t  x)
inline

Returns the absolute value of a real number.

Returns
Absolute value of a real number
Parameters
xReal number.
real_t getCPUtime ( )

Returns the current system time.

Returns
current system time

Definition at line 433 of file examples/code_generation/mpc_mhe/getting_started_export/qpoases/SRC/Utils.cpp.

returnValue getKktViolation ( int_t  nV,
int_t  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 stat,
real_t feas,
real_t cmpl,
const real_t *const  workingSetB = 0,
const real_t *const  workingSetC = 0,
BooleanType  hasIdentityHessian = BT_FALSE 
)

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.
workingSetBWorking set of bounds (used to determine active bounds).
workingSetCWorking set of constraints (used to determine active constraints).
hasIdentityHessianIndicating whether Hessian matrix is identity matrix or not if NULL pointer is passed.

Definition at line 631 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.

returnValue getKktViolation ( int_t  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 stat,
real_t feas,
real_t cmpl,
const real_t *const  workingSetB = 0,
BooleanType  hasIdentityHessian = BT_FALSE 
)

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.
workingSetBWorking set of bounds (used to determine active bounds).
hasIdentityHessianIndicating whether Hessian matrix is identity matrix or not if NULL pointer is passed

Definition at line 792 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.

int_t getMax ( int_t  x,
int_t  y 
)
inline

Returns maximum of two integers.

Returns
Maximum of two integers
Parameters
xFirst integer.
ySecond integer.
real_t getMax ( real_t  x,
real_t  y 
)
inline

Returns maximum of two reals.

Returns
Maximum of two reals
Parameters
xFirst real number.
ySecond real number.
int_t getMin ( int_t  x,
int_t  y 
)
inline

Returns minimum of two integers.

Returns
Minimum of two integers
Parameters
xFirst integer.
ySecond integer.
real_t getMin ( real_t  x,
real_t  y 
)
inline

Returns minimum of two reals.

Returns
Minimum of two reals
Parameters
xFirst real number.
ySecond real number.
real_t getNorm ( const real_t *const  v,
int_t  n,
int_t  type = 2 
)

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 603 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.

real_t getSign ( real_t  arg)
inline

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.
int_t getSimpleStatus ( returnValue  returnvalue,
BooleanType  doPrintStatus = BT_FALSE 
)

Converts a returnValue from an (S)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 912 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.

real_t getSqrt ( real_t  x)
inline

Returns the square-root of a real number.

Returns
Square-root of a real number
Parameters
xNon-negative real number.
BooleanType isEqual ( real_t  x,
real_t  y,
real_t  TOL = ZERO 
)
inline

Tests whether two real_t-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.
BooleanType isZero ( real_t  x,
real_t  TOL = ZERO 
)
inline

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.
returnValue 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 242 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue normaliseConstraints ( int_t  nV,
int_t  nC,
real_t A,
real_t lbA,
real_t ubA,
int_t  type = 1 
)

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.

Definition at line 963 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.

BEGIN_NAMESPACE_QPOASES returnValue print ( const real_t *const  v,
int_t  n,
const char *  name = 0 
)

Prints a (possibly named) vector.

Returns
SUCCESSFUL_RETURN

Prints a named vector.

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

Definition at line 110 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue print ( const real_t *const  v,
int_t  n,
const int_t *const  V_idx,
const char *  name = 0 
)

Prints a (possibly named) permuted vector.

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

Definition at line 107 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.

returnValue print ( const real_t *const  M,
int_t  nrow,
int_t  ncol,
const char *  name = 0 
)

Prints a (possibly named) matrix.

Returns
SUCCESSFUL_RETURN

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 173 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue print ( const real_t *const  M,
int_t  nrow,
int_t  ncol,
const int_t *const  ROW_idx,
const int_t *const  COL_idx,
const char *  name = 0 
)

Prints a (possibly named) 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.
nameName of matrix.

Definition at line 166 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.

returnValue print ( const int_t *const  index,
int_t  n,
const char *  name = 0 
)

Prints a (possibly named) index array.

Returns
SUCCESSFUL_RETURN

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 220 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue printCopyrightNotice ( )

Prints qpOASES copyright notice.

Returns
SUCCESSFUL_RETURN

Definition at line 265 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue readFromFile ( real_t data,
int_t  nrow,
int_t  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 283 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue readFromFile ( real_t data,
int_t  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 335 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue readFromFile ( int_t data,
int_t  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 347 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue writeIntoFile ( const real_t *const  data,
int_t  nrow,
int_t  ncol,
const char *  datafilename,
BooleanType  append = BT_FALSE 
)

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 390 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue writeIntoFile ( const real_t *const  data,
int_t  n,
const char *  datafilename,
BooleanType  append = BT_FALSE 
)

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 444 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue writeIntoFile ( const int_t *const  integer,
int_t  n,
const char *  datafilename,
BooleanType  append = BT_FALSE 
)

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 455 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.

returnValue writeIntoMatFile ( FILE *const  matFile,
const real_t *const  data,
int_t  nRows,
int_t  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 507 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.

returnValue writeIntoMatFile ( FILE *const  matFile,
const int_t *const  data,
int_t  nRows,
int_t  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 559 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.



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