Loading...
Searching...
No Matches
IdxSet Class Reference Set of indices. More...
Inheritance diagram for IdxSet:
![]()
Detailed DescriptionSet of indices. Class IdxSet provides a set of indices. At construction it must be given an array of int where to store the indice and its length. The array will from then on be managed by the IdxSet. Indices are implicitely numbered from 0 thru size()-1. They can be accessed (and altered) via method index() with the desired index number as argument. Range checking is performed in the debug version. Indices may be added or removed from the set, by calling add() or remove() methods, respectively. However, no IdxSet can hold more then max() indices, i.e. the number given at the constructor. When removing indices, the remaining ones are renumbered. However, all indices before the first removed index keep their number unchanged. The internal structure of an IdxSet consists of an array idx storing the indices, its length len, and the actually used number of indices num. The class IdxSet doesn't allocate memory for the idx array. Instead, the user has to provide an adequate buffer to the constructor. An IdxSet cannot be extended to fit more than max() elements. If necessary, the user must explicitely provide the IdxSet with a suitable memory. Alternatively, one can use DIdxSets which provide the required memory managemant. Constructor & Destructor Documentation◆ IdxSet() [1/3]
constructor. The constructur receives the index memory Definition at line 89 of file idxset.h. References IdxSet::isConsistent(). ◆ IdxSet() [2/3]
default constructor. The default constructor creates an index set with an empty index space. You cannot store any indices in an IdxSet created with the default constructor. Definition at line 100 of file idxset.h. References IdxSet::isConsistent(). ◆ ~IdxSet()
destructor. Definition at line 107 of file idxset.h. References IdxSet::freeArray, IdxSet::idx, and soplex::spx_free(). ◆ IdxSet() [3/3]copy constructor. Definition at line 110 of file idxset.cpp. References IdxSet::freeArray, IdxSet::idx, IdxSet::isConsistent(), IdxSet::len, IdxSet::max(), IdxSet::num, IdxSet::size(), and soplex::spx_alloc(). Member Function Documentation◆ add() [1/3]
appends all indices of Definition at line 165 of file idxset.h. References IdxSet::add(), IdxSet::idx, and IdxSet::size(). ◆ add() [2/3]
appends Definition at line 158 of file idxset.h. References IdxSet::max(), IdxSet::num, and IdxSet::size(). Referenced by DIdxSet::add(), DIdxSet::add(), DIdxSet::add(), IdxSet::add(), IdxSet::add(), and SSVectorBase< R >::setValue(). ◆ add() [3/3]
appends Definition at line 50 of file idxset.cpp. References IdxSet::add(), IdxSet::idx, IdxSet::max(), and IdxSet::size(). ◆ addIdx()
appends index Definition at line 174 of file idxset.h. References IdxSet::idx, IdxSet::max(), IdxSet::num, and IdxSet::size(). Referenced by SSVectorBase< R >::add(), and DIdxSet::addIdx(). ◆ clear()
removes all indices. Definition at line 193 of file idxset.h. References IdxSet::num. Referenced by SSVectorBase< R >::clear(), and SSVectorBase< R >::setup(). ◆ dim()
returns the maximal index. Definition at line 30 of file idxset.cpp. References IdxSet::idx, and IdxSet::size(). Referenced by SSVectorBase< R >::isConsistent(), SSVectorBase< R >::SSVectorBase(), SSVectorBase< R >::SSVectorBase(), and SSVectorBase< R >::SSVectorBase(). ◆ index()
access Definition at line 127 of file idxset.h. References IdxSet::idx, and IdxSet::size(). Referenced by SSVectorBase< R >::index(), and IdxSet::isConsistent(). ◆ isConsistent()
consistency check. Definition at line 126 of file idxset.cpp. References IdxSet::idx, IdxSet::index(), IdxSet::len, IdxSet::size(), and SPX_MSG_INCONSISTENT. Referenced by IdxSet::IdxSet(), IdxSet::IdxSet(), IdxSet::IdxSet(), SSVectorBase< R >::isConsistent(), and IdxSet::operator=(). ◆ max()
returns the maximal number of indices which can be stored in IdxSet. Definition at line 138 of file idxset.h. References IdxSet::len. Referenced by DIdxSet::add(), DIdxSet::add(), DIdxSet::add(), IdxSet::add(), IdxSet::add(), DIdxSet::addIdx(), IdxSet::addIdx(), IdxSet::IdxSet(), SSVectorBase< R >::isConsistent(), IdxSet::operator=(), SSVectorBase< R >::operator=(), SSVectorBase< R >::operator=(), DIdxSet::setMax(), SSVectorBase< R >::setSize(), and SSVectorBase< R >::setup_and_assign(). ◆ operator=()assignment operator. The assignment operator copies all nonzeros of the right handside IdxSet to the left one. This implies, that the latter must have enough index memory. Definition at line 80 of file idxset.cpp. References IdxSet::freeArray, IdxSet::idx, IdxSet::isConsistent(), IdxSet::len, IdxSet::max(), IdxSet::num, IdxSet::size(), soplex::spx_alloc(), and soplex::spx_free(). Referenced by DIdxSet::DIdxSet(), DIdxSet::DIdxSet(), DIdxSet::operator=(), DIdxSet::operator=(), SSVectorBase< R >::operator=(), SSVectorBase< R >::operator=(), SSVectorBase< R >::setup_and_assign(), SSVectorBase< R >::SSVectorBase(), and SSVectorBase< R >::SSVectorBase(). ◆ pos()
returns the position of index Finds the position of the first index Definition at line 41 of file idxset.cpp. References IdxSet::idx, and IdxSet::size(). Referenced by SSVectorBase< R >::pos(). ◆ remove() [1/2]
removes Definition at line 183 of file idxset.h. References IdxSet::idx, IdxSet::num, and IdxSet::size(). ◆ remove() [2/2]
removes indices at position numbers Definition at line 60 of file idxset.cpp. References IdxSet::idx, IdxSet::num, and IdxSet::size(). Referenced by SSVectorBase< R >::clearIdx(), SSVectorBase< R >::clearNum(), and SSVectorBase< R >::reDim(). ◆ size()
returns the number of used indices. Definition at line 133 of file idxset.h. References IdxSet::num. Referenced by DIdxSet::add(), DIdxSet::add(), DIdxSet::add(), IdxSet::add(), IdxSet::add(), IdxSet::add(), DIdxSet::addIdx(), IdxSet::addIdx(), DIdxSet::DIdxSet(), DIdxSet::DIdxSet(), IdxSet::dim(), IdxSet::IdxSet(), IdxSet::index(), IdxSet::isConsistent(), DIdxSet::operator=(), DIdxSet::operator=(), IdxSet::operator=(), IdxSet::pos(), SSVectorBase< R >::reDim(), IdxSet::remove(), IdxSet::remove(), DIdxSet::setMax(), SSVectorBase< R >::setMax(), and SSVectorBase< R >::size(). Member Data Documentation◆ freeArray
true iff idx should be freed inside of this object Definition at line 75 of file idxset.h. Referenced by IdxSet::IdxSet(), IdxSet::operator=(), and IdxSet::~IdxSet(). ◆ idx
array of indices Definition at line 74 of file idxset.h. Referenced by IdxSet::add(), IdxSet::add(), IdxSet::addIdx(), SSVectorBase< R >::altIndexMem(), SSVectorBase< R >::assign2product1(), SSVectorBase< R >::assign2productAndSetup(), SSVectorBase< R >::assign2productFull(), SSVectorBase< R >::assign2productShort(), SSVectorBase< R >::clear(), DIdxSet::DIdxSet(), DIdxSet::DIdxSet(), DIdxSet::DIdxSet(), IdxSet::dim(), IdxSet::IdxSet(), IdxSet::index(), SSVectorBase< R >::indexMem(), IdxSet::isConsistent(), SSVectorBase< R >::length2(), SSVectorBase< R >::maxAbs(), IdxSet::operator=(), SSVectorBase< R >::operator=(), SSVectorBase< R >::operator=(), IdxSet::pos(), IdxSet::remove(), IdxSet::remove(), DIdxSet::setMax(), SSVectorBase< R >::setMax(), SSVectorBase< R >::setup(), SSVectorBase< R >::setup_and_assign(), SSVectorBase< R >::SSVectorBase(), SSVectorBase< R >::SSVectorBase(), SSVectorBase< R >::SSVectorBase(), SSVectorBase< R >::SSVectorBase(), SSVectorBase< R >::value(), DIdxSet::~DIdxSet(), IdxSet::~IdxSet(), and SSVectorBase< R >::~SSVectorBase(). ◆ len
length of array idx Definition at line 73 of file idxset.h. Referenced by DIdxSet::DIdxSet(), DIdxSet::DIdxSet(), DIdxSet::DIdxSet(), IdxSet::IdxSet(), IdxSet::isConsistent(), IdxSet::max(), IdxSet::operator=(), DIdxSet::setMax(), SSVectorBase< R >::setMax(), SSVectorBase< R >::SSVectorBase(), SSVectorBase< R >::SSVectorBase(), SSVectorBase< R >::SSVectorBase(), and SSVectorBase< R >::SSVectorBase(). ◆ num
number of used indices Definition at line 72 of file idxset.h. Referenced by IdxSet::add(), IdxSet::addIdx(), SSVectorBase< R >::assign2productAndSetup(), IdxSet::clear(), SSVectorBase< R >::clear(), IdxSet::IdxSet(), SSVectorBase< R >::length2(), SSVectorBase< R >::maxAbs(), IdxSet::operator=(), SSVectorBase< R >::operator=(), SSVectorBase< R >::operator=(), IdxSet::remove(), IdxSet::remove(), SSVectorBase< R >::setSize(), SSVectorBase< R >::setup(), SSVectorBase< R >::setup_and_assign(), and IdxSet::size().
|