CoinUtils
trunk
|
#include <CoinIndexedVector.hpp>
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. | |
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) |
Definition at line 1050 of file CoinIndexedVector.hpp.
Default constructor.
CoinPartitionedVector::CoinPartitionedVector | ( | int | size, |
const int * | inds, | ||
const double * | elems | ||
) |
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.
Copy constructor.
Copy constructor.2.
Destructor.
int CoinPartitionedVector::getNumElements | ( | int | partition | ) | const [inline] |
Get the size of a partition.
Definition at line 1059 of file CoinIndexedVector.hpp.
int CoinPartitionedVector::getNumPartitions | ( | ) | const [inline] |
Get number of partitions.
Definition at line 1062 of file CoinIndexedVector.hpp.
int CoinPartitionedVector::getNumElements | ( | ) | const [inline] |
Get the size.
Reimplemented from CoinIndexedVector.
Definition at line 1065 of file CoinIndexedVector.hpp.
int CoinPartitionedVector::startPartition | ( | int | partition | ) | const [inline] |
Get starts.
Definition at line 1067 of file CoinIndexedVector.hpp.
const int* CoinPartitionedVector::startPartitions | ( | ) | const [inline] |
Get starts.
Definition at line 1070 of file CoinIndexedVector.hpp.
void CoinPartitionedVector::setNumElementsPartition | ( | int | partition, |
int | value | ||
) | [inline] |
Set the size of a partition.
Definition at line 1080 of file CoinIndexedVector.hpp.
void CoinPartitionedVector::setTempNumElementsPartition | ( | int | partition, |
int | value | ||
) | [inline] |
Set the size of a partition (just for a tiny while)
Definition at line 1083 of file CoinIndexedVector.hpp.
Add up number of elements in partitions.
Add up number of elements in partitions and pack and get rid of partitions.
void CoinPartitionedVector::reserve | ( | int | n | ) |
Reserve space.
Reimplemented from CoinIndexedVector.
void CoinPartitionedVector::setPartitions | ( | int | number, |
const int * | starts | ||
) |
Setup partitions (needs end as well)
Reset the vector (as if were just created an empty vector). Gets rid of partitions.
Reset the vector (as if were just created an empty vector). Keeps partitions.
void CoinPartitionedVector::clearPartition | ( | int | partition | ) |
Clear a partition.
For debug check vector is clear i.e. no elements.
Reimplemented from CoinIndexedVector.
For debug check vector is clean i.e. elements match indices.
Reimplemented from CoinIndexedVector.
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
Reimplemented from CoinIndexedVector.
Sort the indexed storage vector (increasing indices).
Reimplemented from CoinIndexedVector.
CoinPartitionedVector& CoinPartitionedVector::operator= | ( | const CoinPartitionedVector & | ) |
Assignment operator.
int CoinPartitionedVector::startPartition_[COIN_PARTITIONS+1] [protected] |
Starts.
Definition at line 1150 of file CoinIndexedVector.hpp.
int CoinPartitionedVector::numberElementsPartition_[COIN_PARTITIONS] [protected] |
Size of indices in a partition.
Definition at line 1152 of file CoinIndexedVector.hpp.
int CoinPartitionedVector::numberPartitions_ [protected] |
Number of partitions (0 means off)
Definition at line 1154 of file CoinIndexedVector.hpp.