qpOASES 3.2.1
An Implementation of the Online Active Set Strategy
Functions
Utils.ipp File Reference
#include <math.h>

Functions

BEGIN_NAMESPACE_QPOASES BooleanType isEqual (real_t x, real_t y, real_t TOL)
 
BooleanType isZero (real_t x, real_t TOL)
 
real_t getSign (real_t arg)
 
int_t getMax (int_t x, int_t y)
 
int_t getMin (int_t x, int_t y)
 
real_t getMax (real_t x, real_t y)
 
real_t getMin (real_t x, real_t y)
 
real_t getAbs (real_t x)
 
real_t getSqrt (real_t x)
 

Detailed Description

Author
Hans Joachim Ferreau, Andreas Potschka, Christian Kirches
Version
3.2
Date
2007-2017

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

Function Documentation

◆ getAbs()

real_t getAbs ( real_t  x)
inline

◆ getMax() [1/2]

int_t getMax ( int_t  x,
int_t  y 
)
inline

◆ getMax() [2/2]

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.

◆ getMin() [1/2]

int_t getMin ( int_t  x,
int_t  y 
)
inline

◆ getMin() [2/2]

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.

◆ getSign()

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.

◆ getSqrt()

real_t getSqrt ( real_t  x)
inline

◆ isEqual()

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

References BT_FALSE, BT_TRUE, and getAbs().

Referenced by SQProblemSchur::computeMTimes(), SQProblemSchur::computeMTransTimes(), dgemm_(), DenseMatrix::getCol(), SparseMatrix::getCol(), SparseMatrixRow::getCol(), getKktViolation(), DenseMatrix::getRow(), SparseMatrix::getRow(), SparseMatrixRow::getRow(), sgemm_(), DenseMatrix::times(), SparseMatrix::times(), SparseMatrixRow::times(), DenseMatrix::transTimes(), SparseMatrix::transTimes(), and SparseMatrixRow::transTimes().

◆ isZero()

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.

References BT_FALSE, BT_TRUE, and getAbs().

Referenced by SparseMatrix::addToDiag(), SparseMatrixRow::addToDiag(), QProblemB::computeGivens(), SQProblemSchur::computeMTransTimes(), QProblemB::determineHessianType(), dgemm_(), DenseMatrix::getSparseSubmatrix(), QProblem::setA(), sgemm_(), SparseMatrix::SparseMatrix(), SparseMatrixRow::SparseMatrixRow(), DenseMatrix::times(), SparseMatrix::times(), SparseMatrixRow::times(), DenseMatrix::transTimes(), SparseMatrix::transTimes(), and SparseMatrixRow::transTimes().