All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SVSet Class Reference sparse vector set.Class SVSet provides a set of sparse vectors SVector. All SVectors in a SVSet share one big memory block for their nonzeros. This memory is reffered to as the nonzero memory. The SVectors themselfs are saved in another memory block refered to as the vector memory. Both memory blocks will grow automatically if required, when adding more SVectors to the set or enlarging SVectors within the set. For controlling memory consumption, methods are provided to inquire and reset the size of the memory blocks used for vectors and nonzeros. More...
Inheritance diagram for SVSet:
![]()
Detailed Descriptionsparse vector set. Class SVSet provides a set of sparse vectors SVector. All SVectors in a SVSet share one big memory block for their nonzeros. This memory is reffered to as the nonzero memory. The SVectors themselfs are saved in another memory block refered to as the vector memory. Both memory blocks will grow automatically if required, when adding more SVectors to the set or enlarging SVectors within the set. For controlling memory consumption, methods are provided to inquire and reset the size of the memory blocks used for vectors and nonzeros. SVectors in an SVSet are numbered from 0 thru num()-1. They can be accessed using the index operator[](). When removing SVectors of a SVSet the remaining ones will be renumbered. However, all SVector with a smaller number than the lowest number of the removed SVectors will remain unchanged. For providing a uniform access to SVectors in a set even if others are removed or added, SVSet assigns a DataKey to each SVector in the set. Such a DataKey remains unchanged as long as the corresponding SVector is in the SVSet, no matter what other SVectors are added to or removed from the SVSet. Methods are provided for getting the DataKey to a SVector or its number and vice versa. Further, each add() method for enlarging an SVSet is provided with two signatures. One of them returns the DataKeys assigned to the SVectors added to the SVSet. Constructor & Destructor DocumentationMember Function Documentation
Add This includes copying its nonzeros to the sets nonzero memory and creating an additional SVector entry in vector memory. If neccessary, the memory blocks are enlarged appropriately. Definition at line 181 of file svset.h. References SVSet::create(), SVSet::ensurePSVec(), and SVector::size(). Referenced by SVSet::add(), LPColSet::add(), and LPRowSet::add(). Add Adds SVector Definition at line 196 of file svset.h. References SVSet::create(), SVSet::ensurePSVec(), and SVector::size().
Add all
Definition at line 35 of file svset.cpp. References SVSet::create(), SVSet::ensureMem(), SVSet::ensurePSVec(), and DataArray< T >::size(). Adds all
Definition at line 50 of file svset.cpp. References SVSet::add(), SVSet::key(), and SVSet::num().
Add all SVectors in Definition at line 57 of file svset.cpp. References SVSet::create(), SVSet::ensureMem(), SVSet::ensurePSVec(), SVSet::num(), and DataArray< T >::size(). Add all SVectors of Adds all
Definition at line 71 of file svset.cpp. References SVSet::add(), SVSet::key(), and DataArray< T >::size(). Add nonzero ( Adds one nonzero ( Definition at line 166 of file svset.cpp. References SVector::add(), SVector::size(), and SVSet::xtend(). Referenced by LPColSet::add2(), and LPRowSet::add2(). Add Adds Definition at line 172 of file svset.cpp. References SVector::add(), SVector::size(), and SVSet::xtend().
remove all SVectors from set. Definition at line 330 of file svset.h. References SVSet::list, and SVSet::reMax(). Referenced by LPColSet::clear(), LPRowSet::clear(), and SVSet::operator=().
Creates new SVector in set. The new SVector will be ready to fit at least resize the dataarray Definition at line 82 of file svset.cpp. References SVSet::ensureMem(), SVSet::ensurePSVec(), DataArray< T >::last(), SVSet::list, SVector::max(), SVSet::memMax(), SVSet::memSize(), DataArray< T >::removeLast(), DataArray< T >::reSize(), SVector::set_max(), SVector::setMem(), and SVector::size(). Referenced by SVSet::add(), SVSet::create(), LPColSet::create(), and LPRowSet::create(). Creates new SVector in set. The new SVector will be ready to fit at least Definition at line 114 of file svset.cpp. References SVSet::create(), SVSet::key(), and SVSet::num().
deleting a vector from the dataarray Definition at line 178 of file svset.cpp. References SVSet::list, SVector::max(), SVector::mem(), SVSet::DLPSV::next(), DataArray< T >::operator[](), SVSet::DLPSV::prev(), DataArray< T >::removeLast(), SVector::set_size(), SVector::setMem(), SVector::size(), and DataArray< T >::size(). Referenced by SVSet::remove().
provides enough nonzero memory for Definition at line 24 of file svset.cpp. References DataArray< T >::memFactor, SVSet::memMax(), SVSet::memRemax(), and SVSet::memSize(). Referenced by SVSet::add(), SVSet::create(), and SVSet::xtend().
provides enough vector memory for Definition at line 146 of file svset.h. References SVSet::factor, SVSet::max(), SVSet::num(), and SVSet::reMax(). Referenced by SVSet::add(), and SVSet::create().
true iff SVSet contains a SVector for DataKey Definition at line 409 of file svset.h. Referenced by LPColSet::has(), LPRowSet::has(), and SVSet::xtend().
consistency check. Definition at line 340 of file svset.cpp. References SVector::isConsistent(), DataArray< T >::last(), SVSet::list, SVector::max(), SVector::mem(), and MSGinconsistent. Referenced by LPColSet::isConsistent(), LPRowSet::isConsistent(), SVSet::operator=(), and SVSet::SVSet().
get DataKey of vector number Definition at line 385 of file svset.h. Referenced by SVSet::add(), SVSet::create(), LPColSet::key(), LPRowSet::key(), and SVSet::remove().
current maximum number of SVectors. Definition at line 379 of file svset.h. Referenced by SVSet::ensurePSVec(), LPRowSet::max(), LPColSet::max(), and SVSet::memMax().
length of nonzero memory. Definition at line 437 of file svset.h. References SVSet::max(). Referenced by SPxLP::added2Set(), SVSet::create(), SVSet::ensureMem(), LPColSet::memMax(), and LPRowSet::memMax().
garbage collection in nonzero memory. garbage collection in nonzero memory. Pack the svectors together as tightly as possible. This removes all additional unused memory, i.e., size = max for every svector after the call. Note: do not call isConsistent() here, because the following might happen: In SPxLP::doAddRows(const LPRowSet& p_set), when adding rows, the sizes of the vectors for the columns of the LP are increased (without yet filling in the data) to recieve the additional entries. This is done by calling xtend() above. xtend() in turn might call this method, which checks the yet unfilled positions, i.e., isConsistent() is likely to fail. In general, isConsistent() should not be called within this class, but in classes further up in the hierarchy. Definition at line 314 of file svset.cpp. References SVSet::list, SVector::mem(), DataArray< T >::operator[](), SVSet::possiblyUnusedMem, DataArray< T >::reSize(), SVector::set_max(), SVector::set_size(), SVector::setMem(), and SVector::size(). Referenced by LPColSet::memPack(), LPRowSet::memPack(), and SVSet::xtend().
reset length of nonzero memory. Definition at line 280 of file svset.cpp. References SVector::Element::idx, SVSet::list, SVSet::reMax(), and SVector::Element::val. Referenced by SPxLP::added2Set(), SVSet::ensureMem(), LPColSet::memRemax(), and LPRowSet::memRemax().
used nonzero memory. Definition at line 431 of file svset.h. References DataArray< T >::size(). Referenced by SSVector::assign2product4setup(), SVSet::create(), SVSet::ensureMem(), LPColSet::memSize(), LPRowSet::memSize(), and SVSet::xtend().
current number of SVectors. Definition at line 373 of file svset.h. Referenced by SVSet::add(), SPxLP::added2Set(), SSVector::assign2product(), SSVector::assign2product4setup(), SPxScaler::computeScalingVecs(), SVSet::create(), SVSet::ensurePSVec(), LPRowSet::num(), LPColSet::num(), and SVSet::remove().
get vector number of DataKey Definition at line 397 of file svset.h. Referenced by LPColSet::number(), LPRowSet::number(), SVSet::operator=(), and SVSet::remove().
assignment operator. Definition at line 363 of file svset.cpp. References SVSet::clear(), SVSet::isConsistent(), SVSet::list, SVector::max(), SVector::mem(), SVSet::number(), SVSet::set, SVector::set_size(), SVector::setMem(), SVector::size(), and DataArray< T >::size(). Referenced by LPColSet::operator=(), and LPRowSet::operator=().
get SVector by number, writeable Definition at line 344 of file svset.h. Referenced by LPColSet::colVector(), LPColSet::colVector_w(), LPRowSet::rowVector(), and LPRowSet::rowVector_w().
reset maximum number of SVectors. Definition at line 275 of file svset.cpp. References SVSet::list. Referenced by SVSet::clear(), SVSet::ensurePSVec(), SVSet::memRemax(), LPColSet::reMax(), and LPRowSet::reMax().
removes the vector with key
Definition at line 231 of file svset.cpp. References SVSet::deleteVec(). Referenced by LPColSet::remove(), and LPRowSet::remove().
removes the vector with number
Definition at line 274 of file svset.h. References SVSet::key().
remove one SVector from set.
Definition at line 281 of file svset.h. References SVSet::key().
remove multiple elements. Removes all SVectors for the SVSet with an index
Definition at line 237 of file svset.cpp. References SVSet::deleteVec(), and SVSet::num().
Remove
Definition at line 300 of file svset.h. References DataArray< T >::get_ptr(), and SVSet::num().
Remove
Definition at line 310 of file svset.h. References DataArray< T >::get_ptr(), and SVSet::num().
Definition at line 254 of file svset.cpp. References SVSet::num(), and SVSet::number().
Remove
Definition at line 263 of file svset.cpp. References SVSet::num().
Extend Definition at line 121 of file svset.cpp. References SVSet::ensureMem(), SVSet::has(), DataArray< T >::insert(), DataArray< T >::last(), SVSet::list, SVector::max(), SVector::mem(), DataArray< T >::memFactor, SVSet::memPack(), SVSet::memSize(), SVSet::possiblyUnusedMem, SVSet::DLPSV::prev(), SVector::set_size(), SVector::setMem(), and SVector::size(). Referenced by SVSet::add2(), SPxLP::added2Set(), LPColSet::xtend(), and LPRowSet::xtend(). Member Data Documentation
Sparse vector memory enlargment factor. If the SVSet runs out of vector memory, it is enlarged by Definition at line 167 of file svset.h. Referenced by SVSet::ensurePSVec(). doubly linked list for non-zero management Definition at line 138 of file svset.h. Referenced by SVSet::clear(), SVSet::create(), SVSet::deleteVec(), SVSet::isConsistent(), SVSet::memPack(), SVSet::memRemax(), SVSet::operator=(), SVSet::reMax(), and SVSet::xtend().
an estimate of the used memory due to xtends Definition at line 139 of file svset.h. Referenced by SVSet::memPack(), and SVSet::xtend().
|