#include <qpOASES/MessageHandling.hpp>
#include <qpOASES/Utils.ipp>
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) |
returnValue convertBooleanTypeToString | ( | BooleanType | value, |
char *const | string | ||
) |
Writes a value of BooleanType into a string.
value | Value to be written. |
string | Input: 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.
value | Value to be written. |
string | Input: 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.
value | Value to be written. |
string | Input: String of sufficient size, Output: String containing value. |
Definition at line 638 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
Returns the absolute value of a real number.
x | Real number. |
real_t getCPUtime | ( | ) |
Returns the 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.
nV | Number of variables. |
nC | Number of constraints. |
H | Hessian matrix (may be NULL if Hessian is zero or identity matrix). |
g | Gradient vector. |
A | Constraint matrix. |
lb | Lower bound vector (on variables). |
ub | Upper bound vector (on variables). |
lbA | Lower constraints' bound vector. |
ubA | Upper constraints' bound vector. |
x | Primal trial vector. |
y | Dual trial vector. |
stat | Output: maximum value of stationarity condition residual. |
feas | Output: maximum value of primal feasibility violation. |
cmpl | Output: maximum value of complementarity residual. |
workingSetB | Working set of bounds (used to determine active bounds). |
workingSetC | Working set of constraints (used to determine active constraints). |
hasIdentityHessian | Indicating 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.
nV | Number of variables. |
H | Hessian matrix (may be NULL if Hessian is zero or identity matrix). |
g | Gradient vector. |
lb | Lower bound vector (on variables). |
ub | Upper bound vector (on variables). |
x | Primal trial vector. |
y | Dual trial vector. |
stat | Output: maximum value of stationarity condition residual. |
feas | Output: maximum value of primal feasibility violation. |
cmpl | Output: maximum value of complementarity residual. |
workingSetB | Working set of bounds (used to determine active bounds). |
hasIdentityHessian | Indicating 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.
Returns maximum of two integers.
x | First integer. |
y | Second integer. |
Returns maximum of two reals.
x | First real number. |
y | Second real number. |
Returns minimum of two integers.
x | First integer. |
y | Second integer. |
Returns minimum of two reals.
x | First real number. |
y | Second real number. |
Returns the N-norm of a vector.
v | Vector. |
n | Vector's dimension. |
type | Norm type, 1: one-norm, 2: Euclidean norm. |
Definition at line 603 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.
Returns sign of a real-valued argument.
arg | real-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.
returnvalue | ReturnValue to be analysed. |
doPrintStatus | Flag indicating whether simple status shall be printed to screen. |
Definition at line 912 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.
Returns the square-root of a real number.
x | Non-negative real number. |
|
inline |
Tests whether two real_t-valued arguments are (numerically) equal.
x | First real number. |
y | Second real number. |
TOL | Tolerance for comparison. |
|
inline |
Tests whether a real-valued argument is (numerically) zero.
x | Real number. |
TOL | Tolerance for comparison. |
returnValue myPrintf | ( | const char * | s | ) |
Prints a string to desired output target (useful also for MATLAB output!).
s | String 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.
nV | Number of variables. |
nC | Number of constraints. |
A | Input: Constraint matrix, Output: Normalised constraint matrix. |
lbA | Input: Constraints' lower bound vector, Output: Normalised constraints' lower bound vector. |
ubA | Input: Constraints' upper bound vector, Output: Normalised constraints' upper bound vector. |
type | Norm 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.
Prints a named vector.
v | Vector to be printed. |
n | Length of vector. |
name | Name 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.
v | Vector to be printed. |
n | Length of vector. |
V_idx | Pemutation vector. |
name | Name 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.
Prints a named matrix.
M | Matrix to be printed. |
nrow | Row number of matrix. |
ncol | Column number of matrix. |
name | Name 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.
M | Matrix to be printed. |
nrow | Row number of matrix. |
ncol | Column number of matrix. |
ROW_idx | Row pemutation vector. |
COL_idx | Column pemutation vector. |
name | Name 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.
Prints a named index array.
index | Index array to be printed. |
n | Length of index array. |
name | Name of index array. |
Definition at line 220 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
returnValue printCopyrightNotice | ( | ) |
Prints qpOASES copyright notice.
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.
data | Matrix to be read from file. |
nrow | Row number of matrix. |
ncol | Column number of matrix. |
datafilename | Data 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.
data | Vector to be read from file. |
n | Length of vector. |
datafilename | Data 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.
data | Vector to be read from file. |
n | Length of vector. |
datafilename | Data 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.
data | Matrix to be written into file. |
nrow | Row number of matrix. |
ncol | Column number of matrix. |
datafilename | Data file name. |
append | Indicates 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.
data | Vector to be written into file. |
n | Length of vector. |
datafilename | Data file name. |
append | Indicates 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.
integer | Integer vector to be written into file. |
n | Length of vector. |
datafilename | Data file name. |
append | Indicates 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.
matFile | Pointer to Matlab binary file. |
data | Data to be written into file. |
nRows | Row number of matrix. |
nCols | Column number of matrix. |
name | Matlab 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.
matFile | Pointer to Matlab binary file. |
data | Data to be written into file. |
nRows | Row number of matrix. |
nCols | Column number of matrix. |
name | Matlab name of matrix/vector to be stored. |
Definition at line 559 of file external_packages/qpOASES-3.2.0/src/Utils.cpp.