Functions
Utils.cpp File Reference
#include <math.h>
#include <qpOASES/Utils.hpp>
Include dependency graph for external_packages/qpOASES-3.0beta/src/Utils.cpp:

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)

Detailed Description

Author:
Hans Joachim Ferreau, Andreas Potschka, Christian Kirches, Eckhard Arnold
Version:
3.0beta
Date:
2007-2011

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

Definition in file external_packages/qpOASES-3.0beta/src/Utils.cpp.


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.

Returns the current system time.

Returns:
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.

Parameters:
nVNumber of variables.
nCNumber of constraints.
HHessian matrix.
gSequence of gradient vectors.
AConstraint matrix.
lbSequence of lower bound vectors (on variables).
ubSequence of upper bound vectors (on variables).
lbASequence of lower constraints' bound vectors.
ubASequence of upper constraints' bound vectors.
xSequence of primal trial vectors.
ySequence of dual trial vectors.
statMaximum value of stationarity condition residual.
feasMaximum value of primal feasibility violation.
cmplMaximum value of complementarity residual.

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

real_t getNorm ( const real_t *const  v,
int  n 
)

Returns the Euclidean norm of a vector.

Returns:
0: successful
Parameters:
vVector.
nVector'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!).

Returns:
SUCCESSFUL_RETURN
Parameters:
sString 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.

Returns:
SUCCESSFUL_RETURN
Parameters:
vVector to be printed.
nLength 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.

Returns:
SUCCESSFUL_RETURN
Parameters:
vVector to be printed.
nLength of vector.
V_idxPemutation 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.

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  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 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.

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 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.

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 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 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.

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.

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  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 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.

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 *  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 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.

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  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 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.

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.



acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:40:22