|
CoinUtils 2.11.10
|
#include <CoinIndexedVector.hpp>
Inheritance diagram for CoinPartitionedVector:
Collaboration diagram for CoinPartitionedVector:Public Member Functions | |
Get methods. | |
| int | getNumElements (int partition) const |
| Get the size of a partition. | |
| int | getNumPartitions () const |
| Get number of partitions. | |
| int | getNumElements () const |
| Get the size. | |
| int | startPartition (int partition) const |
| Get starts. | |
| const int * | startPartitions () const |
| Get starts. | |
Set methods | |
| void | setNumElementsPartition (int partition, int value) |
| Set the size of a partition. | |
| void | setTempNumElementsPartition (int partition, int value) |
| Set the size of a partition (just for a tiny while) | |
| void | computeNumberElements () |
| Add up number of elements in partitions. | |
| void | compact () |
| Add up number of elements in partitions and pack and get rid of partitions. | |
| void | reserve (int n) |
| Reserve space. | |
| void | setPartitions (int number, const int *starts) |
| Setup partitions (needs end as well) | |
| void | clearAndReset () |
| Reset the vector (as if were just created an empty vector). Gets rid of partitions. | |
| void | clearAndKeep () |
| Reset the vector (as if were just created an empty vector). Keeps partitions. | |
| void | clearPartition (int partition) |
| Clear a partition. | |
| void | checkClear () |
| For debug check vector is clear i.e. no elements. | |
| void | checkClean () |
| For debug check vector is clean i.e. elements match indices. | |
| int | scan (int partition, double tolerance=0.0) |
| Scan dense region and set up indices (returns number found) | |
| void | print () const |
| Scan dense region from start to < end and set up indices returns number found. | |
Sorting | |
| void | sort () |
| Sort the indexed storage vector (increasing indices). | |
Constructors and destructors (not all wriiten) | |
| CoinPartitionedVector () | |
| Default constructor. | |
| CoinPartitionedVector (int size, const int *inds, const double *elems) | |
| Alternate Constructors - set elements to vector of doubles. | |
| CoinPartitionedVector (int size, const int *inds, double element) | |
| Alternate Constructors - set elements to same scalar value. | |
| CoinPartitionedVector (int size, const double *elements) | |
| Alternate Constructors - construct full storage with indices 0 through size-1. | |
| CoinPartitionedVector (int size) | |
| Alternate Constructors - just size. | |
| CoinPartitionedVector (const CoinPartitionedVector &) | |
| Copy constructor. | |
| CoinPartitionedVector (const CoinPartitionedVector *) | |
| Copy constructor.2. | |
| CoinPartitionedVector & | operator= (const CoinPartitionedVector &) |
| Assignment operator. | |
| ~CoinPartitionedVector () | |
| Destructor. | |
Public Member Functions inherited from CoinIndexedVector | |
| int | getNumElements () const |
| Get the size. | |
| const int * | getIndices () const |
| Get indices of elements. | |
| int * | getIndices () |
| Get element values. | |
| double * | denseVector () const |
| Get the vector as a dense vector. | |
| void | setDenseVector (double *array) |
| For very temporary use when user needs to borrow a dense vector. | |
| void | setIndexVector (int *array) |
| For very temporary use when user needs to borrow an index vector. | |
| double & | operator[] (int i) const |
| Access the i'th element of the full storage vector. | |
| void | setNumElements (int value) |
| Set the size. | |
| void | clear () |
| Reset the vector (as if were just created an empty vector). This leaves arrays! | |
| void | empty () |
| Reset the vector (as if were just created an empty vector) | |
| void | reallyClear () |
| Clear even if in a bad way. | |
| CoinIndexedVector & | operator= (const CoinIndexedVector &) |
| Assignment operator. | |
| CoinIndexedVector & | operator= (const CoinPackedVectorBase &rhs) |
| Assignment operator from a CoinPackedVectorBase. | |
| void | copy (const CoinIndexedVector &rhs, double multiplier=1.0) |
| Copy the contents of one vector into another. | |
| void | borrowVector (int size, int numberIndices, int *inds, double *elems) |
| Borrow ownership of the arguments to this vector. | |
| void | returnVector () |
| Return ownership of the arguments to this vector. | |
| void | setVector (int numberIndices, const int *inds, const double *elems) |
| Set vector numberIndices, indices, and elements. | |
| void | setVector (int size, int numberIndices, const int *inds, const double *elems) |
| Set vector size, indices, and elements. | |
| void | setConstant (int size, const int *inds, double elems) |
| Elements set to have the same scalar value. | |
| void | setFull (int size, const double *elems) |
| Indices are not specified and are taken to be 0,1,...,size-1. | |
| void | setElement (int index, double element) |
| Set an existing element in the indexed vector The first argument is the "index" into the elements() array. | |
| void | insert (int index, double element) |
| Insert an element into the vector. | |
| void | quickInsert (int index, double element) |
| Insert a nonzero element into the vector. | |
| void | add (int index, double element) |
| Insert or if exists add an element into the vector Any resulting zero elements will be made tiny. | |
| void | quickAdd (int index, double element) |
| Insert or if exists add an element into the vector Any resulting zero elements will be made tiny. | |
| void | quickAddNonZero (int index, double element) |
| Insert or if exists add an element into the vector Any resulting zero elements will be made tiny. | |
| void | zero (int index) |
| Makes nonzero tiny. | |
| int | clean (double tolerance) |
| set all small values to zero and return number remaining | |
| int | cleanAndPack (double tolerance) |
| Same but packs down. | |
| int | cleanAndPackSafe (double tolerance) |
| Same but packs down and is safe (i.e. if order is odd) | |
| void | setPacked () |
| Mark as packed. | |
| void | checkClear () |
| For debug check vector is clear i.e. no elements. | |
| void | checkClean () |
| For debug check vector is clean i.e. elements match indices. | |
| int | scan () |
| Scan dense region and set up indices (returns number found) | |
| int | scan (int start, int end) |
| Scan dense region from start to < end and set up indices returns number found. | |
| int | scan (double tolerance) |
| Scan dense region and set up indices (returns number found). | |
| int | scan (int start, int end, double tolerance) |
| Scan dense region from start to < end and set up indices returns number found. | |
| int | scanAndPack () |
| These are same but pack down. | |
| int | scanAndPack (int start, int end) |
| int | scanAndPack (double tolerance) |
| int | scanAndPack (int start, int end, double tolerance) |
| void | createPacked (int number, const int *indices, const double *elements) |
| Create packed array. | |
| void | createUnpacked (int number, const int *indices, const double *elements) |
| Create unpacked array. | |
| void | createOneUnpackedElement (int index, double element) |
| Create unpacked singleton. | |
| void | expand () |
| This is mainly for testing - goes from packed to indexed. | |
| void | append (const CoinPackedVectorBase &caboose) |
| Append a CoinPackedVector to the end. | |
| void | append (const CoinIndexedVector &caboose) |
| Append a CoinIndexedVector to the end (with extra space) | |
| void | append (CoinIndexedVector &other, int adjustIndex, bool zapElements=false) |
| Append a CoinIndexedVector to the end and modify indices. | |
| void | swap (int i, int j) |
| Swap values in positions i and j of indices and elements. | |
| void | truncate (int newSize) |
| Throw away all entries in rows >= newSize. | |
| void | print () const |
| Print out. | |
| void | operator+= (double value) |
add value to every entry | |
| void | operator-= (double value) |
subtract value from every entry | |
| void | operator*= (double value) |
multiply every entry by value | |
| void | operator/= (double value) |
divide every entry by value (** 0 vanishes) | |
| bool | operator== (const CoinPackedVectorBase &rhs) const |
| Equal. | |
| bool | operator!= (const CoinPackedVectorBase &rhs) const |
| Not equal. | |
| bool | operator== (const CoinIndexedVector &rhs) const |
| Equal. | |
| bool | operator!= (const CoinIndexedVector &rhs) const |
| Not equal. | |
| int | isApproximatelyEqual (const CoinIndexedVector &rhs, double tolerance=1.0e-8) const |
| Equal with a tolerance (returns -1 or position of inequality). | |
| int | getMaxIndex () const |
| Get value of maximum index. | |
| int | getMinIndex () const |
| Get value of minimum index. | |
| void | sort () |
| Sort the indexed storage vector (increasing indices). | |
| void | sortIncrIndex () |
| void | sortDecrIndex () |
| void | sortIncrElement () |
| void | sortDecrElement () |
| void | sortPacked () |
| CoinIndexedVector | operator+ (const CoinIndexedVector &op2) |
| Return the sum of two indexed vectors. | |
| CoinIndexedVector | operator- (const CoinIndexedVector &op2) |
| Return the difference of two indexed vectors. | |
| CoinIndexedVector | operator* (const CoinIndexedVector &op2) |
| Return the element-wise product of two indexed vectors. | |
| CoinIndexedVector | operator/ (const CoinIndexedVector &op2) |
| Return the element-wise ratio of two indexed vectors (0.0/0.0 => 0.0) (0 vanishes) | |
| void | operator+= (const CoinIndexedVector &op2) |
| The sum of two indexed vectors. | |
| void | operator-= (const CoinIndexedVector &op2) |
| The difference of two indexed vectors. | |
| void | operator*= (const CoinIndexedVector &op2) |
| The element-wise product of two indexed vectors. | |
| void | operator/= (const CoinIndexedVector &op2) |
| The element-wise ratio of two indexed vectors (0.0/0.0 => 0.0) (0 vanishes) | |
| void | reserve (int n) |
| Reserve space. | |
| int | capacity () const |
| capacity returns the size which could be accomodated without having to reallocate storage. | |
| void | setCapacity (int value) |
| void | setPackedMode (bool yesNo) |
| Sets packed mode. | |
| bool | packedMode () const |
| Gets packed mode. | |
| CoinIndexedVector () | |
| Default constructor. | |
| CoinIndexedVector (int size, const int *inds, const double *elems) | |
| Alternate Constructors - set elements to vector of doubles. | |
| CoinIndexedVector (int size, const int *inds, double element) | |
| Alternate Constructors - set elements to same scalar value. | |
| CoinIndexedVector (int size, const double *elements) | |
| Alternate Constructors - construct full storage with indices 0 through size-1. | |
| CoinIndexedVector (int size) | |
| Alternate Constructors - just size. | |
| CoinIndexedVector (const CoinIndexedVector &) | |
| Copy constructor. | |
| CoinIndexedVector (const CoinIndexedVector *) | |
| Copy constructor.2. | |
| CoinIndexedVector (const CoinPackedVectorBase &rhs) | |
| Copy constructor from a PackedVectorBase. | |
| ~CoinIndexedVector () | |
| Destructor. | |
Protected Attributes | |
Private member data | |
| int | startPartition_ [COIN_PARTITIONS+1] |
| Starts. | |
| int | numberElementsPartition_ [COIN_PARTITIONS] |
| Size of indices in a partition. | |
| int | numberPartitions_ |
| Number of partitions (0 means off) | |
Protected Attributes inherited from CoinIndexedVector | |
| int * | indices_ |
| Vector indices. | |
| double * | elements_ |
| Vector elements. | |
| int | nElements_ |
| Size of indices and packed elements vectors. | |
| int | capacity_ |
| Amount of memory allocated for indices_, and elements_. | |
| int | offset_ |
| Offset to get where new allocated array. | |
| bool | packedMode_ |
| If true then is operating in packed mode. | |
Definition at line 1303 of file CoinIndexedVector.hpp.
| CoinPartitionedVector::CoinPartitionedVector | ( | ) |
Default constructor.
Alternate Constructors - set elements to vector of doubles.
| CoinPartitionedVector::CoinPartitionedVector | ( | int | size, |
| const int * | inds, | ||
| double | element ) |
Alternate Constructors - set elements to same scalar value.
| CoinPartitionedVector::CoinPartitionedVector | ( | int | size, |
| const double * | elements ) |
Alternate Constructors - construct full storage with indices 0 through size-1.
| CoinPartitionedVector::CoinPartitionedVector | ( | int | size | ) |
Alternate Constructors - just size.
| CoinPartitionedVector::CoinPartitionedVector | ( | const CoinPartitionedVector & | ) |
Copy constructor.
| CoinPartitionedVector::CoinPartitionedVector | ( | const CoinPartitionedVector * | ) |
Copy constructor.2.
| CoinPartitionedVector::~CoinPartitionedVector | ( | ) |
Destructor.
|
inline |
Get the size of a partition.
Definition at line 1312 of file CoinIndexedVector.hpp.
|
inline |
Get number of partitions.
Definition at line 1318 of file CoinIndexedVector.hpp.
|
inline |
Get the size.
Definition at line 1323 of file CoinIndexedVector.hpp.
|
inline |
Get starts.
Definition at line 1325 of file CoinIndexedVector.hpp.
|
inline |
Get starts.
Definition at line 1331 of file CoinIndexedVector.hpp.
|
inline |
Set the size of a partition.
Definition at line 1343 of file CoinIndexedVector.hpp.
|
inline |
Set the size of a partition (just for a tiny while)
Definition at line 1350 of file CoinIndexedVector.hpp.
| void CoinPartitionedVector::computeNumberElements | ( | ) |
Add up number of elements in partitions.
| void CoinPartitionedVector::compact | ( | ) |
Add up number of elements in partitions and pack and get rid of partitions.
| void CoinPartitionedVector::reserve | ( | int | n | ) |
Reserve space.
Setup partitions (needs end as well)
| void CoinPartitionedVector::clearAndReset | ( | ) |
Reset the vector (as if were just created an empty vector). Gets rid of partitions.
| void CoinPartitionedVector::clearAndKeep | ( | ) |
Reset the vector (as if were just created an empty vector). Keeps partitions.
| void CoinPartitionedVector::clearPartition | ( | int | partition | ) |
Clear a partition.
| void CoinPartitionedVector::checkClean | ( | ) |
For debug check vector is clean i.e. elements match indices.
| int CoinPartitionedVector::scan | ( | int | partition, |
| double | tolerance = 0.0 ) |
Scan dense region and set up indices (returns number found)
| void CoinPartitionedVector::print | ( | ) | const |
Scan dense region from start to < end and set up indices returns number found.
Print out
| void CoinPartitionedVector::sort | ( | ) |
Sort the indexed storage vector (increasing indices).
| CoinPartitionedVector & CoinPartitionedVector::operator= | ( | const CoinPartitionedVector & | ) |
Assignment operator.
|
protected |
Starts.
Definition at line 1420 of file CoinIndexedVector.hpp.
|
protected |
Size of indices in a partition.
Definition at line 1422 of file CoinIndexedVector.hpp.
|
protected |
Number of partitions (0 means off)
Definition at line 1424 of file CoinIndexedVector.hpp.