qpOASES  3.0.1
Functions
include/qpOASES/Utils.ipp File Reference
#include <math.h>
Include dependency graph for Utils.ipp:
This graph shows which files directly or indirectly include this file:

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 getMax (int x, int y)
int getMin (int x, int 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.0
Date:
2007-2014

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


Function Documentation

real_t getAbs ( real_t  x) [inline]
int getMax ( int  x,
int  y 
) [inline]
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.
int getMin ( int  x,
int  y 
) [inline]

Returns minimum of two integers.

Returns:
Minimum of two integers
Parameters:
xFirst integer.
ySecond integer.

Referenced by QProblemB::computeCholesky(), QProblem::computeProjectedCholesky(), QProblem::performDriftCorrection(), QProblemB::performDriftCorrection(), QProblem::QProblem(), QProblemB::updateFarBounds(), and QProblem::updateFarBounds().

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.
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.
real_t getSqrt ( real_t  x) [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 dgemm_(), DenseMatrix::getCol(), SparseMatrix::getCol(), SparseMatrixRow::getCol(), DenseMatrix::getRow(), SparseMatrix::getRow(), SparseMatrixRow::getRow(), sgemm_(), DenseMatrix::times(), SparseMatrix::times(), SparseMatrixRow::times(), DenseMatrix::transTimes(), SparseMatrix::transTimes(), and SparseMatrixRow::transTimes().

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(), QProblemB::determineHessianType(), dgemm_(), QProblem::setA(), sgemm_(), SparseMatrix::SparseMatrix(), SparseMatrixRow::SparseMatrixRow(), DenseMatrix::times(), SparseMatrix::times(), SparseMatrixRow::times(), DenseMatrix::transTimes(), SparseMatrix::transTimes(), and SparseMatrixRow::transTimes().