qpOASES
3.1.1
|
Functions | |
BEGIN_NAMESPACE_QPOASES returnValue | print (const real_t *const v, int n, const char *name) |
returnValue | print (const real_t *const v, int n, const int *const V_idx, const char *name) |
returnValue | print (const real_t *const M, int nrow, int ncol, const char *name) |
returnValue | print (const real_t *const M, int nrow, int ncol, const int *const ROW_idx, const int *const COL_idx, const char *name) |
returnValue | print (const int *const index, int n, const char *name) |
returnValue | myPrintf (const char *s) |
returnValue | printCopyrightNotice () |
returnValue | readFromFile (real_t *data, int nrow, int ncol, const char *datafilename) |
returnValue | readFromFile (real_t *data, int n, const char *datafilename) |
returnValue | readFromFile (int *data, int n, const char *datafilename) |
returnValue | writeIntoFile (const real_t *const data, int nrow, int ncol, const char *datafilename, BooleanType append) |
returnValue | writeIntoFile (const real_t *const data, int n, const char *datafilename, BooleanType append) |
returnValue | writeIntoFile (const int *const integer, int n, const char *datafilename, BooleanType append) |
returnValue | writeIntoMatFile (FILE *const matFile, const real_t *const data, int nRows, int nCols, const char *name) |
returnValue | writeIntoMatFile (FILE *const matFile, const int *const data, int nRows, int nCols, const char *name) |
real_t | getCPUtime () |
real_t | getNorm (const real_t *const v, int n, int type) |
returnValue | 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 &stat, real_t &feas, real_t &cmpl, const real_t *const workingSetB, const real_t *const workingSetC, BooleanType hasIdentityHessian) |
returnValue | getKktViolation (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 &stat, real_t &feas, real_t &cmpl, const real_t *const workingSetB, BooleanType hasIdentityHessian) |
returnValue | convertBooleanTypeToString (BooleanType value, char *const string) |
returnValue | convertSubjectToStatusToString (SubjectToStatus value, char *const string) |
returnValue | convertPrintLevelToString (PrintLevel value, char *const string) |
int | getSimpleStatus (returnValue returnvalue, BooleanType doPrintStatus) |
returnValue | normaliseConstraints (int nV, int nC, real_t *A, real_t *lbA, real_t *ubA, int type) |
Implementation of some utility functions for working with qpOASES.
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. |
References BT_FALSE, and SUCCESSFUL_RETURN.
Referenced by Options::print().
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. |
References PL_DEBUG_ITER, PL_HIGH, PL_LOW, PL_MEDIUM, PL_NONE, PL_TABULAR, and SUCCESSFUL_RETURN.
Referenced by Options::print().
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. |
References ST_INACTIVE, ST_INFEASIBLE_LOWER, ST_INFEASIBLE_UPPER, ST_LOWER, ST_UNDEFINED, ST_UPPER, and SUCCESSFUL_RETURN.
Referenced by Options::print().
real_t getCPUtime | ( | ) |
Returns the current system time.
References real_t.
Referenced by SQProblem::hotstart(), QProblemB::hotstart(), QProblem::hotstart(), QProblemB::isCPUtimeLimitExceeded(), main(), QProblem::solveInitialQP(), QProblemB::solveInitialQP(), QProblem::solveQP(), and QProblemB::solveQP().
returnValue 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 & | 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. |
References BT_TRUE, EPS, getAbs(), isEqual(), real_t, and SUCCESSFUL_RETURN.
Referenced by getKktViolation(), and solveOQPbenchmark().
returnValue getKktViolation | ( | 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 & | 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 |
References getKktViolation().
Returns the N-norm of a vector.
v | Vector. |
n | Vector's dimension. |
type | Norm type, 1: one-norm, 2: Euclidean norm. |
References getAbs(), getSqrt(), INFTY, real_t, RET_INVALID_ARGUMENTS, and THROWERROR.
Referenced by normaliseConstraints(), and QProblemB::regulariseHessian().
int 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. |
References BT_TRUE, getGlobalMessageHandler(), MessageHandling::getInfoVisibilityStatus(), RET_HOTSTART_STOPPED_INFEASIBILITY, RET_HOTSTART_STOPPED_UNBOUNDEDNESS, RET_INIT_FAILED_INFEASIBILITY, RET_INIT_FAILED_UNBOUNDEDNESS, RET_MAX_NWSR_REACHED, RET_SIMPLE_STATUS_P0, MessageHandling::setErrorCount(), MessageHandling::setInfoVisibilityStatus(), SUCCESSFUL_RETURN, THROWINFO, and VS_VISIBLE.
returnValue myPrintf | ( | const char * | s | ) |
Prints a string to desired output target (useful also for MATLAB output!).
s | String to be written. |
References getGlobalMessageHandler(), MessageHandling::getOutputFile(), RET_INVALID_ARGUMENTS, RET_NO_GLOBAL_MESSAGE_OUTPUTFILE, SUCCESSFUL_RETURN, and THROWERROR.
Referenced by MessageHandling::listAllMessages(), main(), print(), Options::print(), Constraints::print(), Bounds::print(), printCopyrightNotice(), QProblem::printIteration(), QProblemB::printIteration(), QProblem::printProperties(), QProblemB::printProperties(), and MessageHandling::throwMessage().
returnValue normaliseConstraints | ( | int | nV, |
int | nC, | ||
real_t * | A, | ||
real_t * | lbA, | ||
real_t * | ubA, | ||
int | 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. |
References EPS, getNorm(), getSqrt(), INFTY, real_t, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, and THROWERROR.
BEGIN_NAMESPACE_QPOASES returnValue print | ( | const real_t *const | v, |
int | n, | ||
const char * | name = 0 |
||
) |
Prints a (possibly named) vector.
v | Vector to be printed. |
n | Length of vector. |
name | Name of vector. |
References MAX_STRING_LENGTH, myPrintf(), and SUCCESSFUL_RETURN.
Referenced by print().
returnValue print | ( | const real_t *const | v, |
int | n, | ||
const int *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. |
References MAX_STRING_LENGTH, myPrintf(), and SUCCESSFUL_RETURN.
returnValue print | ( | const real_t *const | M, |
int | nrow, | ||
int | ncol, | ||
const char * | name = 0 |
||
) |
Prints a (possibly named) matrix.
M | Matrix to be printed. |
nrow | Row number of matrix. |
ncol | Column number of matrix. |
name | Name of matrix. |
References MAX_STRING_LENGTH, myPrintf(), print(), and SUCCESSFUL_RETURN.
returnValue print | ( | const real_t *const | M, |
int | nrow, | ||
int | ncol, | ||
const int *const | ROW_idx, | ||
const int *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. |
References MAX_STRING_LENGTH, myPrintf(), print(), and SUCCESSFUL_RETURN.
returnValue print | ( | const int *const | index, |
int | n, | ||
const char * | name = 0 |
||
) |
Prints a (possibly named) index array.
index | Index array to be printed. |
n | Length of index array. |
name | Name of index array. |
References MAX_STRING_LENGTH, myPrintf(), and SUCCESSFUL_RETURN.
Prints qpOASES copyright notice.
References myPrintf(), and SUCCESSFUL_RETURN.
Referenced by QProblemB::QProblemB().
returnValue readFromFile | ( | real_t * | data, |
int | nrow, | ||
int | 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. |
References __FILE__, __FUNC__, __LINE__, getGlobalMessageHandler(), MAX_STRING_LENGTH, real_t, RET_NOT_YET_IMPLEMENTED, RET_UNABLE_TO_OPEN_FILE, RET_UNABLE_TO_READ_FILE, SUCCESSFUL_RETURN, MessageHandling::throwError(), and VS_VISIBLE.
Referenced by SQProblem::hotstart(), QProblemB::init(), QProblem::init(), QProblemB::loadQPvectorsFromFile(), QProblem::loadQPvectorsFromFile(), readFromFile(), readOQPdata(), readOQPdimensions(), QProblemB::setupQPdataFromFile(), and QProblem::setupQPdataFromFile().
returnValue readFromFile | ( | real_t * | data, |
int | 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. |
References readFromFile().
returnValue readFromFile | ( | int * | data, |
int | 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. |
References __FILE__, __FUNC__, __LINE__, getGlobalMessageHandler(), MAX_STRING_LENGTH, RET_NOT_YET_IMPLEMENTED, RET_UNABLE_TO_OPEN_FILE, RET_UNABLE_TO_READ_FILE, SUCCESSFUL_RETURN, MessageHandling::throwError(), and VS_VISIBLE.
returnValue writeIntoFile | ( | const real_t *const | data, |
int | nrow, | ||
int | 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). |
References __FILE__, __FUNC__, __LINE__, BT_TRUE, getGlobalMessageHandler(), MAX_STRING_LENGTH, RET_NOT_YET_IMPLEMENTED, RET_UNABLE_TO_OPEN_FILE, SUCCESSFUL_RETURN, MessageHandling::throwError(), and VS_VISIBLE.
Referenced by writeIntoFile().
returnValue writeIntoFile | ( | const real_t *const | data, |
int | 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). |
References writeIntoFile().
returnValue writeIntoFile | ( | const int *const | integer, |
int | 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). |
References __FILE__, __FUNC__, __LINE__, BT_TRUE, getGlobalMessageHandler(), MAX_STRING_LENGTH, RET_NOT_YET_IMPLEMENTED, RET_UNABLE_TO_OPEN_FILE, SUCCESSFUL_RETURN, MessageHandling::throwError(), and VS_VISIBLE.
returnValue 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.
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. |
References MatMatrixHeader::imaginaryPart, MatMatrixHeader::nCharName, MatMatrixHeader::nCols, MatMatrixHeader::nRows, MatMatrixHeader::numericFormat, real_t, RET_INVALID_ARGUMENTS, RET_NOT_YET_IMPLEMENTED, RET_UNABLE_TO_WRITE_FILE, and SUCCESSFUL_RETURN.
Referenced by writeIntoMatFile(), QProblem::writeQpDataIntoMatFile(), and QProblem::writeQpWorkspaceIntoMatFile().
returnValue writeIntoMatFile | ( | FILE *const | matFile, |
const int *const | data, | ||
int | nRows, | ||
int | 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. |
References real_t, and writeIntoMatFile().