|
qpOASES 3.2.1
An Implementation of the Online Active Set Strategy
|
Stores and manages index lists. More...
#include <Indexlist.hpp>
Public Member Functions | |
| Indexlist () | |
| Indexlist (int_t n) | |
| Indexlist (const Indexlist &rhs) | |
| ~Indexlist () | |
| Indexlist & | operator= (const Indexlist &rhs) |
| returnValue | init (int_t n=0) |
| returnValue | getNumberArray (int_t **const numberarray) const |
| returnValue | getISortArray (int_t **const iSortArray) const |
| int_t | getIndex (int_t givennumber) const |
| int_t | getNumber (int_t physicalindex) const |
| int_t | getLength () const |
| int_t | getLastNumber () const |
| returnValue | addNumber (int_t addnumber) |
| returnValue | removeNumber (int_t removenumber) |
| returnValue | swapNumbers (int_t number1, int_t number2) |
| BooleanType | isMember (int_t _number) const |
Protected Member Functions | |
| returnValue | clear () |
| returnValue | copy (const Indexlist &rhs) |
| int_t | findInsert (int_t i) const |
Protected Attributes | |
| int_t * | number |
| int_t * | iSort |
| int_t | length |
| int_t | first |
| int_t | last |
| int_t | lastusedindex |
| int_t | physicallength |
Friends | |
| class | DenseMatrix |
| class | SymDenseMat |
| class | SparseMatrix |
| class | SparseMatrixRow |
| class | SymSparseMat |
This class manages index lists of active/inactive bounds/constraints.
| BEGIN_NAMESPACE_QPOASES Indexlist::Indexlist | ( | ) |
| Indexlist::Indexlist | ( | int_t | n | ) |
| Indexlist::Indexlist | ( | const Indexlist & | rhs | ) |
| Indexlist::~Indexlist | ( | ) |
Destructor.
References clear().
| returnValue Indexlist::addNumber | ( | int_t | addnumber | ) |
Adds number to index list.
| addnumber | Number to be added. |
References findInsert(), iSort, length, number, physicallength, RET_INDEXLIST_EXCEEDS_MAX_LENGTH, SUCCESSFUL_RETURN, and THROWERROR.
Referenced by SubjectTo::addIndex(), Bounds::rotate(), Constraints::rotate(), Bounds::shift(), and Constraints::shift().
|
protected |
Frees all allocated memory.
References iSort, number, and SUCCESSFUL_RETURN.
Referenced by init(), operator=(), and ~Indexlist().
|
protected |
Copies all members from given rhs object.
| rhs | Rhs object. |
References iSort, length, number, physicallength, and SUCCESSFUL_RETURN.
Referenced by Indexlist(), and operator=().
Find first index j between -1 and length in sorted list of indices iSort such that numbers[iSort[j]] <= i < numbers[iSort[j+1]]. Uses bisection.
References iSort, length, and number.
Referenced by addNumber(), getIndex(), removeNumber(), and swapNumbers().
Determines the index within the index list at which a given number is stored.
| givennumber | Number whose index shall be determined. |
References findInsert(), iSort, and number.
Referenced by QProblemB::addBound(), isMember(), QProblem::removeConstraint(), and SQProblemSchur::removeConstraint().
| returnValue Indexlist::getISortArray | ( | int_t **const | iSortArray | ) | const |
Creates an array of all numbers within the index set in correct order.
| iSortArray | Output: iSort Array. |
References iSort, and SUCCESSFUL_RETURN.
Referenced by SQProblemSchur::determineStepDirection2().
|
inline |
Returns last number within the index list.
References length, and number.
Referenced by QProblem::addBound().
|
inline |
Returns the current length of the index list.
References length.
Referenced by SQProblemSchur::addBound(), SQProblemSchur::addConstraint(), SQProblemSchur::addToSchurComplement(), SQProblemSchur::determineStepDirection2(), Constraints::getNAC(), Bounds::getNFR(), Bounds::getNFX(), Constraints::getNIAC(), Matrix::getSparseSubmatrix(), Matrix::getSparseSubmatrix(), Matrix::getSparseSubmatrix(), SQProblemSchur::removeBound(), and SQProblemSchur::removeConstraint().
|
inline |
Returns the number stored at a given physical index.
| physicalindex | Physical index of the number to be returned. |
References length, number, and RET_INDEXLIST_OUTOFBOUNDS.
Referenced by SQProblemSchur::repairSingularWorkingSet().
| returnValue Indexlist::getNumberArray | ( | int_t **const | numberarray | ) | const |
Creates an array of all numbers within the index set in correct order.
| numberarray | Output: Array of numbers (NULL on error). |
References number, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, and THROWERROR.
Referenced by QProblem::addBound(), SQProblemSchur::addBound(), SQProblemSchur::addBound_checkLISchur(), QProblem::addBound_ensureLI(), SQProblemSchur::addBound_ensureLI(), QProblem::addConstraint(), SQProblemSchur::addConstraint(), QProblem::addConstraint_checkLI(), SQProblemSchur::addConstraint_checkLISchur(), QProblem::addConstraint_ensureLI(), SQProblemSchur::addConstraint_ensureLI(), SolutionAnalysis::checkCurvatureOnStronglyActiveConstraints(), QProblemB::computeCholesky(), QProblem::computeProjectedCholesky(), SQProblemSchur::correctInertia(), QProblemB::determineDataShift(), QProblem::determineDataShift(), QProblemB::determineStepDirection(), QProblem::determineStepDirection(), SQProblemSchur::determineStepDirection2(), QProblem::dropInfeasibles(), QProblem::ensureNonzeroCurvature(), QProblem::getFreeVariablesFlags(), Matrix::getSparseSubmatrix(), Matrix::getSparseSubmatrix(), Matrix::getSparseSubmatrix(), SolutionAnalysis::getVarianceCovariance(), QProblemB::performStep(), QProblem::performStep(), Bounds::print(), Constraints::print(), QProblemB::removeBound(), QProblem::removeBound(), SQProblemSchur::removeBound(), QProblem::removeConstraint(), SQProblemSchur::removeConstraint(), QProblem::setupTQfactorisation(), QProblem::solveCurrentEQP(), and QProblem::writeQpWorkspaceIntoMatFile().
| returnValue Indexlist::init | ( | int_t | n = 0 | ) |
Initialises index list of desired physical length.
| n | Physical length of index list. |
References clear(), iSort, length, number, physicallength, RET_INVALID_ARGUMENTS, SUCCESSFUL_RETURN, and THROWERROR.
Referenced by Indexlist(), Indexlist(), Bounds::init(), and Constraints::init().
|
inline |
Determines if a given number is contained in the index set.
| _number | Number to be tested for membership. |
References BT_FALSE, BT_TRUE, and getIndex().
| returnValue Indexlist::removeNumber | ( | int_t | removenumber | ) |
Removes number from index list.
| removenumber | Number to be removed. |
References findInsert(), iSort, length, number, and SUCCESSFUL_RETURN.
Referenced by SubjectTo::removeIndex().
| returnValue Indexlist::swapNumbers | ( | int_t | number1, |
| int_t | number2 | ||
| ) |
Swaps two numbers within index list.
| number1 | First number for swapping. |
| number2 | Second number for swapping. |
References findInsert(), iSort, number, RET_INDEXLIST_CORRUPTED, SUCCESSFUL_RETURN, and THROWERROR.
Referenced by SubjectTo::swapIndex().
|
protected |
Physical index of first element.
|
protected |
Index list to sort vector number
Referenced by addNumber(), SymSparseMat::bilinear(), clear(), copy(), findInsert(), SparseMatrix::getCol(), SparseMatrixRow::getCol(), getIndex(), getISortArray(), SparseMatrix::getRow(), SparseMatrixRow::getRow(), Indexlist(), Indexlist(), init(), removeNumber(), swapNumbers(), DenseMatrix::times(), SparseMatrix::times(), SparseMatrixRow::times(), DenseMatrix::transTimes(), SparseMatrix::transTimes(), and SparseMatrixRow::transTimes().
|
protected |
Physical index of last element.
|
protected |
Physical index of last entry in index list.
|
protected |
Length of index list.
Referenced by addNumber(), SymDenseMat::bilinear(), SymSparseMat::bilinear(), copy(), findInsert(), DenseMatrix::getCol(), SparseMatrixRow::getCol(), getLastNumber(), getLength(), getNumber(), DenseMatrix::getRow(), SparseMatrix::getRow(), init(), removeNumber(), DenseMatrix::times(), SparseMatrix::times(), SparseMatrixRow::times(), DenseMatrix::transTimes(), SparseMatrix::transTimes(), and SparseMatrixRow::transTimes().
|
protected |
Array to store numbers of constraints or bounds.
Referenced by addNumber(), SymDenseMat::bilinear(), SymSparseMat::bilinear(), clear(), copy(), findInsert(), DenseMatrix::getCol(), SparseMatrix::getCol(), SparseMatrixRow::getCol(), getIndex(), getLastNumber(), getNumber(), getNumberArray(), DenseMatrix::getRow(), SparseMatrix::getRow(), SparseMatrixRow::getRow(), Indexlist(), Indexlist(), init(), removeNumber(), swapNumbers(), DenseMatrix::times(), SparseMatrix::times(), SparseMatrixRow::times(), DenseMatrix::transTimes(), SparseMatrix::transTimes(), and SparseMatrixRow::transTimes().
|
protected |
Physical length of index list.
Referenced by addNumber(), copy(), and init().