CoinUtils 2.10.15

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CoinIndexedVector.hpp
Go to the documentation of this file.
1 /* $Id: CoinIndexedVector.hpp 1767 2015-01-05 12:36:13Z forrest $ */
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
104 class CoinIndexedVector {
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 { elements_ = array;}
126 inline void setIndexVector(int * array)
127 { indices_ = array;}
130 double & operator[](int i) const;
131
133
134 //-------------------------------------------------------------------
135 // Set indices and elements
136 //-------------------------------------------------------------------
139 inline void setNumElements(int value) { nElements_ = value;
141 if (!nElements_) packedMode_=false;}
143 void clear();
145 void empty();
147 CoinIndexedVector & operator=(const CoinIndexedVector &);
148 #ifndef CLP_NO_VECTOR
149
151 CoinIndexedVector & operator=(const CoinPackedVectorBase & rhs);
152 #endif
153
156 void copy(const CoinIndexedVector & rhs, double multiplier=1.0);
157
160 void borrowVector(int size, int numberIndices, int* inds, double* elems);
161
165 void returnVector();
166
171 void setVector(int numberIndices, const int * inds, const double * elems);
172
177 void setVector(int size, int numberIndices, const int * inds, const double * elems);
178
180 void setConstant(int size, const int * inds, double elems);
181
183 void setFull(int size, const double * elems);
184
188 void setElement(int index, double element);
189
191 void insert(int index, double element);
193 inline void quickInsert(int index, double element)
194 {
195 assert (!elements_[index]);
196 indices_[nElements_++] = index;
197 assert (nElements_<=capacity_);
198 elements_[index] = element;
199 }
202 void add(int index, double element);
206 inline void quickAdd(int index, double element)
207 {
208 if (elements_[index]) {
209 element += elements_[index];
210 if ((element > 0 ? element : -element) >= COIN_INDEXED_TINY_ELEMENT) {
211 elements_[index] = element;
212 } else {
213 elements_[index] = 1.0e-100;
214 }
215 } else if ((element > 0 ? element : -element) >= COIN_INDEXED_TINY_ELEMENT) {
216 indices_[nElements_++] = index;
217 assert (nElements_<=capacity_);
218 elements_[index] = element;
219 }
220 }
225 inline void quickAddNonZero(int index, double element)
226 {
227 assert (element);
228 if (elements_[index]) {
229 element += elements_[index];
230 if ((element > 0 ? element : -element) >= COIN_INDEXED_TINY_ELEMENT) {
231 elements_[index] = element;
232 } else {
233 elements_[index] = COIN_DBL_MIN;
234 }
235 } else {
236 indices_[nElements_++] = index;
237 assert (nElements_<=capacity_);
238 elements_[index] = element;
239 }
240 }
243 inline void zero(int index)
244 {
245 if (elements_[index])
246 elements_[index] = COIN_DBL_MIN;
247 }
250 int clean(double tolerance);
252 int cleanAndPack(double tolerance);
254 int cleanAndPackSafe(double tolerance);
256 inline void setPacked()
257 { packedMode_ = true;}
258 #ifndef NDEBUG
259 void checkClear();
262 void checkClean();
263 #else
264 inline void checkClear() {};
265 inline void checkClean() {};
266 #endif
267 int scan();
272 int scan(int start, int end);
275 int scan(double tolerance);
279 int scan(int start, int end, double tolerance);
281 int scanAndPack();
282 int scanAndPack(int start, int end);
283 int scanAndPack(double tolerance);
284 int scanAndPack(int start, int end, double tolerance);
286 void createPacked(int number, const int * indices,
287 const double * elements);
289 void createUnpacked(int number, const int * indices,
290 const double * elements);
292 void createOneUnpackedElement(int index, double element);
294 void expand();
295 #ifndef CLP_NO_VECTOR
296 void append(const CoinPackedVectorBase & caboose);
298 #endif
299 void append(const CoinIndexedVector & caboose);
302 void append(CoinIndexedVector & other,int adjustIndex,bool zapElements=false);
303
305 void swap(int i, int j);
306
308 void truncate(int newSize);
310 void print() const;
312
314 void operator+=(double value);
317 void operator-=(double value);
319 void operator*=(double value);
321 void operator/=(double value);
323
326 #ifndef CLP_NO_VECTOR
327
329 bool operator==(const CoinPackedVectorBase & rhs) const;
331 bool operator!=(const CoinPackedVectorBase & rhs) const;
332 #endif
333
335 bool operator==(const CoinIndexedVector & rhs) const;
337 bool operator!=(const CoinIndexedVector & rhs) const;
339 int isApproximatelyEqual(const CoinIndexedVector & rhs, double tolerance=1.0e-8) const;
341
344 int getMaxIndex() const;
347 int getMinIndex() const;
349
350
354 void sort()
355 { std::sort(indices_,indices_+nElements_); }
356
357 void sortIncrIndex()
358 { std::sort(indices_,indices_+nElements_); }
359
360 void sortDecrIndex();
361
362 void sortIncrElement();
363
364 void sortDecrElement();
365 void sortPacked();
366
368
369 //#############################################################################
370
382 CoinIndexedVector operator+(
384 const CoinIndexedVector& op2);
385
387 CoinIndexedVector operator-(
388 const CoinIndexedVector& op2);
389
391 CoinIndexedVector operator*(
392 const CoinIndexedVector& op2);
393
395 CoinIndexedVector operator/(
396 const CoinIndexedVector& op2);
398 void operator+=(const CoinIndexedVector& op2);
399
401 void operator-=( const CoinIndexedVector& op2);
402
404 void operator*=(const CoinIndexedVector& op2);
405
407 void operator/=(const CoinIndexedVector& op2);
409
416 void reserve(int n);
420 inline int capacity() const { return capacity_; }
421 inline void setCapacity(int value)
422 { capacity_ = value; }
424 inline void setPackedMode(bool yesNo)
425 { packedMode_=yesNo;}
427 inline bool packedMode() const
428 { return packedMode_;}
430
434 CoinIndexedVector();
436 CoinIndexedVector(int size, const int * inds, const double * elems);
438 CoinIndexedVector(int size, const int * inds, double element);
441 CoinIndexedVector(int size, const double * elements);
443 CoinIndexedVector(int size);
445 CoinIndexedVector(const CoinIndexedVector &);
447 CoinIndexedVector(const CoinIndexedVector *);
448 #ifndef CLP_NO_VECTOR
449
450 CoinIndexedVector(const CoinPackedVectorBase & rhs);
451 #endif
452
453 ~CoinIndexedVector ();
455
456 private:
459 void gutsOfSetVector(int size,
461 const int * inds, const double * elems);
462 void gutsOfSetVector(int size, int numberIndices,
463 const int * inds, const double * elems);
464 void gutsOfSetPackedVector(int size, int numberIndices,
465 const int * inds, const double * elems);
467 void gutsOfSetConstant(int size,
468 const int * inds, double value);
470
471 protected:
474 int * indices_;
477 double * elements_;
479 int nElements_;
481 int capacity_;
483 int offset_;
485 bool packedMode_;
487 };
488
489 //#############################################################################
495 void
496 CoinIndexedVectorUnitTest();
513 class CoinArrayWithLength {
514
515 public:
518 inline int getSize() const
520 { return size_; }
522 inline int rawSize() const
523 { return size_; }
525 inline bool switchedOn() const
526 { return size_!=-1; }
528 inline int capacity() const
529 { return (size_>-2) ? size_ : (-size_)-2; }
531 inline void setCapacity()
532 { if (size_<=-2) size_ = (-size_)-2; }
534 inline const char * array() const
535 { return (size_>-2) ? array_ : NULL; }
537
540 inline void setSize(int value)
542 { size_ = value; }
544 inline void switchOff()
545 { size_ = -1; }
547 inline void switchOn(int alignment=3)
548 { size_ = -2; alignment_=alignment;}
550 void setPersistence(int flag,int currentLength);
552 void clear();
554 void swap(CoinArrayWithLength & other);
556 void extend(int newSize);
558
561 char * conditionalNew(long sizeWanted);
564 void conditionalDelete();
566
570 inline CoinArrayWithLength()
571 : array_(NULL),size_(-1),offset_(0),alignment_(0)
572 { }
574 inline CoinArrayWithLength(int size)
575 : size_(-1),offset_(0),alignment_(0)
576 { array_=new char [size];}
583 CoinArrayWithLength(int size, int mode);
585 CoinArrayWithLength(const CoinArrayWithLength & rhs);
587 CoinArrayWithLength(const CoinArrayWithLength * rhs);
589 CoinArrayWithLength& operator=(const CoinArrayWithLength & rhs);
591 void copy(const CoinArrayWithLength & rhs, int numberBytes=-1);
593 void allocate(const CoinArrayWithLength & rhs, int numberBytes);
595 ~CoinArrayWithLength ();
597 void getArray(int size);
599 void reallyFreeArray();
601 void getCapacity(int numberBytes,int numberIfNeeded=-1);
603
604 protected:
607 char * array_;
610 CoinBigIndex size_;
612 int offset_;
614 int alignment_;
616 };
618
619 class CoinDoubleArrayWithLength : public CoinArrayWithLength {
620
621 public:
624 inline int getSize() const
626 { return size_/CoinSizeofAsInt(double); }
628 inline double * array() const
629 { return reinterpret_cast<double *> ((size_>-2) ? array_ : NULL); }
631
634 inline void setSize(int value)
636 { size_ = value*CoinSizeofAsInt(double); }
638
641 inline double * conditionalNew(int sizeWanted)
643 { return reinterpret_cast<double *> ( CoinArrayWithLength::conditionalNew(sizeWanted>=0 ? static_cast<long> ((sizeWanted)*CoinSizeofAsInt(double)) : -1)); }
645
649 inline CoinDoubleArrayWithLength()
650 { array_=NULL; size_=-1;}
652 inline CoinDoubleArrayWithLength(int size)
653 { array_=new char [size*CoinSizeofAsInt(double)]; size_=-1;}
658 inline CoinDoubleArrayWithLength(int size, int mode)
659 : CoinArrayWithLength(size*CoinSizeofAsInt(double),mode) {}
661 inline CoinDoubleArrayWithLength(const CoinDoubleArrayWithLength & rhs)
662 : CoinArrayWithLength(rhs) {}
664 inline CoinDoubleArrayWithLength(const CoinDoubleArrayWithLength * rhs)
665 : CoinArrayWithLength(rhs) {}
667 inline CoinDoubleArrayWithLength& operator=(const CoinDoubleArrayWithLength & rhs)
668 { CoinArrayWithLength::operator=(rhs); return *this;}
670 };
672
673 class CoinFactorizationDoubleArrayWithLength : public CoinArrayWithLength {
674
675 public:
678 inline int getSize() const
680 { return size_/CoinSizeofAsInt(CoinFactorizationDouble); }
682 inline CoinFactorizationDouble * array() const
683 { return reinterpret_cast<CoinFactorizationDouble *> ((size_>-2) ? array_ : NULL); }
685
688 inline void setSize(int value)
690 { size_ = value*CoinSizeofAsInt(CoinFactorizationDouble); }
692
695 inline CoinFactorizationDouble * conditionalNew(int sizeWanted)
697 { return reinterpret_cast<CoinFactorizationDouble *> (CoinArrayWithLength::conditionalNew(sizeWanted>=0 ? static_cast<long> (( sizeWanted)*CoinSizeofAsInt(CoinFactorizationDouble)) : -1)); }
699
703 inline CoinFactorizationDoubleArrayWithLength()
704 { array_=NULL; size_=-1;}
706 inline CoinFactorizationDoubleArrayWithLength(int size)
707 { array_=new char [size*CoinSizeofAsInt(CoinFactorizationDouble)]; size_=-1;}
712 inline CoinFactorizationDoubleArrayWithLength(int size, int mode)
713 : CoinArrayWithLength(size*CoinSizeofAsInt(CoinFactorizationDouble),mode) {}
715 inline CoinFactorizationDoubleArrayWithLength(const CoinFactorizationDoubleArrayWithLength & rhs)
716 : CoinArrayWithLength(rhs) {}
718 inline CoinFactorizationDoubleArrayWithLength(const CoinFactorizationDoubleArrayWithLength * rhs)
719 : CoinArrayWithLength(rhs) {}
721 inline CoinFactorizationDoubleArrayWithLength& operator=(const CoinFactorizationDoubleArrayWithLength & rhs)
722 { CoinArrayWithLength::operator=(rhs); return *this;}
724 };
726
727 class CoinFactorizationLongDoubleArrayWithLength : public CoinArrayWithLength {
728
729 public:
732 inline int getSize() const
734 { return size_/CoinSizeofAsInt(long double); }
736 inline long double * array() const
737 { return reinterpret_cast<long double *> ((size_>-2) ? array_ : NULL); }
739
742 inline void setSize(int value)
744 { size_ = value*CoinSizeofAsInt(long double); }
746
749 inline long double * conditionalNew(int sizeWanted)
751 { return reinterpret_cast<long double *> (CoinArrayWithLength::conditionalNew(sizeWanted>=0 ? static_cast<long> (( sizeWanted)*CoinSizeofAsInt(long double)) : -1)); }
753
757 inline CoinFactorizationLongDoubleArrayWithLength()
758 { array_=NULL; size_=-1;}
760 inline CoinFactorizationLongDoubleArrayWithLength(int size)
761 { array_=new char [size*CoinSizeofAsInt(long double)]; size_=-1;}
766 inline CoinFactorizationLongDoubleArrayWithLength(int size, int mode)
767 : CoinArrayWithLength(size*CoinSizeofAsInt(long double),mode) {}
769 inline CoinFactorizationLongDoubleArrayWithLength(const CoinFactorizationLongDoubleArrayWithLength & rhs)
770 : CoinArrayWithLength(rhs) {}
772 inline CoinFactorizationLongDoubleArrayWithLength(const CoinFactorizationLongDoubleArrayWithLength * rhs)
773 : CoinArrayWithLength(rhs) {}
775 inline CoinFactorizationLongDoubleArrayWithLength& operator=(const CoinFactorizationLongDoubleArrayWithLength & rhs)
776 { CoinArrayWithLength::operator=(rhs); return *this;}
778 };
780
781 class CoinIntArrayWithLength : public CoinArrayWithLength {
782
783 public:
786 inline int getSize() const
788 { return size_/CoinSizeofAsInt(int); }
790 inline int * array() const
791 { return reinterpret_cast<int *> ((size_>-2) ? array_ : NULL); }
793
796 inline void setSize(int value)
798 { size_ = value*CoinSizeofAsInt(int); }
800
803 inline int * conditionalNew(int sizeWanted)
805 { return reinterpret_cast<int *> (CoinArrayWithLength::conditionalNew(sizeWanted>=0 ? static_cast<long> (( sizeWanted)*CoinSizeofAsInt(int)) : -1)); }
807
811 inline CoinIntArrayWithLength()
812 { array_=NULL; size_=-1;}
814 inline CoinIntArrayWithLength(int size)
815 { array_=new char [size*CoinSizeofAsInt(int)]; size_=-1;}
820 inline CoinIntArrayWithLength(int size, int mode)
821 : CoinArrayWithLength(size*CoinSizeofAsInt(int),mode) {}
823 inline CoinIntArrayWithLength(const CoinIntArrayWithLength & rhs)
824 : CoinArrayWithLength(rhs) {}
826 inline CoinIntArrayWithLength(const CoinIntArrayWithLength * rhs)
827 : CoinArrayWithLength(rhs) {}
829 inline CoinIntArrayWithLength& operator=(const CoinIntArrayWithLength & rhs)
830 { CoinArrayWithLength::operator=(rhs); return *this;}
832 };
834
835 class CoinBigIndexArrayWithLength : public CoinArrayWithLength {
836
837 public:
840 inline int getSize() const
842 { return size_/CoinSizeofAsInt(CoinBigIndex); }
844 inline CoinBigIndex * array() const
845 { return reinterpret_cast<CoinBigIndex *> ((size_>-2) ? array_ : NULL); }
847
850 inline void setSize(int value)
852 { size_ = value*CoinSizeofAsInt(CoinBigIndex); }
854
857 inline CoinBigIndex * conditionalNew(int sizeWanted)
859 { return reinterpret_cast<CoinBigIndex *> (CoinArrayWithLength::conditionalNew(sizeWanted>=0 ? static_cast<long> (( sizeWanted)*CoinSizeofAsInt(CoinBigIndex)) : -1)); }
861
865 inline CoinBigIndexArrayWithLength()
866 { array_=NULL; size_=-1;}
868 inline CoinBigIndexArrayWithLength(int size)
869 { array_=new char [size*CoinSizeofAsInt(CoinBigIndex)]; size_=-1;}
874 inline CoinBigIndexArrayWithLength(int size, int mode)
875 : CoinArrayWithLength(size*CoinSizeofAsInt(CoinBigIndex),mode) {}
877 inline CoinBigIndexArrayWithLength(const CoinBigIndexArrayWithLength & rhs)
878 : CoinArrayWithLength(rhs) {}
880 inline CoinBigIndexArrayWithLength(const CoinBigIndexArrayWithLength * rhs)
881 : CoinArrayWithLength(rhs) {}
883 inline CoinBigIndexArrayWithLength& operator=(const CoinBigIndexArrayWithLength & rhs)
884 { CoinArrayWithLength::operator=(rhs); return *this;}
886 };
888
889 class CoinUnsignedIntArrayWithLength : public CoinArrayWithLength {
890
891 public:
894 inline int getSize() const
896 { return size_/CoinSizeofAsInt(unsigned int); }
898 inline unsigned int * array() const
899 { return reinterpret_cast<unsigned int *> ((size_>-2) ? array_ : NULL); }
901
904 inline void setSize(int value)
906 { size_ = value*CoinSizeofAsInt(unsigned int); }
908
911 inline unsigned int * conditionalNew(int sizeWanted)
913 { return reinterpret_cast<unsigned int *> (CoinArrayWithLength::conditionalNew(sizeWanted>=0 ? static_cast<long> (( sizeWanted)*CoinSizeofAsInt(unsigned int)) : -1)); }
915
919 inline CoinUnsignedIntArrayWithLength()
920 { array_=NULL; size_=-1;}
922 inline CoinUnsignedIntArrayWithLength(int size)
923 { array_=new char [size*CoinSizeofAsInt(unsigned int)]; size_=-1;}
928 inline CoinUnsignedIntArrayWithLength(int size, int mode)
929 : CoinArrayWithLength(size*CoinSizeofAsInt(unsigned int),mode) {}
931 inline CoinUnsignedIntArrayWithLength(const CoinUnsignedIntArrayWithLength & rhs)
932 : CoinArrayWithLength(rhs) {}
934 inline CoinUnsignedIntArrayWithLength(const CoinUnsignedIntArrayWithLength * rhs)
935 : CoinArrayWithLength(rhs) {}
937 inline CoinUnsignedIntArrayWithLength& operator=(const CoinUnsignedIntArrayWithLength & rhs)
938 { CoinArrayWithLength::operator=(rhs); return *this;}
940 };
942
943 class CoinVoidStarArrayWithLength : public CoinArrayWithLength {
944
945 public:
948 inline int getSize() const
950 { return size_/CoinSizeofAsInt(void *); }
952 inline void ** array() const
953 { return reinterpret_cast<void **> ((size_>-2) ? array_ : NULL); }
955
958 inline void setSize(int value)
960 { size_ = value*CoinSizeofAsInt(void *); }
962
965 inline void ** conditionalNew(int sizeWanted)
967 { return reinterpret_cast<void **> ( CoinArrayWithLength::conditionalNew(sizeWanted>=0 ? static_cast<long> ((sizeWanted)*CoinSizeofAsInt(void *)) : -1)); }
969
973 inline CoinVoidStarArrayWithLength()
974 { array_=NULL; size_=-1;}
976 inline CoinVoidStarArrayWithLength(int size)
977 { array_=new char [size*CoinSizeofAsInt(void *)]; size_=-1;}
982 inline CoinVoidStarArrayWithLength(int size, int mode)
983 : CoinArrayWithLength(size*CoinSizeofAsInt(void *),mode) {}
985 inline CoinVoidStarArrayWithLength(const CoinVoidStarArrayWithLength & rhs)
986 : CoinArrayWithLength(rhs) {}
988 inline CoinVoidStarArrayWithLength(const CoinVoidStarArrayWithLength * rhs)
989 : CoinArrayWithLength(rhs) {}
991 inline CoinVoidStarArrayWithLength& operator=(const CoinVoidStarArrayWithLength & rhs)
992 { CoinArrayWithLength::operator=(rhs); return *this;}
994 };
996
997 class CoinArbitraryArrayWithLength : public CoinArrayWithLength {
998
999 public:
1002 inline int getSize() const
1004 { return size_/lengthInBytes_; }
1006 inline void ** array() const
1007 { return reinterpret_cast<void **> ((size_>-2) ? array_ : NULL); }
1009
1012 inline void setSize(int value)
1014 { size_ = value*lengthInBytes_; }
1016
1019 inline char * conditionalNew(int length, int sizeWanted)
1021 { lengthInBytes_=length;return reinterpret_cast<char *> ( CoinArrayWithLength::conditionalNew(sizeWanted>=0 ? static_cast<long>
1022 ((sizeWanted)*lengthInBytes_) : -1)); }
1024
1028 inline CoinArbitraryArrayWithLength(int length=1)
1029 { array_=NULL; size_=-1;lengthInBytes_=length;}
1031 inline CoinArbitraryArrayWithLength(int length, int size)
1032 { array_=new char [size*length]; size_=-1; lengthInBytes_=length;}
1037 inline CoinArbitraryArrayWithLength(int length, int size, int mode)
1038 : CoinArrayWithLength(size*length,mode) {lengthInBytes_=length;}
1040 inline CoinArbitraryArrayWithLength(const CoinArbitraryArrayWithLength & rhs)
1041 : CoinArrayWithLength(rhs) {}
1043 inline CoinArbitraryArrayWithLength(const CoinArbitraryArrayWithLength * rhs)
1044 : CoinArrayWithLength(rhs) {}
1046 inline CoinArbitraryArrayWithLength& operator=(const CoinArbitraryArrayWithLength & rhs)
1047 { CoinArrayWithLength::operator=(rhs); return *this;}
1049
1050 protected:
1053 int lengthInBytes_;
1056 };
1057 class CoinPartitionedVector : public CoinIndexedVector {
1058
1059 public:
1060 #ifndef COIN_PARTITIONS
1061 #define COIN_PARTITIONS 8
1062 #endif
1063
1065 inline int getNumElements(int partition) const { assert (partition<COIN_PARTITIONS);
1067 return numberElementsPartition_[partition]; }
1069 inline int getNumPartitions() const
1070 { return numberPartitions_; }
1072 inline int getNumElements() const { return nElements_; }
1074 inline int startPartition(int partition) const { assert (partition<=COIN_PARTITIONS);
1075 return startPartition_[partition]; }
1077 inline const int * startPartitions() const
1078 { return startPartition_; }
1080
1081 //-------------------------------------------------------------------
1082 // Set indices and elements
1083 //-------------------------------------------------------------------
1086 inline void setNumElementsPartition(int partition, int value) { assert (partition<COIN_PARTITIONS);
1088 if (numberPartitions_) numberElementsPartition_[partition]=value; }
1090 inline void setTempNumElementsPartition(int partition, int value) { assert (partition<COIN_PARTITIONS);
1091 numberElementsPartition_[partition]=value; }
1093 void computeNumberElements();
1095 void compact();
1098 void reserve(int n);
1100 void setPartitions(int number,const int * starts);
1102 void clearAndReset();
1104 void clearAndKeep();
1106 void clearPartition(int partition);
1107 #ifndef NDEBUG
1108 void checkClear();
1111 void checkClean();
1112 #else
1113 inline void checkClear() {};
1114 inline void checkClean() {};
1115 #endif
1116 int scan(int partition, double tolerance=0.0);
1121 void print() const;
1124
1128 void sort();
1130
1134 CoinPartitionedVector();
1136 CoinPartitionedVector(int size, const int * inds, const double * elems);
1138 CoinPartitionedVector(int size, const int * inds, double element);
1141 CoinPartitionedVector(int size, const double * elements);
1143 CoinPartitionedVector(int size);
1145 CoinPartitionedVector(const CoinPartitionedVector &);
1147 CoinPartitionedVector(const CoinPartitionedVector *);
1149 CoinPartitionedVector & operator=(const CoinPartitionedVector &);
1151 ~CoinPartitionedVector ();
1153 protected:
1156 int startPartition_[COIN_PARTITIONS+1];
1159 int numberElementsPartition_[COIN_PARTITIONS];
1161 int numberPartitions_;
1163 };
1164 #endif
CoinBigIndexArrayWithLength::array
CoinBigIndex * array() const
Get Array.
Definition: CoinIndexedVector.hpp:844
CoinPartitionedVector::getNumPartitions
int getNumPartitions() const
Get number of partitions.
Definition: CoinIndexedVector.hpp:1069
CoinHelperFunctions.hpp
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:649
CoinArrayWithLength::alignment_
int alignment_
Alignment wanted (power of 2)
Definition: CoinIndexedVector.hpp:614
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(const CoinFactorizationLongDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:772
CoinVoidStarArrayWithLength
void * version
Definition: CoinIndexedVector.hpp:943
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(const CoinArbitraryArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:1043
CoinIndexedVector::sortPacked
void sortPacked()
CoinUnsignedIntArrayWithLength
unsigned int * version
Definition: CoinIndexedVector.hpp:889
CoinPartitionedVector::setPartitions
void setPartitions(int number, const int *starts)
Setup partitions (needs end as well)
CoinBigIndexArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:851
CoinIndexedVector::sortIncrIndex
void sortIncrIndex()
Definition: CoinIndexedVector.hpp:357
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:712
CoinArrayWithLength
Pointer with length in bytes.
Definition: CoinIndexedVector.hpp:513
CoinIndexedVector::setVector
void setVector(int numberIndices, const int *inds, const double *elems)
Set vector numberIndices, indices, and elements.
CoinArbitraryArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:1003
CoinFactorizationDoubleArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:679
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:225
CoinIndexedVector::operator-
CoinIndexedVector operator-(const CoinIndexedVector &op2)
Return the difference of two indexed vectors.
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(const CoinIntArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:823
CoinIndexedVector::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.
CoinArrayWithLength::getCapacity
void getCapacity(int numberBytes, int numberIfNeeded=-1)
Get enough space (if more needed then do at least needed)
CoinPartitionedVector::clearAndReset
void clearAndReset()
Reset the vector (as if were just created an empty vector). Gets rid of partitions.
CoinIndexedVector::operator+=
void operator+=(double value)
add value to every entry
CoinPartitionedVector::getNumElements
int getNumElements() const
Get the size.
Definition: CoinIndexedVector.hpp:1072
CoinDoubleArrayWithLength
double * version
Definition: CoinIndexedVector.hpp:619
CoinIndexedVector::indices_
int * indices_
Vector indices.
Definition: CoinIndexedVector.hpp:475
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(const CoinFactorizationLongDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:769
CoinArrayWithLength::conditionalNew
char * conditionalNew(long sizeWanted)
Conditionally gets new array.
CoinIndexedVector::copy
void copy(const CoinIndexedVector &rhs, double multiplier=1.0)
Copy the contents of one vector into another.
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(const CoinUnsignedIntArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:931
CoinArrayWithLength::clear
void clear()
Zero out array.
CoinIndexedVector::operator[]
double & operator[](int i) const
Access the i&#39;th element of the full storage vector.
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(int length, int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:1031
void
typedef void(COINLINKAGE_CB *clp_callback)(Clp_Simplex *model
typedef for user call back.
CoinArrayWithLength::switchOff
void switchOff()
Set the size to -1.
Definition: CoinIndexedVector.hpp:544
CoinArbitraryArrayWithLength::lengthInBytes_
int lengthInBytes_
Length in bytes.
Definition: CoinIndexedVector.hpp:1054
CoinIndexedVector::setElement
void setElement(int index, double element)
Set an existing element in the indexed vector The first argument is the &quot;index&quot; into the elements() a...
CoinArrayWithLength::reallyFreeArray
void reallyFreeArray()
Really get rid of array with alignment.
CoinDoubleArrayWithLength::conditionalNew
double * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:642
CoinIndexedVector::offset_
int offset_
Offset to get where new allocated array.
Definition: CoinIndexedVector.hpp:483
CoinIndexedVector::sortDecrIndex
void sortDecrIndex()
CoinFactorizationLongDoubleArrayWithLength::array
long double * array() const
Get Array.
Definition: CoinIndexedVector.hpp:736
CoinIndexedVector::packedMode
bool packedMode() const
Gets packed mode.
Definition: CoinIndexedVector.hpp:427
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:706
CoinUnsignedIntArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:905
CoinArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:541
CoinPartitionedVector::numberPartitions_
int numberPartitions_
Number of partitions (0 means off)
Definition: CoinIndexedVector.hpp:1161
CoinIndexedVector::sortDecrElement
void sortDecrElement()
CoinUnsignedIntArrayWithLength::operator=
CoinUnsignedIntArrayWithLength & operator=(const CoinUnsignedIntArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:937
CoinBigIndexArrayWithLength::conditionalNew
CoinBigIndex * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:858
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::setPersistence
void setPersistence(int flag, int currentLength)
Does what is needed to set persistence.
CoinIndexedVector::operator+
CoinIndexedVector operator+(const CoinIndexedVector &op2)
Return the sum of two indexed vectors.
CoinFactorizationLongDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:743
CoinIndexedVector::checkClear
void checkClear()
For debug check vector is clear i.e. no elements.
CoinPartitionedVector::CoinPartitionedVector
CoinPartitionedVector()
Default constructor.
CoinIndexedVector::print
void print() const
Print out.
CoinUnsignedIntArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:895
CoinIndexedVector::zero
void zero(int index)
Makes nonzero tiny.
Definition: CoinIndexedVector.hpp:243
CoinArbitraryArrayWithLength::operator=
CoinArbitraryArrayWithLength & operator=(const CoinArbitraryArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:1046
CoinPartitionedVector::~CoinPartitionedVector
~CoinPartitionedVector()
Destructor.
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:865
CoinArbitraryArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:1013
CoinArrayWithLength::setCapacity
void setCapacity()
Set the capacity to &gt;=0 if &lt;=-2.
Definition: CoinIndexedVector.hpp:531
CoinIndexedVector::denseVector
double * denseVector() const
Get the vector as a dense vector.
Definition: CoinIndexedVector.hpp:121
CoinIndexedVector::operator!=
bool operator!=(const CoinPackedVectorBase &rhs) const
Not equal.
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:928
CoinIndexedVector::setPackedMode
void setPackedMode(bool yesNo)
Sets packed mode.
Definition: CoinIndexedVector.hpp:424
CoinIndexedVector::setIndexVector
void setIndexVector(int *array)
For very temporary use when user needs to borrow an index vector.
Definition: CoinIndexedVector.hpp:126
CoinIndexedVector::elements_
double * elements_
Vector elements.
Definition: CoinIndexedVector.hpp:477
CoinIndexedVector::packedMode_
bool packedMode_
If true then is operating in packed mode.
Definition: CoinIndexedVector.hpp:485
CoinIndexedVector::returnVector
void returnVector()
Return ownership of the arguments to this vector.
CoinFinite.hpp
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:757
CoinFactorizationLongDoubleArrayWithLength::conditionalNew
long double * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:750
COIN_PARTITIONS
#define COIN_PARTITIONS
Definition: CoinIndexedVector.hpp:1061
CoinPartitionedVector::reserve
void reserve(int n)
Reserve space.
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(const CoinBigIndexArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:880
CoinIndexedVector::operator*=
void operator*=(double value)
multiply every entry by value
CoinPartitionedVector::sort
void sort()
Sort the indexed storage vector (increasing indices).
COIN_DBL_MIN
const double COIN_DBL_MIN
Definition: CoinFinite.hpp:17
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(int length=1)
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:1028
CoinIndexedVector::nElements_
int nElements_
Size of indices and packed elements vectors.
Definition: CoinIndexedVector.hpp:479
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
CoinVoidStarArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:949
CoinIndexedVector::setNumElements
void setNumElements(int value)
Set the size.
Definition: CoinIndexedVector.hpp:140
CoinFactorizationLongDoubleArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:733
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:922
CoinIndexedVector::swap
void swap(int i, int j)
Swap values in positions i and j of indices and elements.
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(const CoinIntArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:826
CoinIndexedVector::borrowVector
void borrowVector(int size, int numberIndices, int *inds, double *elems)
Borrow ownership of the arguments to this vector.
CoinPartitionedVector
Definition: CoinIndexedVector.hpp:1057
CoinIndexedVector::getNumElements
int getNumElements() const
Get the size.
Definition: CoinIndexedVector.hpp:111
CoinPartitionedVector::print
void print() const
Scan dense region from start to &lt; end and set up indices returns number found.
CoinIndexedVector::operator-=
void operator-=(double value)
subtract value from every entry
CoinIndexedVector::cleanAndPack
int cleanAndPack(double tolerance)
Same but packs down.
CoinFactorizationDoubleArrayWithLength::array
CoinFactorizationDouble * array() const
Get Array.
Definition: CoinIndexedVector.hpp:682
CoinIndexedVector::~CoinIndexedVector
~CoinIndexedVector()
Destructor.
CoinSizeofAsInt
#define CoinSizeofAsInt(type)
Cube Root.
Definition: CoinHelperFunctions.hpp:942
CoinFactorizationDouble
double CoinFactorizationDouble
Definition: CoinTypes.hpp:57
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:973
CoinBigIndexArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:841
CoinIndexedVector::sortIncrElement
void sortIncrElement()
CoinArrayWithLength::array_
char * array_
Array.
Definition: CoinIndexedVector.hpp:608
CoinFactorizationDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:689
CoinPackedVectorBase.hpp
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(const CoinBigIndexArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:877
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:814
CoinIndexedVector::getMaxIndex
int getMaxIndex() const
Get value of maximum index.
CoinArrayWithLength::swap
void swap(CoinArrayWithLength &other)
Swaps memory between two members.
CoinIndexedVector::expand
void expand()
This is mainly for testing - goes from packed to indexed.
CoinIntArrayWithLength::conditionalNew
int * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:804
CoinBigIndexArrayWithLength
CoinBigIndex * version.
Definition: CoinIndexedVector.hpp:835
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(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:874
CoinIndexedVector
Indexed Vector.
Definition: CoinIndexedVector.hpp:104
CoinIndexedVector::clean
int clean(double tolerance)
set all small values to zero and return number remaining
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(const CoinFactorizationDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:715
CoinArrayWithLength::getArray
void getArray(int size)
Get array with alignment.
CoinIndexedVector::scan
int scan()
Scan dense region and set up indices (returns number found)
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:820
CoinIndexedVector::capacity_
int capacity_
Amount of memory allocated for indices_, and elements_.
Definition: CoinIndexedVector.hpp:481
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:982
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(const CoinFactorizationDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:718
CoinArrayWithLength::CoinArrayWithLength
CoinArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:574
CoinArrayWithLength::operator=
CoinArrayWithLength & operator=(const CoinArrayWithLength &rhs)
Assignment operator.
CoinIndexedVector::createOneUnpackedElement
void createOneUnpackedElement(int index, double element)
Create unpacked singleton.
CoinIndexedVector::createUnpacked
void createUnpacked(int number, const int *indices, const double *elements)
Create unpacked array.
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(const CoinDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:664
CoinDoubleArrayWithLength::array
double * array() const
Get Array.
Definition: CoinIndexedVector.hpp:628
CoinIndexedVector::operator/
CoinIndexedVector operator/(const CoinIndexedVector &op2)
Return the element-wise ratio of two indexed vectors (0.0/0.0 =&gt; 0.0) (0 vanishes) ...
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(const CoinUnsignedIntArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:934
CoinIntArrayWithLength::operator=
CoinIntArrayWithLength & operator=(const CoinIntArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:829
CoinIndexedVector::empty
void empty()
Reset the vector (as if were just created an empty vector)
CoinIndexedVector::getIndices
const int * getIndices() const
Get indices of elements.
Definition: CoinIndexedVector.hpp:113
CoinIndexedVector::gutsOfSetPackedVector
void gutsOfSetPackedVector(int size, int numberIndices, const int *inds, const double *elems)
CoinArrayWithLength::size_
CoinBigIndex size_
Size of array in bytes.
Definition: CoinIndexedVector.hpp:610
CoinIndexedVector::append
void append(const CoinPackedVectorBase &caboose)
Append a CoinPackedVector to the end.
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:976
CoinPartitionedVector::operator=
CoinPartitionedVector & operator=(const CoinPartitionedVector &)
Assignment operator.
CoinIndexedVector::gutsOfSetConstant
void gutsOfSetConstant(int size, const int *inds, double value)
CoinArbitraryArrayWithLength::array
void ** array() const
Get Array.
Definition: CoinIndexedVector.hpp:1006
CoinIntArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:787
CoinIndexedVector::setFull
void setFull(int size, const double *elems)
Indices are not specified and are taken to be 0,1,...,size-1.
CoinSort.hpp
CoinIndexedVector::sort
void sort()
Sort the indexed storage vector (increasing indices).
Definition: CoinIndexedVector.hpp:354
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:766
CoinVoidStarArrayWithLength::conditionalNew
void ** conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:966
CoinIndexedVector::gutsOfSetVector
void gutsOfSetVector(int size, const int *inds, const double *elems)
Copy internal data.
CoinIndexedVector::capacity
int capacity() const
capacity returns the size which could be accomodated without having to reallocate storage...
Definition: CoinIndexedVector.hpp:420
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(const CoinVoidStarArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:988
CoinArrayWithLength::CoinArrayWithLength
CoinArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:570
CoinPartitionedVector::checkClear
void checkClear()
For debug check vector is clear i.e. no elements.
CoinIntArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:797
CoinArrayWithLength::offset_
int offset_
Offset of array.
Definition: CoinIndexedVector.hpp:612
CoinDoubleArrayWithLength::operator=
CoinDoubleArrayWithLength & operator=(const CoinDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:667
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:811
CoinPartitionedVector::clearAndKeep
void clearAndKeep()
Reset the vector (as if were just created an empty vector). Keeps partitions.
CoinIndexedVector::checkClean
void checkClean()
For debug check vector is clean i.e. elements match indices.
CoinArrayWithLength::rawSize
int rawSize() const
Get the size.
Definition: CoinIndexedVector.hpp:522
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:652
CoinIndexedVectorUnitTest
void CoinIndexedVectorUnitTest()
A function that tests the methods in the CoinIndexedVector class.
CoinArrayWithLength::conditionalDelete
void conditionalDelete()
Conditionally deletes.
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:703
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:919
CoinUnsignedIntArrayWithLength::array
unsigned int * array() const
Get Array.
Definition: CoinIndexedVector.hpp:898
CoinVoidStarArrayWithLength::operator=
CoinVoidStarArrayWithLength & operator=(const CoinVoidStarArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:991
CoinIndexedVector::isApproximatelyEqual
int isApproximatelyEqual(const CoinIndexedVector &rhs, double tolerance=1.0e-8) const
Equal with a tolerance (returns -1 or position of inequality).
CoinIndexedVector::quickInsert
void quickInsert(int index, double element)
Insert a nonzero element into the vector.
Definition: CoinIndexedVector.hpp:193
CoinArrayWithLength::switchOn
void switchOn(int alignment=3)
Set the size to -2 and alignment.
Definition: CoinIndexedVector.hpp:547
CoinFactorizationDoubleArrayWithLength
CoinFactorizationDouble * version.
Definition: CoinIndexedVector.hpp:673
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:105
CoinVoidStarArrayWithLength::array
void ** array() const
Get Array.
Definition: CoinIndexedVector.hpp:952
CoinPartitionedVector::numberElementsPartition_
int numberElementsPartition_[COIN_PARTITIONS]
Size of indices in a partition.
Definition: CoinIndexedVector.hpp:1159
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(const CoinVoidStarArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:985
CoinIndexedVector::setPacked
void setPacked()
Mark as packed.
Definition: CoinIndexedVector.hpp:256
CoinPartitionedVector::compact
void compact()
Add up number of elements in partitions and pack and get rid of partitions.
CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDouble * version.
Definition: CoinIndexedVector.hpp:727
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:760
CoinArrayWithLength::~CoinArrayWithLength
~CoinArrayWithLength()
Destructor.
CoinArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:519
CoinIndexedVector::createPacked
void createPacked(int number, const int *indices, const double *elements)
Create packed array.
CoinPartitionedVector::setNumElementsPartition
void setNumElementsPartition(int partition, int value)
Set the size of a partition.
Definition: CoinIndexedVector.hpp:1087
CoinIntArrayWithLength::array
int * array() const
Get Array.
Definition: CoinIndexedVector.hpp:790
CoinPartitionedVector::startPartition_
int startPartition_[COIN_PARTITIONS+1]
Starts.
Definition: CoinIndexedVector.hpp:1157
CoinIndexedVector::getIndices
int * getIndices()
Get element values.
Definition: CoinIndexedVector.hpp:117
CoinArbitraryArrayWithLength::conditionalNew
char * conditionalNew(int length, int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:1020
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(const CoinArbitraryArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:1040
CoinArrayWithLength::extend
void extend(int newSize)
Extend a persistent array keeping data (size in bytes)
CoinIndexedVector::CoinIndexedVector
CoinIndexedVector()
Default constructor.
CoinFactorizationDoubleArrayWithLength::operator=
CoinFactorizationDoubleArrayWithLength & operator=(const CoinFactorizationDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:721
CoinArrayWithLength::copy
void copy(const CoinArrayWithLength &rhs, int numberBytes=-1)
Assignment with length (if -1 use internal length)
CoinIndexedVector::cleanAndPackSafe
int cleanAndPackSafe(double tolerance)
Same but packs down and is safe (i.e. if order is odd)
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:1037
CoinIntArrayWithLength
int * version
Definition: CoinIndexedVector.hpp:781
CoinPartitionedVector::setTempNumElementsPartition
void setTempNumElementsPartition(int partition, int value)
Set the size of a partition (just for a tiny while)
Definition: CoinIndexedVector.hpp:1090
CoinPartitionedVector::startPartition
int startPartition(int partition) const
Get starts.
Definition: CoinIndexedVector.hpp:1074
CoinArrayWithLength::capacity
int capacity() const
Get the capacity (just read it)
Definition: CoinIndexedVector.hpp:528
CoinArrayWithLength::allocate
void allocate(const CoinArrayWithLength &rhs, int numberBytes)
Assignment with length - does not copy.
CoinIndexedVector::getMinIndex
int getMinIndex() const
Get value of minimum index.
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:658
CoinBigIndexArrayWithLength::operator=
CoinBigIndexArrayWithLength & operator=(const CoinBigIndexArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:883
CoinIndexedVector::operator*
CoinIndexedVector operator*(const CoinIndexedVector &op2)
Return the element-wise product of two indexed vectors.
CoinIndexedVector::operator=
CoinIndexedVector & operator=(const CoinIndexedVector &)
Assignment operator.
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:206
CoinFactorizationLongDoubleArrayWithLength::operator=
CoinFactorizationLongDoubleArrayWithLength & operator=(const CoinFactorizationLongDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:775
CoinIndexedVector::clear
void clear()
Reset the vector (as if were just created an empty vector). This leaves arrays!
CoinIndexedVector::setDenseVector
void setDenseVector(double *array)
For very temporary use when user needs to borrow a dense vector.
Definition: CoinIndexedVector.hpp:123
CoinIndexedVector::operator==
bool operator==(const CoinPackedVectorBase &rhs) const
Equal.
CoinPartitionedVector::computeNumberElements
void computeNumberElements()
Add up number of elements in partitions.
CoinIndexedVector::setCapacity
void setCapacity(int value)
Definition: CoinIndexedVector.hpp:421
CoinArbitraryArrayWithLength
arbitrary version
Definition: CoinIndexedVector.hpp:997
CoinArrayWithLength::array
const char * array() const
Get Array.
Definition: CoinIndexedVector.hpp:534
COIN_INDEXED_TINY_ELEMENT
#define COIN_INDEXED_TINY_ELEMENT
Definition: CoinIndexedVector.hpp:24
CoinIndexedVector::operator/=
void operator/=(double value)
divide every entry by value (** 0 vanishes)
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(const CoinDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:661
CoinPartitionedVector::clearPartition
void clearPartition(int partition)
Clear a partition.
CoinIndexedVector::CoinIndexedVectorUnitTest
friend void CoinIndexedVectorUnitTest()
A function that tests the methods in the CoinIndexedVector class.
CoinPartitionedVector::checkClean
void checkClean()
For debug check vector is clean i.e. elements match indices.
CoinIndexedVector::insert
void insert(int index, double element)
Insert an element into the vector.
CoinUnsignedIntArrayWithLength::conditionalNew
unsigned int * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:912
CoinPartitionedVector::startPartitions
const int * startPartitions() const
Get starts.
Definition: CoinIndexedVector.hpp:1077
CoinFactorizationDoubleArrayWithLength::conditionalNew
CoinFactorizationDouble * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:696
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:868
CoinDoubleArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:625
CoinDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:635
CoinArrayWithLength::switchedOn
bool switchedOn() const
See if persistence already on.
Definition: CoinIndexedVector.hpp:525
CoinIndexedVector::scanAndPack
int scanAndPack()
These are same but pack down.
CoinIndexedVector::truncate
void truncate(int newSize)
Throw away all entries in rows &gt;= newSize.
CoinVoidStarArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:959