#include <math.h>
#include <qpOASES/Utils.hpp>
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 | getCPUtime () |
void | getKKTResidual (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) |
real_t | getNorm (const real_t *const v, int n) |
returnValue | myPrintf (const char *s) |
BEGIN_NAMESPACE_QPOASES returnValue | print (const real_t *const v, int n) |
returnValue | print (const real_t *const v, int n, const int *const V_idx) |
returnValue | print (const real_t *const v, int n, const char *name) |
returnValue | print (const real_t *const M, int nrow, int ncol) |
returnValue | print (const real_t *const M, int nrow, int ncol, const int *const ROW_idx, const int *const COL_idx) |
returnValue | print (const real_t *const M, int nrow, int ncol, const char *name) |
returnValue | print (const int *const index, int n) |
returnValue | print (const int *const index, int n, const char *name) |
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 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.
real_t getCPUtime | ( | ) |
Returns the current system time.
Definition at line 505 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
void getKKTResidual | ( | 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 | ||
) |
Computes "residual" of KKT system.
nV | Number of variables. |
nC | Number of constraints. |
H | Hessian matrix. |
g | Sequence of gradient vectors. |
A | Constraint matrix. |
lb | Sequence of lower bound vectors (on variables). |
ub | Sequence of upper bound vectors (on variables). |
lbA | Sequence of lower constraints' bound vectors. |
ubA | Sequence of upper constraints' bound vectors. |
x | Sequence of primal trial vectors. |
y | Sequence of dual trial vectors. |
stat | Maximum value of stationarity condition residual. |
feas | Maximum value of primal feasibility violation. |
cmpl | Maximum value of complementarity residual. |
Definition at line 544 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
Returns the Euclidean norm of a vector.
v | Vector. |
n | Vector's dimension. |
Definition at line 527 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
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.
BEGIN_NAMESPACE_QPOASES returnValue print | ( | const real_t *const | v, |
int | n | ||
) |
Prints a vector.
v | Vector to be printed. |
n | Length of vector. |
Definition at line 58 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
returnValue print | ( | const real_t *const | v, |
int | n, | ||
const int *const | V_idx | ||
) |
Prints a permuted vector.
v | Vector to be printed. |
n | Length of vector. |
V_idx | Pemutation vector. |
Definition at line 83 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
returnValue print | ( | const real_t *const | v, |
int | n, | ||
const char * | name | ||
) |
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 | M, |
int | nrow, | ||
int | ncol | ||
) |
Prints a matrix.
M | Matrix to be printed. |
nrow | Row number of matrix. |
ncol | Column number of matrix. |
Definition at line 131 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
returnValue print | ( | const real_t *const | M, |
int | nrow, | ||
int | ncol, | ||
const int *const | ROW_idx, | ||
const int *const | COL_idx | ||
) |
Prints a 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. |
Definition at line 151 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
returnValue print | ( | const real_t *const | M, |
int | nrow, | ||
int | ncol, | ||
const char * | name | ||
) |
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 int *const | index, |
int | n | ||
) |
Prints an index array.
index | Index array to be printed. |
n | Length of index array. |
Definition at line 195 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
returnValue print | ( | const int *const | index, |
int | n, | ||
const char * | name | ||
) |
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 | 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. |
Definition at line 283 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
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. |
Definition at line 335 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
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. |
Definition at line 347 of file external_packages/qpOASES-3.0beta/src/Utils.cpp.
returnValue writeIntoFile | ( | const real_t *const | data, |
int | nrow, | ||
int | ncol, | ||
const char * | datafilename, | ||
BooleanType | append | ||
) |
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 | n, | ||
const char * | datafilename, | ||
BooleanType | append | ||
) |
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 *const | integer, |
int | n, | ||
const char * | datafilename, | ||
BooleanType | append | ||
) |
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.