CoinUtils  2.11.9
CoinIndexedVector.hpp
Go to the documentation of this file.
1 /* $Id$ */
2 // Copyright (C) 2000, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef CoinIndexedVector_H
7 #define CoinIndexedVector_H
8 
9 #if defined(_MSC_VER)
10 // Turn off compiler warning about long names
11 #pragma warning(disable : 4786)
12 #endif
13 
14 #include <map>
15 #include "CoinFinite.hpp"
16 #ifndef CLP_NO_VECTOR
17 #include "CoinPackedVectorBase.hpp"
18 #endif
19 #include "CoinSort.hpp"
20 #include "CoinHelperFunctions.hpp"
21 #include <cassert>
22 
23 #ifndef COIN_FLOAT
24 #define COIN_INDEXED_TINY_ELEMENT 1.0e-50
25 #define COIN_INDEXED_REALLY_TINY_ELEMENT 1.0e-100
26 #else
27 #define COIN_INDEXED_TINY_ELEMENT 1.0e-35
28 #define COIN_INDEXED_REALLY_TINY_ELEMENT 1.0e-39
29 #endif
30 
105  friend void CoinIndexedVectorUnitTest();
106 
107 public:
110  inline int getNumElements() const { return nElements_; }
113  inline const int *getIndices() const { return indices_; }
115  // ** No longer supported virtual const double * getElements() const ;
117  inline int *getIndices() { return indices_; }
121  inline double *denseVector() const { return elements_; }
123  inline void setDenseVector(double *array)
124  {
125  elements_ = array;
126  }
128  inline void setIndexVector(int *array)
129  {
130  indices_ = array;
131  }
134  double &operator[](int i) const;
135 
137 
138  //-------------------------------------------------------------------
139  // Set indices and elements
140  //-------------------------------------------------------------------
143  inline void setNumElements(int value)
145  {
146  nElements_ = value;
147  if (!nElements_)
148  packedMode_ = false;
149  }
151  void clear();
153  void empty();
155  void reallyClear();
158 #ifndef CLP_NO_VECTOR
159 
162 #endif
163 
166  void copy(const CoinIndexedVector &rhs, double multiplier = 1.0);
167 
170  void borrowVector(int size, int numberIndices, int *inds, double *elems);
171 
175  void returnVector();
176 
181  void setVector(int numberIndices, const int *inds, const double *elems);
182 
187  void setVector(int size, int numberIndices, const int *inds, const double *elems);
188 
190  void setConstant(int size, const int *inds, double elems);
191 
193  void setFull(int size, const double *elems);
194 
198  void setElement(int index, double element);
199 
201  void insert(int index, double element);
203  inline void quickInsert(int index, double element)
204  {
205  assert(!elements_[index]);
206  indices_[nElements_++] = index;
207  assert(nElements_ <= capacity_);
208  elements_[index] = element;
209  }
212  void add(int index, double element);
216  inline void quickAdd(int index, double element)
217  {
218  if (elements_[index]) {
219  element += elements_[index];
220  if ((element > 0 ? element : -element) >= COIN_INDEXED_TINY_ELEMENT) {
221  elements_[index] = element;
222  } else {
223  elements_[index] = 1.0e-100;
224  }
225  } else if ((element > 0 ? element : -element) >= COIN_INDEXED_TINY_ELEMENT) {
226  indices_[nElements_++] = index;
227  assert(nElements_ <= capacity_);
228  elements_[index] = element;
229  }
230  }
235  inline void quickAddNonZero(int index, double element)
236  {
237  assert(element);
238  if (elements_[index]) {
239  element += elements_[index];
240  if ((element > 0 ? element : -element) >= COIN_INDEXED_TINY_ELEMENT) {
241  elements_[index] = element;
242  } else {
243  elements_[index] = COIN_DBL_MIN;
244  }
245  } else {
246  indices_[nElements_++] = index;
247  assert(nElements_ <= capacity_);
248  elements_[index] = element;
249  }
250  }
253  inline void zero(int index)
254  {
255  if (elements_[index])
256  elements_[index] = COIN_DBL_MIN;
257  }
260  int clean(double tolerance);
262  int cleanAndPack(double tolerance);
264  int cleanAndPackSafe(double tolerance);
266  inline void setPacked()
267  {
268  packedMode_ = true;
269  }
270 #ifndef NDEBUG
271  void checkClear();
274  void checkClean();
275 #else
276  inline void checkClear() {};
277  inline void checkClean() {};
278 #endif
279  int scan();
284  int scan(int start, int end);
287  int scan(double tolerance);
291  int scan(int start, int end, double tolerance);
293  int scanAndPack();
294  int scanAndPack(int start, int end);
295  int scanAndPack(double tolerance);
296  int scanAndPack(int start, int end, double tolerance);
298  void createPacked(int number, const int *indices,
299  const double *elements);
301  void createUnpacked(int number, const int *indices,
302  const double *elements);
304  void createOneUnpackedElement(int index, double element);
306  void expand();
307 #ifndef CLP_NO_VECTOR
308  void append(const CoinPackedVectorBase &caboose);
310 #endif
311  void append(const CoinIndexedVector &caboose);
314  void append(CoinIndexedVector &other, int adjustIndex, bool zapElements = false);
315 
317  void swap(int i, int j);
318 
320  void truncate(int newSize);
322  void print() const;
324 
326  void operator+=(double value);
329  void operator-=(double value);
331  void operator*=(double value);
333  void operator/=(double value);
335 
338 #ifndef CLP_NO_VECTOR
339 
341  bool operator==(const CoinPackedVectorBase &rhs) const;
343  bool operator!=(const CoinPackedVectorBase &rhs) const;
344 #endif
345 
347  bool operator==(const CoinIndexedVector &rhs) const;
349  bool operator!=(const CoinIndexedVector &rhs) const;
351  int isApproximatelyEqual(const CoinIndexedVector &rhs, double tolerance = 1.0e-8) const;
353 
356  int getMaxIndex() const;
359  int getMinIndex() const;
361 
365  void sort()
366  {
367  std::sort(indices_, indices_ + nElements_);
368  }
369 
371  {
372  std::sort(indices_, indices_ + nElements_);
373  }
374 
375  void sortDecrIndex();
376 
377  void sortIncrElement();
378 
379  void sortDecrElement();
380  void sortPacked();
381 
383 
384  //#############################################################################
385 
399  const CoinIndexedVector &op2);
400 
403  const CoinIndexedVector &op2);
404 
407  const CoinIndexedVector &op2);
408 
411  const CoinIndexedVector &op2);
413  void operator+=(const CoinIndexedVector &op2);
414 
416  void operator-=(const CoinIndexedVector &op2);
417 
419  void operator*=(const CoinIndexedVector &op2);
420 
422  void operator/=(const CoinIndexedVector &op2);
424 
431  void reserve(int n);
435  inline int capacity() const { return capacity_; }
436  inline void setCapacity(int value)
437  {
438  capacity_ = value;
439  }
441  inline void setPackedMode(bool yesNo)
442  {
443  packedMode_ = yesNo;
444  }
446  inline bool packedMode() const
447  {
448  return packedMode_;
449  }
451 
457  CoinIndexedVector(int size, const int *inds, const double *elems);
459  CoinIndexedVector(int size, const int *inds, double element);
462  CoinIndexedVector(int size, const double *elements);
464  CoinIndexedVector(int size);
469 #ifndef CLP_NO_VECTOR
470 
472 #endif
473 
476 
477 private:
480  void gutsOfSetVector(int size,
482  const int *inds, const double *elems);
483  void gutsOfSetVector(int size, int numberIndices,
484  const int *inds, const double *elems);
485  void gutsOfSetPackedVector(int size, int numberIndices,
486  const int *inds, const double *elems);
488  void gutsOfSetConstant(int size,
489  const int *inds, double value);
491 
492 protected:
495  int *indices_;
498  double *elements_;
504  int offset_;
508 };
509 
510 //#############################################################################
534 
535 public:
538  inline CoinBigIndex getSize() const
540  {
541  return static_cast< CoinBigIndex >(size_);
542  }
544  inline CoinBigIndex rawSize() const
545  {
546  return static_cast< CoinBigIndex >(size_);
547  }
549  inline bool switchedOn() const
550  {
551  return size_ != -1;
552  }
554  inline CoinBigIndex capacity() const
555  {
556  return (size_ > -2) ? static_cast< CoinBigIndex >(size_) : static_cast< CoinBigIndex >((-size_) - 2);
557  }
559  inline void setCapacity()
560  {
561  if (size_ <= -2)
562  size_ = (-size_) - 2;
563  }
565  inline const char *array() const
566  {
567  return (size_ > -2) ? array_ : NULL;
568  }
570 
573  inline void setSize(int value)
575  {
576  size_ = value;
577  }
578 #if COIN_BIG_INDEX
579  inline void setSize(long long value)
581  {
582  size_ = value;
583  }
584 #endif
585  inline void switchOff()
587  {
588  size_ = -1;
589  }
591  inline void switchOn(int alignment = 3)
592  {
593  size_ = -2;
594  alignment_ = alignment;
595  }
597  void setPersistence(int flag, int currentLength);
599  void clear();
601  void swap(CoinArrayWithLength &other);
603  void extend(int newSize);
604 #if COIN_BIG_INDEX
605  void extend(long long newSize);
607 #endif
608 
609 
612  char *conditionalNew(CoinBigIndex sizeWanted);
615  void conditionalDelete();
617 
622  : array_(NULL)
623  , size_(-1)
624  , offset_(0)
625  , alignment_(0)
626  {
627  }
630  : size_(-1)
631  , offset_(0)
632  , alignment_(0)
633  {
634  array_ = new char[size];
635  }
642  CoinArrayWithLength(CoinBigIndex size, int mode);
650  void copy(const CoinArrayWithLength &rhs, int numberBytes = -1);
652  void allocate(const CoinArrayWithLength &rhs, CoinBigIndex numberBytes);
656  void getArray(CoinBigIndex size);
658  void reallyFreeArray();
660  void getCapacity(CoinBigIndex numberBytes, CoinBigIndex numberIfNeeded = -1);
662 
663 protected:
666  char *array_;
671  int offset_;
675 };
677 
679 
680 public:
683  inline CoinBigIndex getSize() const
685  {
686  return size_ / CoinSizeofAsInt(double);
687  }
689  inline double *array() const
690  {
691  return reinterpret_cast< double * >((size_ > -2) ? array_ : NULL);
692  }
694 
697  inline void setSize(int value)
699  {
700  size_ = value * CoinSizeofAsInt(double);
701  }
703 
706  inline double *conditionalNew(CoinBigIndex sizeWanted)
708  {
709  return reinterpret_cast< double * >(CoinArrayWithLength::conditionalNew(sizeWanted >= 0 ? static_cast< long long >((sizeWanted)*CoinSizeofAsInt(double)) : -1));
710  }
712 
717  {
718  array_ = NULL;
719  size_ = -1;
720  }
722  inline CoinDoubleArrayWithLength(int size)
723  {
724  array_ = new char[size * CoinSizeofAsInt(double)];
725  size_ = -1;
726  }
731  inline CoinDoubleArrayWithLength(int size, int mode)
732  : CoinArrayWithLength(size * CoinSizeofAsInt(double), mode)
733  {
734  }
737  : CoinArrayWithLength(rhs)
738  {
739  }
742  : CoinArrayWithLength(rhs)
743  {
744  }
747  {
749  return *this;
750  }
752 };
754 
756 
757 public:
760  inline CoinBigIndex getSize() const
762  {
764  }
767  {
768  return reinterpret_cast< CoinFactorizationDouble * >((size_ > -2) ? array_ : NULL);
769  }
771 
774  inline void setSize(int value)
776  {
778  }
780 
785  {
786  return reinterpret_cast< CoinFactorizationDouble * >(CoinArrayWithLength::conditionalNew(sizeWanted >= 0 ? static_cast< long long >((sizeWanted)*CoinSizeofAsInt(CoinFactorizationDouble)) : -1));
787  }
789 
794  {
795  array_ = NULL;
796  size_ = -1;
797  }
800  {
801  array_ = new char[size * CoinSizeofAsInt(CoinFactorizationDouble)];
802  size_ = -1;
803  }
808  inline CoinFactorizationDoubleArrayWithLength(int size, int mode)
810  {
811  }
814  : CoinArrayWithLength(rhs)
815  {
816  }
819  : CoinArrayWithLength(rhs)
820  {
821  }
824  {
826  return *this;
827  }
829 };
831 
833 
834 public:
837  inline CoinBigIndex getSize() const
839  {
840  return size_ / CoinSizeofAsInt(long double);
841  }
843  inline long double *array() const
844  {
845  return reinterpret_cast< long double * >((size_ > -2) ? array_ : NULL);
846  }
848 
851  inline void setSize(int value)
853  {
854  size_ = value * CoinSizeofAsInt(long double);
855  }
857 
860  inline long double *conditionalNew(CoinBigIndex sizeWanted)
862  {
863  return reinterpret_cast< long double * >(CoinArrayWithLength::conditionalNew(sizeWanted >= 0 ? static_cast< long long >((sizeWanted)*CoinSizeofAsInt(long double)) : -1));
864  }
866 
871  {
872  array_ = NULL;
873  size_ = -1;
874  }
877  {
878  array_ = new char[size * CoinSizeofAsInt(long double)];
879  size_ = -1;
880  }
886  : CoinArrayWithLength(size * CoinSizeofAsInt(long double), mode)
887  {
888  }
891  : CoinArrayWithLength(rhs)
892  {
893  }
896  : CoinArrayWithLength(rhs)
897  {
898  }
901  {
903  return *this;
904  }
906 };
908 
910 
911 public:
914  inline CoinBigIndex getSize() const
916  {
917  return size_ / CoinSizeofAsInt(int);
918  }
920  inline int *array() const
921  {
922  return reinterpret_cast< int * >((size_ > -2) ? array_ : NULL);
923  }
925 
928  inline void setSize(int value)
930  {
931  size_ = value * CoinSizeofAsInt(int);
932  }
934 
937  inline int *conditionalNew(CoinBigIndex sizeWanted)
939  {
940  return reinterpret_cast< int * >(CoinArrayWithLength::conditionalNew(sizeWanted >= 0 ? static_cast< long long >((sizeWanted)*CoinSizeofAsInt(int)) : -1));
941  }
943 
948  {
949  array_ = NULL;
950  size_ = -1;
951  }
953  inline CoinIntArrayWithLength(int size)
954  {
955  array_ = new char[size * CoinSizeofAsInt(int)];
956  size_ = -1;
957  }
962  inline CoinIntArrayWithLength(int size, int mode)
963  : CoinArrayWithLength(size * CoinSizeofAsInt(int), mode)
964  {
965  }
968  : CoinArrayWithLength(rhs)
969  {
970  }
973  : CoinArrayWithLength(rhs)
974  {
975  }
978  {
980  return *this;
981  }
983 };
985 
987 
988 public:
991  inline CoinBigIndex getSize() const
993  {
995  }
997  inline CoinBigIndex *array() const
998  {
999  return reinterpret_cast< CoinBigIndex * >((size_ > -2) ? array_ : NULL);
1000  }
1002 
1005  inline void setSize(CoinBigIndex value)
1007  {
1008  size_ = value * CoinSizeofAsInt(CoinBigIndex);
1009  }
1011 
1014  inline CoinBigIndex *conditionalNew(CoinBigIndex sizeWanted)
1016  {
1017  return reinterpret_cast< CoinBigIndex * >(CoinArrayWithLength::conditionalNew(sizeWanted >= 0 ? static_cast< long long >((sizeWanted)*CoinSizeofAsInt(CoinBigIndex)) : -1));
1018  }
1020 
1025  {
1026  array_ = NULL;
1027  size_ = -1;
1028  }
1031  {
1032  array_ = new char[size * CoinSizeofAsInt(CoinBigIndex)];
1033  size_ = -1;
1034  }
1041  {
1042  }
1045  : CoinArrayWithLength(rhs)
1046  {
1047  }
1050  : CoinArrayWithLength(rhs)
1051  {
1052  }
1055  {
1057  return *this;
1058  }
1060 };
1062 
1064 
1065 public:
1068  inline CoinBigIndex getSize() const
1070  {
1071  return size_ / CoinSizeofAsInt(unsigned int);
1072  }
1074  inline unsigned int *array() const
1075  {
1076  return reinterpret_cast< unsigned int * >((size_ > -2) ? array_ : NULL);
1077  }
1079 
1082  inline void setSize(int value)
1084  {
1085  size_ = value * CoinSizeofAsInt(unsigned int);
1086  }
1088 
1091  inline unsigned int *conditionalNew(CoinBigIndex sizeWanted)
1093  {
1094  return reinterpret_cast< unsigned int * >(CoinArrayWithLength::conditionalNew(sizeWanted >= 0 ? static_cast< long long >((sizeWanted)*CoinSizeofAsInt(unsigned int)) : -1));
1095  }
1097 
1102  {
1103  array_ = NULL;
1104  size_ = -1;
1105  }
1108  {
1109  array_ = new char[size * CoinSizeofAsInt(unsigned int)];
1110  size_ = -1;
1111  }
1116  inline CoinUnsignedIntArrayWithLength(int size, int mode)
1117  : CoinArrayWithLength(size * CoinSizeofAsInt(unsigned int), mode)
1118  {
1119  }
1122  : CoinArrayWithLength(rhs)
1123  {
1124  }
1127  : CoinArrayWithLength(rhs)
1128  {
1129  }
1132  {
1134  return *this;
1135  }
1137 };
1139 
1141 
1142 public:
1145  inline CoinBigIndex getSize() const
1147  {
1148  return size_ / CoinSizeofAsInt(void *);
1149  }
1151  inline void **array() const
1152  {
1153  return reinterpret_cast< void ** >((size_ > -2) ? array_ : NULL);
1154  }
1156 
1159  inline void setSize(int value)
1161  {
1162  size_ = value * CoinSizeofAsInt(void *);
1163  }
1165 
1168  inline void **conditionalNew(CoinBigIndex sizeWanted)
1170  {
1171  return reinterpret_cast< void ** >(CoinArrayWithLength::conditionalNew(sizeWanted >= 0 ? static_cast< long long >((sizeWanted)*CoinSizeofAsInt(void *)) : -1));
1172  }
1174 
1179  {
1180  array_ = NULL;
1181  size_ = -1;
1182  }
1185  {
1186  array_ = new char[size * CoinSizeofAsInt(void *)];
1187  size_ = -1;
1188  }
1193  inline CoinVoidStarArrayWithLength(int size, int mode)
1194  : CoinArrayWithLength(size * CoinSizeofAsInt(void *), mode)
1195  {
1196  }
1199  : CoinArrayWithLength(rhs)
1200  {
1201  }
1204  : CoinArrayWithLength(rhs)
1205  {
1206  }
1209  {
1211  return *this;
1212  }
1214 };
1216 
1218 
1219 public:
1222  inline CoinBigIndex getSize() const
1224  {
1225  return size_ / lengthInBytes_;
1226  }
1228  inline void **array() const
1229  {
1230  return reinterpret_cast< void ** >((size_ > -2) ? array_ : NULL);
1231  }
1233 
1236  inline void setSize(int value)
1238  {
1239  size_ = value * lengthInBytes_;
1240  }
1242 
1245  inline char *conditionalNew(CoinBigIndex length, CoinBigIndex sizeWanted)
1247  {
1248  lengthInBytes_ = length;
1249  return reinterpret_cast< char * >(CoinArrayWithLength::conditionalNew(sizeWanted >= 0 ? static_cast< long long >((sizeWanted)*lengthInBytes_) : -1));
1250  }
1252 
1256  inline CoinArbitraryArrayWithLength(int length = 1)
1257  {
1258  array_ = NULL;
1259  size_ = -1;
1260  lengthInBytes_ = length;
1261  }
1263  inline CoinArbitraryArrayWithLength(int length, int size)
1264  {
1265  array_ = new char[size * length];
1266  size_ = -1;
1267  lengthInBytes_ = length;
1268  }
1273  inline CoinArbitraryArrayWithLength(int length, int size, int mode)
1274  : CoinArrayWithLength(size * length, mode)
1275  {
1276  lengthInBytes_ = length;
1277  }
1280  : CoinArrayWithLength(rhs)
1281  {
1282  }
1285  : CoinArrayWithLength(rhs)
1286  {
1287  }
1290  {
1292  return *this;
1293  }
1295 
1296 protected:
1302 };
1304 
1305 public:
1306 #ifndef COIN_PARTITIONS
1307 #define COIN_PARTITIONS 8
1308 #endif
1309 
1311  inline int getNumElements(int partition) const
1313  {
1314  assert(partition < COIN_PARTITIONS);
1315  return numberElementsPartition_[partition];
1316  }
1318  inline int getNumPartitions() const
1319  {
1320  return numberPartitions_;
1321  }
1323  inline int getNumElements() const { return nElements_; }
1325  inline int startPartition(int partition) const
1326  {
1327  assert(partition <= COIN_PARTITIONS);
1328  return startPartition_[partition];
1329  }
1331  inline const int *startPartitions() const
1332  {
1333  return startPartition_;
1334  }
1336 
1337  //-------------------------------------------------------------------
1338  // Set indices and elements
1339  //-------------------------------------------------------------------
1342  inline void setNumElementsPartition(int partition, int value)
1344  {
1345  assert(partition < COIN_PARTITIONS);
1346  if (numberPartitions_)
1347  numberElementsPartition_[partition] = value;
1348  }
1350  inline void setTempNumElementsPartition(int partition, int value)
1351  {
1352  assert(partition < COIN_PARTITIONS);
1353  numberElementsPartition_[partition] = value;
1354  }
1356  void computeNumberElements();
1358  void compact();
1361  void reserve(int n);
1363  void setPartitions(int number, const int *starts);
1365  void clearAndReset();
1367  void clearAndKeep();
1369  void clearPartition(int partition);
1370 #ifndef NDEBUG
1371  void checkClear();
1374  void checkClean();
1375 #else
1376  inline void checkClear() {};
1377  inline void checkClean() {};
1378 #endif
1379  int scan(int partition, double tolerance = 0.0);
1384  void print() const;
1387 
1391  void sort();
1393 
1399  CoinPartitionedVector(int size, const int *inds, const double *elems);
1401  CoinPartitionedVector(int size, const int *inds, double element);
1404  CoinPartitionedVector(int size, const double *elements);
1406  CoinPartitionedVector(int size);
1416 protected:
1426 };
1427 inline double *roundUpDouble(double *address)
1428 {
1429  // align on 64 byte boundary
1430  CoinInt64 xx = reinterpret_cast< CoinInt64 >(address);
1431  int iBottom = static_cast< int >(xx & 63);
1432  if (iBottom)
1433  return address + ((64 - iBottom) >> 3);
1434  else
1435  return address;
1436 }
1437 #endif
CoinSizeofAsInt
#define CoinSizeofAsInt(type)
Cube Root.
Definition: CoinHelperFunctions.hpp:1078
CoinFactorizationLongDoubleArrayWithLength::operator=
CoinFactorizationLongDoubleArrayWithLength & operator=(const CoinFactorizationLongDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:900
CoinPackedVectorBase.hpp
CoinIndexedVector::isApproximatelyEqual
int isApproximatelyEqual(const CoinIndexedVector &rhs, double tolerance=1.0e-8) const
Equal with a tolerance (returns -1 or position of inequality).
CoinIndexedVector
Indexed Vector.
Definition: CoinIndexedVector.hpp:104
CoinIndexedVectorUnitTest
void CoinIndexedVectorUnitTest()
A function that tests the methods in the CoinIndexedVector class.
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(const CoinIntArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:967
CoinIndexedVector::offset_
int offset_
Offset to get where new allocated array.
Definition: CoinIndexedVector.hpp:504
CoinPartitionedVector::clearPartition
void clearPartition(int partition)
Clear a partition.
CoinIndexedVector::cleanAndPackSafe
int cleanAndPackSafe(double tolerance)
Same but packs down and is safe (i.e. if order is odd)
COIN_INDEXED_TINY_ELEMENT
#define COIN_INDEXED_TINY_ELEMENT
Definition: CoinIndexedVector.hpp:24
CoinArrayWithLength::allocate
void allocate(const CoinArrayWithLength &rhs, CoinBigIndex numberBytes)
Assignment with length - does not copy.
CoinIndexedVector::setPackedMode
void setPackedMode(bool yesNo)
Sets packed mode.
Definition: CoinIndexedVector.hpp:441
CoinIndexedVector::getIndices
int * getIndices()
Get element values.
Definition: CoinIndexedVector.hpp:117
CoinIndexedVector::zero
void zero(int index)
Makes nonzero tiny.
Definition: CoinIndexedVector.hpp:253
CoinArrayWithLength::switchOff
void switchOff()
Set the size to -1.
Definition: CoinIndexedVector.hpp:586
CoinPartitionedVector::numberPartitions_
int numberPartitions_
Number of partitions (0 means off)
Definition: CoinIndexedVector.hpp:1424
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(const CoinUnsignedIntArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:1126
CoinIndexedVector::denseVector
double * denseVector() const
Get the vector as a dense vector.
Definition: CoinIndexedVector.hpp:121
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(int size, int mode)
Alternate Constructor - length in bytes mode - 0 size_ set to size 1 size_ set to size and zeroed.
Definition: CoinIndexedVector.hpp:885
CoinFactorizationDoubleArrayWithLength::operator=
CoinFactorizationDoubleArrayWithLength & operator=(const CoinFactorizationDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:823
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(const CoinVoidStarArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:1198
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(CoinBigIndex size, int mode)
Alternate Constructor - length in bytes mode - 0 size_ set to size 1 size_ set to size and zeroed.
Definition: CoinIndexedVector.hpp:1039
CoinIndexedVector::clear
void clear()
Reset the vector (as if were just created an empty vector). This leaves arrays!
CoinArrayWithLength::setCapacity
void setCapacity()
Set the capacity to >=0 if <=-2.
Definition: CoinIndexedVector.hpp:559
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(const CoinBigIndexArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:1049
CoinArrayWithLength::operator=
CoinArrayWithLength & operator=(const CoinArrayWithLength &rhs)
Assignment operator.
CoinArrayWithLength::CoinArrayWithLength
CoinArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:621
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:716
CoinDoubleArrayWithLength::getSize
CoinBigIndex getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:684
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(int length, int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:1263
CoinArbitraryArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:1237
CoinArbitraryArrayWithLength::operator=
CoinArbitraryArrayWithLength & operator=(const CoinArbitraryArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:1289
CoinIndexedVector::CoinIndexedVectorUnitTest
friend void CoinIndexedVectorUnitTest()
A function that tests the methods in the CoinIndexedVector class.
CoinIndexedVector::nElements_
int nElements_
Size of indices and packed elements vectors.
Definition: CoinIndexedVector.hpp:500
CoinIndexedVector::insert
void insert(int index, double element)
Insert an element into the vector.
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:953
CoinIndexedVector::packedMode_
bool packedMode_
If true then is operating in packed mode.
Definition: CoinIndexedVector.hpp:506
CoinIndexedVector::operator*=
void operator*=(double value)
multiply every entry by value
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(const CoinFactorizationLongDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:895
CoinVoidStarArrayWithLength::getSize
CoinBigIndex getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:1146
CoinPartitionedVector::CoinPartitionedVector
CoinPartitionedVector()
Default constructor.
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(const CoinIntArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:972
CoinBigIndexArrayWithLength::getSize
CoinBigIndex getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:992
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:1178
CoinIndexedVector::indices_
int * indices_
Vector indices.
Definition: CoinIndexedVector.hpp:496
CoinIndexedVector::getMinIndex
int getMinIndex() const
Get value of minimum index.
CoinIndexedVector::setNumElements
void setNumElements(int value)
Set the size.
Definition: CoinIndexedVector.hpp:144
CoinIndexedVector::operator/=
void operator/=(double value)
divide every entry by value (** 0 vanishes)
CoinIntArrayWithLength::conditionalNew
int * conditionalNew(CoinBigIndex sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:938
CoinUnsignedIntArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:1083
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:722
CoinArrayWithLength::conditionalNew
char * conditionalNew(CoinBigIndex sizeWanted)
Conditionally gets new array.
CoinIndexedVector::~CoinIndexedVector
~CoinIndexedVector()
Destructor.
CoinSort.hpp
CoinPartitionedVector::setNumElementsPartition
void setNumElementsPartition(int partition, int value)
Set the size of a partition.
Definition: CoinIndexedVector.hpp:1343
CoinArrayWithLength::rawSize
CoinBigIndex rawSize() const
Get the size.
Definition: CoinIndexedVector.hpp:544
CoinIndexedVector::operator-
CoinIndexedVector operator-(const CoinIndexedVector &op2)
Return the difference of two indexed vectors.
CoinIndexedVector::truncate
void truncate(int newSize)
Throw away all entries in rows >= newSize.
CoinIndexedVector::sortIncrIndex
void sortIncrIndex()
Definition: CoinIndexedVector.hpp:370
CoinArbitraryArrayWithLength::array
void ** array() const
Get Array.
Definition: CoinIndexedVector.hpp:1228
CoinDoubleArrayWithLength::array
double * array() const
Get Array.
Definition: CoinIndexedVector.hpp:689
CoinPartitionedVector::~CoinPartitionedVector
~CoinPartitionedVector()
Destructor.
CoinFactorizationDoubleArrayWithLength::array
CoinFactorizationDouble * array() const
Get Array.
Definition: CoinIndexedVector.hpp:766
CoinPartitionedVector::print
void print() const
Scan dense region from start to < end and set up indices returns number found.
CoinIndexedVector::clean
int clean(double tolerance)
set all small values to zero and return number remaining
CoinPartitionedVector::setPartitions
void setPartitions(int number, const int *starts)
Setup partitions (needs end as well)
CoinVoidStarArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:1160
CoinArrayWithLength::getSize
CoinBigIndex getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:539
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:793
CoinIndexedVector::quickAddNonZero
void quickAddNonZero(int index, double element)
Insert or if exists add an element into the vector Any resulting zero elements will be made tiny.
Definition: CoinIndexedVector.hpp:235
CoinFactorizationDoubleArrayWithLength::getSize
CoinBigIndex getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:761
CoinIndexedVector::setVector
void setVector(int numberIndices, const int *inds, const double *elems)
Set vector numberIndices, indices, and elements.
CoinIndexedVector::operator+=
void operator+=(double value)
add value to every entry
CoinArrayWithLength::getArray
void getArray(CoinBigIndex size)
Get array with alignment.
CoinIndexedVector::operator[]
double & operator[](int i) const
Access the i'th element of the full storage vector.
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(int size, int mode)
Alternate Constructor - length in bytes mode - 0 size_ set to size 1 size_ set to size and zeroed.
Definition: CoinIndexedVector.hpp:1116
CoinIndexedVector::getMaxIndex
int getMaxIndex() const
Get value of maximum index.
CoinIndexedVector::gutsOfSetPackedVector
void gutsOfSetPackedVector(int size, int numberIndices, const int *inds, const double *elems)
CoinIntArrayWithLength::array
int * array() const
Get Array.
Definition: CoinIndexedVector.hpp:920
CoinIndexedVector::gutsOfSetConstant
void gutsOfSetConstant(int size, const int *inds, double value)
CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDouble * version.
Definition: CoinIndexedVector.hpp:832
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(int size, int mode)
Alternate Constructor - length in bytes mode - 0 size_ set to size 1 size_ set to size and zeroed.
Definition: CoinIndexedVector.hpp:962
CoinPartitionedVector::getNumPartitions
int getNumPartitions() const
Get number of partitions.
Definition: CoinIndexedVector.hpp:1318
CoinPartitionedVector::startPartition_
int startPartition_[COIN_PARTITIONS+1]
Starts.
Definition: CoinIndexedVector.hpp:1420
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(int length=1)
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:1256
CoinInt64
#define CoinInt64
Definition: CoinTypes.hpp:18
CoinIntArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:929
CoinIndexedVector::gutsOfSetVector
void gutsOfSetVector(int size, const int *inds, const double *elems)
Copy internal data.
CoinIndexedVector::operator+
CoinIndexedVector operator+(const CoinIndexedVector &op2)
Return the sum of two indexed vectors.
CoinVoidStarArrayWithLength::conditionalNew
void ** conditionalNew(CoinBigIndex sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:1169
CoinIndexedVector::createUnpacked
void createUnpacked(int number, const int *indices, const double *elements)
Create unpacked array.
CoinArrayWithLength
Pointer with length in bytes.
Definition: CoinIndexedVector.hpp:533
CoinPartitionedVector::computeNumberElements
void computeNumberElements()
Add up number of elements in partitions.
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(const CoinDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:741
CoinIndexedVector::checkClear
void checkClear()
For debug check vector is clear i.e. no elements.
CoinUnsignedIntArrayWithLength::array
unsigned int * array() const
Get Array.
Definition: CoinIndexedVector.hpp:1074
CoinBigIndexArrayWithLength::array
CoinBigIndex * array() const
Get Array.
Definition: CoinIndexedVector.hpp:997
CoinArrayWithLength::offset_
int offset_
Offset of array.
Definition: CoinIndexedVector.hpp:671
CoinIndexedVector::append
void append(const CoinPackedVectorBase &caboose)
Append a CoinPackedVector to the end.
CoinIndexedVector::add
void add(int index, double element)
Insert or if exists add an element into the vector Any resulting zero elements will be made tiny.
CoinArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:574
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(const CoinDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:736
CoinFinite.hpp
CoinPartitionedVector::checkClean
void checkClean()
For debug check vector is clean i.e. elements match indices.
CoinFactorizationLongDoubleArrayWithLength::conditionalNew
long double * conditionalNew(CoinBigIndex sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:861
CoinPartitionedVector::operator=
CoinPartitionedVector & operator=(const CoinPartitionedVector &)
Assignment operator.
CoinIndexedVector::sortDecrIndex
void sortDecrIndex()
CoinVoidStarArrayWithLength::operator=
CoinVoidStarArrayWithLength & operator=(const CoinVoidStarArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:1208
CoinArrayWithLength::getCapacity
void getCapacity(CoinBigIndex numberBytes, CoinBigIndex numberIfNeeded=-1)
Get enough space (if more needed then do at least needed)
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(int size, int mode)
Alternate Constructor - length in bytes mode - 0 size_ set to size 1 size_ set to size and zeroed.
Definition: CoinIndexedVector.hpp:1193
CoinArrayWithLength::alignment_
int alignment_
Alignment wanted (power of 2)
Definition: CoinIndexedVector.hpp:673
CoinArrayWithLength::switchOn
void switchOn(int alignment=3)
Set the size to -2 and alignment.
Definition: CoinIndexedVector.hpp:591
CoinFactorizationDouble
double CoinFactorizationDouble
Definition: CoinTypes.hpp:57
CoinFactorizationDoubleArrayWithLength::conditionalNew
CoinFactorizationDouble * conditionalNew(CoinBigIndex sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:784
CoinIndexedVector::returnVector
void returnVector()
Return ownership of the arguments to this vector.
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(const CoinVoidStarArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:1203
CoinIndexedVector::setIndexVector
void setIndexVector(int *array)
For very temporary use when user needs to borrow an index vector.
Definition: CoinIndexedVector.hpp:128
CoinIndexedVector::setPacked
void setPacked()
Mark as packed.
Definition: CoinIndexedVector.hpp:266
CoinPartitionedVector::numberElementsPartition_
int numberElementsPartition_[COIN_PARTITIONS]
Size of indices in a partition.
Definition: CoinIndexedVector.hpp:1422
CoinIntArrayWithLength::getSize
CoinBigIndex getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:915
CoinVoidStarArrayWithLength
void * version
Definition: CoinIndexedVector.hpp:1140
CoinUnsignedIntArrayWithLength::operator=
CoinUnsignedIntArrayWithLength & operator=(const CoinUnsignedIntArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:1131
CoinArrayWithLength::setPersistence
void setPersistence(int flag, int currentLength)
Does what is needed to set persistence.
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(int size, int mode)
Alternate Constructor - length in bytes mode - 0 size_ set to size 1 size_ set to size and zeroed.
Definition: CoinIndexedVector.hpp:808
CoinArrayWithLength::switchedOn
bool switchedOn() const
See if persistence already on.
Definition: CoinIndexedVector.hpp:549
CoinIndexedVector::cleanAndPack
int cleanAndPack(double tolerance)
Same but packs down.
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:136
CoinDoubleArrayWithLength::operator=
CoinDoubleArrayWithLength & operator=(const CoinDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:746
CoinIndexedVector::CoinIndexedVector
CoinIndexedVector()
Default constructor.
CoinPartitionedVector
Definition: CoinIndexedVector.hpp:1303
CoinIndexedVector::sortIncrElement
void sortIncrElement()
CoinIndexedVector::createPacked
void createPacked(int number, const int *indices, const double *elements)
Create packed array.
CoinPartitionedVector::sort
void sort()
Sort the indexed storage vector (increasing indices).
CoinArrayWithLength::clear
void clear()
Zero out array.
CoinPartitionedVector::compact
void compact()
Add up number of elements in partitions and pack and get rid of partitions.
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(const CoinUnsignedIntArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:1121
CoinIndexedVector::swap
void swap(int i, int j)
Swap values in positions i and j of indices and elements.
CoinIndexedVector::borrowVector
void borrowVector(int size, int numberIndices, int *inds, double *elems)
Borrow ownership of the arguments to this vector.
CoinPartitionedVector::checkClear
void checkClear()
For debug check vector is clear i.e. no elements.
CoinIntArrayWithLength
int * version
Definition: CoinIndexedVector.hpp:909
CoinArrayWithLength::copy
void copy(const CoinArrayWithLength &rhs, int numberBytes=-1)
Assignment with length (if -1 use internal length)
CoinArrayWithLength::reallyFreeArray
void reallyFreeArray()
Really get rid of array with alignment.
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
CoinDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:698
CoinArrayWithLength::capacity
CoinBigIndex capacity() const
Get the capacity (just read it)
Definition: CoinIndexedVector.hpp:554
CoinIndexedVector::operator=
CoinIndexedVector & operator=(const CoinIndexedVector &)
Assignment operator.
CoinIndexedVector::setDenseVector
void setDenseVector(double *array)
For very temporary use when user needs to borrow a dense vector.
Definition: CoinIndexedVector.hpp:123
CoinIndexedVector::operator-=
void operator-=(double value)
subtract value from every entry
CoinHelperFunctions.hpp
CoinFactorizationLongDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:852
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:1107
CoinIndexedVector::operator==
bool operator==(const CoinPackedVectorBase &rhs) const
Equal.
CoinArbitraryArrayWithLength::lengthInBytes_
CoinBigIndex lengthInBytes_
Length in bytes.
Definition: CoinIndexedVector.hpp:1300
CoinIndexedVector::operator*
CoinIndexedVector operator*(const CoinIndexedVector &op2)
Return the element-wise product of two indexed vectors.
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:876
CoinIndexedVector::expand
void expand()
This is mainly for testing - goes from packed to indexed.
CoinVoidStarArrayWithLength::array
void ** array() const
Get Array.
Definition: CoinIndexedVector.hpp:1151
CoinPartitionedVector::setTempNumElementsPartition
void setTempNumElementsPartition(int partition, int value)
Set the size of a partition (just for a tiny while)
Definition: CoinIndexedVector.hpp:1350
CoinFactorizationLongDoubleArrayWithLength::getSize
CoinBigIndex getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:838
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(const CoinFactorizationLongDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:890
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(const CoinArbitraryArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:1279
CoinPartitionedVector::startPartition
int startPartition(int partition) const
Get starts.
Definition: CoinIndexedVector.hpp:1325
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:947
CoinFactorizationDoubleArrayWithLength
CoinFactorizationDouble * version.
Definition: CoinIndexedVector.hpp:755
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:1024
CoinIndexedVector::getIndices
const int * getIndices() const
Get indices of elements.
Definition: CoinIndexedVector.hpp:113
CoinArrayWithLength::swap
void swap(CoinArrayWithLength &other)
Swaps memory between two members.
CoinBigIndexArrayWithLength::setSize
void setSize(CoinBigIndex value)
Set the size.
Definition: CoinIndexedVector.hpp:1006
CoinIndexedVector::scan
int scan()
Scan dense region and set up indices (returns number found)
roundUpDouble
double * roundUpDouble(double *address)
Definition: CoinIndexedVector.hpp:1427
CoinIndexedVector::quickAdd
void quickAdd(int index, double element)
Insert or if exists add an element into the vector Any resulting zero elements will be made tiny.
Definition: CoinIndexedVector.hpp:216
CoinIndexedVector::capacity_
int capacity_
Amount of memory allocated for indices_, and elements_.
Definition: CoinIndexedVector.hpp:502
CoinArbitraryArrayWithLength::getSize
CoinBigIndex getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:1223
COIN_DBL_MIN
const double COIN_DBL_MIN
Definition: CoinFinite.hpp:17
CoinArrayWithLength::array_
char * array_
Array.
Definition: CoinIndexedVector.hpp:667
CoinIndexedVector::empty
void empty()
Reset the vector (as if were just created an empty vector)
CoinUnsignedIntArrayWithLength
unsigned int * version
Definition: CoinIndexedVector.hpp:1063
CoinIndexedVector::setCapacity
void setCapacity(int value)
Definition: CoinIndexedVector.hpp:436
CoinIndexedVector::getNumElements
int getNumElements() const
Get the size.
Definition: CoinIndexedVector.hpp:111
CoinIntArrayWithLength::operator=
CoinIntArrayWithLength & operator=(const CoinIntArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:977
CoinArrayWithLength::conditionalDelete
void conditionalDelete()
Conditionally deletes.
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:1184
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:870
CoinIndexedVector::capacity
int capacity() const
capacity returns the size which could be accomodated without having to reallocate storage.
Definition: CoinIndexedVector.hpp:435
CoinIndexedVector::setFull
void setFull(int size, const double *elems)
Indices are not specified and are taken to be 0,1,...,size-1.
CoinIndexedVector::sortPacked
void sortPacked()
CoinIndexedVector::createOneUnpackedElement
void createOneUnpackedElement(int index, double element)
Create unpacked singleton.
CoinPartitionedVector::startPartitions
const int * startPartitions() const
Get starts.
Definition: CoinIndexedVector.hpp:1331
CoinIndexedVector::scanAndPack
int scanAndPack()
These are same but pack down.
CoinIndexedVector::operator/
CoinIndexedVector operator/(const CoinIndexedVector &op2)
Return the element-wise ratio of two indexed vectors (0.0/0.0 => 0.0) (0 vanishes)
CoinPartitionedVector::clearAndKeep
void clearAndKeep()
Reset the vector (as if were just created an empty vector). Keeps partitions.
CoinIndexedVector::print
void print() const
Print out.
CoinIndexedVector::operator!=
bool operator!=(const CoinPackedVectorBase &rhs) const
Not equal.
CoinDoubleArrayWithLength
double * version
Definition: CoinIndexedVector.hpp:678
CoinIndexedVector::checkClean
void checkClean()
For debug check vector is clean i.e. elements match indices.
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(CoinBigIndex size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:1030
CoinIndexedVector::reserve
void reserve(int n)
Reserve space.
CoinIndexedVector::sort
void sort()
Sort the indexed storage vector (increasing indices).
Definition: CoinIndexedVector.hpp:365
CoinFactorizationDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:775
CoinArbitraryArrayWithLength
arbitrary version
Definition: CoinIndexedVector.hpp:1217
CoinUnsignedIntArrayWithLength::conditionalNew
unsigned int * conditionalNew(CoinBigIndex sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:1092
CoinBigIndexArrayWithLength::conditionalNew
CoinBigIndex * conditionalNew(CoinBigIndex sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:1015
CoinArrayWithLength::size_
CoinBigIndex size_
Size of array in bytes.
Definition: CoinIndexedVector.hpp:669
CoinArrayWithLength::CoinArrayWithLength
CoinArrayWithLength(CoinBigIndex size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:629
CoinBigIndexArrayWithLength::operator=
CoinBigIndexArrayWithLength & operator=(const CoinBigIndexArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:1054
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(const CoinFactorizationDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:818
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:799
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(const CoinArbitraryArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:1284
CoinIndexedVector::packedMode
bool packedMode() const
Gets packed mode.
Definition: CoinIndexedVector.hpp:446
CoinIndexedVector::elements_
double * elements_
Vector elements.
Definition: CoinIndexedVector.hpp:498
CoinArrayWithLength::extend
void extend(int newSize)
Extend a persistent array keeping data (size in bytes)
CoinPartitionedVector::reserve
void reserve(int n)
Reserve space.
CoinIndexedVector::setConstant
void setConstant(int size, const int *inds, double elems)
Elements set to have the same scalar value.
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:1101
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(const CoinFactorizationDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:813
CoinIndexedVector::copy
void copy(const CoinIndexedVector &rhs, double multiplier=1.0)
Copy the contents of one vector into another.
CoinDoubleArrayWithLength::conditionalNew
double * conditionalNew(CoinBigIndex sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:707
CoinArrayWithLength::array
const char * array() const
Get Array.
Definition: CoinIndexedVector.hpp:565
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(int size, int mode)
Alternate Constructor - length in bytes mode - 0 size_ set to size 1 size_ set to size and zeroed.
Definition: CoinIndexedVector.hpp:731
CoinIndexedVector::reallyClear
void reallyClear()
Clear even if in a bad way.
CoinIndexedVector::quickInsert
void quickInsert(int index, double element)
Insert a nonzero element into the vector.
Definition: CoinIndexedVector.hpp:203
CoinPartitionedVector::clearAndReset
void clearAndReset()
Reset the vector (as if were just created an empty vector). Gets rid of partitions.
CoinUnsignedIntArrayWithLength::getSize
CoinBigIndex getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:1069
CoinIndexedVector::setElement
void setElement(int index, double element)
Set an existing element in the indexed vector The first argument is the "index" into the elements() a...
CoinFactorizationLongDoubleArrayWithLength::array
long double * array() const
Get Array.
Definition: CoinIndexedVector.hpp:843
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(int length, int size, int mode)
Alternate Constructor - length in bytes mode - 0 size_ set to size 1 size_ set to size and zeroed.
Definition: CoinIndexedVector.hpp:1273
CoinPartitionedVector::getNumElements
int getNumElements() const
Get the size.
Definition: CoinIndexedVector.hpp:1323
COIN_PARTITIONS
#define COIN_PARTITIONS
Definition: CoinIndexedVector.hpp:1307
CoinArrayWithLength::~CoinArrayWithLength
~CoinArrayWithLength()
Destructor.
CoinArbitraryArrayWithLength::conditionalNew
char * conditionalNew(CoinBigIndex length, CoinBigIndex sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:1246
CoinIndexedVector::sortDecrElement
void sortDecrElement()
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(const CoinBigIndexArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:1044
CoinBigIndexArrayWithLength
CoinBigIndex * version.
Definition: CoinIndexedVector.hpp:986