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

- File List
- File Members

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
CoinIndexedVector::getMaxIndex
int getMaxIndex() const
Get value of maximum index.
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:105
CoinArrayWithLength::~CoinArrayWithLength
~CoinArrayWithLength()
Destructor.
CoinArrayWithLength::extend
void extend(int newSize)
Extend a persistent array keeping data (size in bytes)
CoinIndexedVector::setVector
void setVector(int numberIndices, const int *inds, const double *elems)
Set vector numberIndices, indices, and elements.
CoinIndexedVectorUnitTest
void CoinIndexedVectorUnitTest()
A function that tests the methods in the CoinIndexedVector class.
CoinIndexedVector::sortIncrIndex
void sortIncrIndex()
Sort the indexed storage vector (increasing indices).
Definition: CoinIndexedVector.hpp:357
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:757
COIN_PARTITIONS
#define COIN_PARTITIONS
Definition: CoinIndexedVector.hpp:1061
CoinIndexedVector::operator*
CoinIndexedVector operator*(const CoinIndexedVector &op2)
Return the element-wise product of two indexed vectors.
CoinArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:541
CoinArrayWithLength::setCapacity
void setCapacity()
Set the capacity to &gt;=0 if &lt;=-2.
Definition: CoinIndexedVector.hpp:531
CoinArrayWithLength::operator=
CoinArrayWithLength & operator=(const CoinArrayWithLength &rhs)
Assignment operator.
CoinFactorizationDoubleArrayWithLength::conditionalNew
CoinFactorizationDouble * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:696
CoinVoidStarArrayWithLength::array
void ** array() const
Get Array.
Definition: CoinIndexedVector.hpp:952
CoinArrayWithLength::conditionalDelete
void conditionalDelete()
Conditionally deletes.
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(const CoinUnsignedIntArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:934
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:703
CoinIndexedVector::operator/=
void operator/=(double value)
divide every entry by value (** 0 vanishes)
CoinIndexedVector::setFull
void setFull(int size, const double *elems)
Indices are not specified and are taken to be 0,1,...,size-1.
CoinArrayWithLength::swap
void swap(CoinArrayWithLength &other)
Swaps memory between two members.
CoinVoidStarArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:959
CoinIndexedVector::createUnpacked
void createUnpacked(int number, const int *indices, const double *elements)
Create unpacked array.
CoinFactorizationLongDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:743
CoinUnsignedIntArrayWithLength
unsigned int * version
Definition: CoinIndexedVector.hpp:889
CoinIndexedVector::CoinIndexedVector
CoinIndexedVector()
Default constructor.
CoinIndexedVector::reserve
void reserve(int n)
Reserve space.
CoinIntArrayWithLength::operator=
CoinIntArrayWithLength & operator=(const CoinIntArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:829
CoinPartitionedVector
Definition: CoinIndexedVector.hpp:1057
CoinFactorizationLongDoubleArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:733
CoinIndexedVector::sort
void sort()
Sort the indexed storage vector (increasing indices).
Definition: CoinIndexedVector.hpp:354
CoinIndexedVector::setCapacity
void setCapacity(int value)
Reserve space.
Definition: CoinIndexedVector.hpp:421
CoinIndexedVector::operator-=
void operator-=(double value)
subtract value from every entry
CoinIndexedVector::sortDecrElement
void sortDecrElement()
Sort the indexed storage vector (increasing indices).
CoinPartitionedVector::checkClear
void checkClear()
For debug check vector is clear i.e. no elements.
CoinPartitionedVector::numberPartitions_
int numberPartitions_
Number of partitions (0 means off)
Definition: CoinIndexedVector.hpp:1161
CoinIndexedVector::capacity_
int capacity_
Amount of memory allocated for indices_, and elements_.
Definition: CoinIndexedVector.hpp:481
CoinDoubleArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:625
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(const CoinArbitraryArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:1040
CoinIndexedVector::checkClean
void checkClean()
For debug check vector is clean i.e. elements match indices.
CoinIndexedVector::getNumElements
int getNumElements() const
Get the size.
Definition: CoinIndexedVector.hpp:111
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:868
CoinIndexedVector::zero
void zero(int index)
Makes nonzero tiny.
Definition: CoinIndexedVector.hpp:243
CoinFinite.hpp
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:652
CoinIndexedVector::operator=
CoinIndexedVector & operator=(const CoinIndexedVector &)
Assignment operator.
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(const CoinBigIndexArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:880
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(const CoinVoidStarArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:985
CoinDoubleArrayWithLength
double * version
Definition: CoinIndexedVector.hpp:619
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(const CoinArbitraryArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:1043
CoinIndexedVector::cleanAndPackSafe
int cleanAndPackSafe(double tolerance)
Same but packs down and is safe (i.e. if order is odd)
CoinFactorizationDoubleArrayWithLength::operator=
CoinFactorizationDoubleArrayWithLength & operator=(const CoinFactorizationDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:721
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
CoinArrayWithLength::array_
char * array_
Array.
Definition: CoinIndexedVector.hpp:608
CoinPartitionedVector::numberElementsPartition_
int numberElementsPartition_[COIN_PARTITIONS]
Size of indices in a partition.
Definition: CoinIndexedVector.hpp:1159
CoinIndexedVector::expand
void expand()
This is mainly for testing - goes from packed to indexed.
CoinVoidStarArrayWithLength::operator=
CoinVoidStarArrayWithLength & operator=(const CoinVoidStarArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:991
CoinPartitionedVector::clearAndKeep
void clearAndKeep()
Reset the vector (as if were just created an empty vector). Keeps partitions.
CoinIntArrayWithLength::array
int * array() const
Get Array.
Definition: CoinIndexedVector.hpp:790
CoinIndexedVector::packedMode
bool packedMode() const
Gets packed mode.
Definition: CoinIndexedVector.hpp:427
CoinHelperFunctions.hpp
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(const CoinFactorizationDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:718
CoinIntArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:797
CoinPartitionedVector::reserve
void reserve(int n)
Reserve space.
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(const CoinFactorizationDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:715
CoinIndexedVector::isApproximatelyEqual
int isApproximatelyEqual(const CoinIndexedVector &rhs, double tolerance=1.0e-8) const
Equal with a tolerance (returns -1 or position of inequality).
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(const CoinUnsignedIntArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:931
CoinIndexedVector::sortIncrElement
void sortIncrElement()
Sort the indexed storage vector (increasing indices).
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(int length, int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:1031
CoinIndexedVector::operator==
bool operator==(const CoinPackedVectorBase &rhs) const
Equal.
CoinArrayWithLength::CoinArrayWithLength
CoinArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:570
CoinIndexedVector::sortDecrIndex
void sortDecrIndex()
Sort the indexed storage vector (increasing indices).
CoinDoubleArrayWithLength::array
double * array() const
Get Array.
Definition: CoinIndexedVector.hpp:628
CoinIndexedVector::operator-
CoinIndexedVector operator-(const CoinIndexedVector &op2)
Return the difference of two indexed vectors.
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(const CoinFactorizationLongDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:769
CoinIndexedVector::checkClear
void checkClear()
For debug check vector is clear i.e. no elements.
CoinPartitionedVector::checkClean
void checkClean()
For debug check vector is clean i.e. elements match indices.
CoinArbitraryArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:1013
CoinPartitionedVector::computeNumberElements
void computeNumberElements()
Add up number of elements in partitions.
CoinArrayWithLength::switchOff
void switchOff()
Set the size to -1.
Definition: CoinIndexedVector.hpp:544
CoinIndexedVector::elements_
double * elements_
Vector elements.
Definition: CoinIndexedVector.hpp:477
CoinIndexedVector::returnVector
void returnVector()
Return ownership of the arguments to this vector.
CoinIndexedVector::~CoinIndexedVector
~CoinIndexedVector()
Destructor.
CoinIndexedVector::operator+
CoinIndexedVector operator+(const CoinIndexedVector &op2)
Return the sum of two indexed vectors.
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:649
CoinArrayWithLength::getArray
void getArray(int size)
Get array with alignment.
CoinIndexedVector::setPackedMode
void setPackedMode(bool yesNo)
Sets packed mode.
Definition: CoinIndexedVector.hpp:424
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:865
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
CoinIndexedVector::denseVector
double * denseVector() const
Get the vector as a dense vector.
Definition: CoinIndexedVector.hpp:121
CoinIndexedVector::operator[]
double & operator[](int i) const
Access the i&#39;th element of the full storage vector.
void
typedef void(COINLINKAGE_CB *clp_callback)(Clp_Simplex *model
typedef for user call back.
CoinIndexedVector::insert
void insert(int index, double element)
Insert an element into the vector.
CoinPartitionedVector::startPartition
int startPartition(int partition) const
Get starts.
Definition: CoinIndexedVector.hpp:1074
CoinBigIndexArrayWithLength::operator=
CoinBigIndexArrayWithLength & operator=(const CoinBigIndexArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:883
CoinDoubleArrayWithLength::operator=
CoinDoubleArrayWithLength & operator=(const CoinDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:667
CoinIndexedVector::borrowVector
void borrowVector(int size, int numberIndices, int *inds, double *elems)
Borrow ownership of the arguments to this vector.
CoinArrayWithLength::copy
void copy(const CoinArrayWithLength &rhs, int numberBytes=-1)
Assignment with length (if -1 use internal length)
CoinIndexedVector::print
void print() const
Print out.
CoinArrayWithLength::setPersistence
void setPersistence(int flag, int currentLength)
Does what is needed to set persistence.
CoinUnsignedIntArrayWithLength::operator=
CoinUnsignedIntArrayWithLength & operator=(const CoinUnsignedIntArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:937
CoinUnsignedIntArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:905
CoinFactorizationDouble
double CoinFactorizationDouble
Definition: CoinTypes.hpp:57
CoinPartitionedVector::operator=
CoinPartitionedVector & operator=(const CoinPartitionedVector &)
Assignment operator.
CoinArrayWithLength
Pointer with length in bytes.
Definition: CoinIndexedVector.hpp:513
CoinIndexedVector::operator+=
void operator+=(double value)
add value to every entry
CoinFactorizationDoubleArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:679
COIN_DBL_MIN
const double COIN_DBL_MIN
Definition: CoinFinite.hpp:17
CoinIndexedVector::operator*=
void operator*=(double value)
multiply every entry by value
CoinArrayWithLength::conditionalNew
char * conditionalNew(long sizeWanted)
Conditionally gets new array.
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
CoinFactorizationDoubleArrayWithLength::array
CoinFactorizationDouble * array() const
Get Array.
Definition: CoinIndexedVector.hpp:682
CoinIndexedVector::createOneUnpackedElement
void createOneUnpackedElement(int index, double element)
Create unpacked singleton.
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(const CoinVoidStarArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:988
CoinIntArrayWithLength
int * version
Definition: CoinIndexedVector.hpp:781
CoinBigIndexArrayWithLength::array
CoinBigIndex * array() const
Get Array.
Definition: CoinIndexedVector.hpp:844
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
CoinUnsignedIntArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:895
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) ...
CoinIntArrayWithLength::conditionalNew
int * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:804
CoinUnsignedIntArrayWithLength::array
unsigned int * array() const
Get Array.
Definition: CoinIndexedVector.hpp:898
CoinIndexedVector::capacity
int capacity() const
capacity returns the size which could be accomodated without having to reallocate storage...
Definition: CoinIndexedVector.hpp:420
CoinArrayWithLength::clear
void clear()
Zero out array.
CoinVoidStarArrayWithLength
void * version
Definition: CoinIndexedVector.hpp:943
CoinPartitionedVector::~CoinPartitionedVector
~CoinPartitionedVector()
Destructor.
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:919
CoinIndexedVector
Indexed Vector.
Definition: CoinIndexedVector.hpp:104
CoinIntArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:787
CoinArbitraryArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:1003
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:811
CoinArrayWithLength::getCapacity
void getCapacity(int numberBytes, int numberIfNeeded=-1)
Get enough space (if more needed then do at least needed)
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(const CoinFactorizationLongDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:772
CoinIndexedVector::gutsOfSetPackedVector
void gutsOfSetPackedVector(int size, int numberIndices, const int *inds, const double *elems)
Copy internal data.
CoinArbitraryArrayWithLength::array
void ** array() const
Get Array.
Definition: CoinIndexedVector.hpp:1006
CoinFactorizationLongDoubleArrayWithLength::conditionalNew
long double * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:750
CoinIndexedVector::CoinIndexedVectorUnitTest
friend void CoinIndexedVectorUnitTest()
A function that tests the methods in the CoinIndexedVector class.
CoinPartitionedVector::compact
void compact()
Add up number of elements in partitions and pack and get rid of partitions.
CoinArbitraryArrayWithLength::lengthInBytes_
int lengthInBytes_
Length in bytes.
Definition: CoinIndexedVector.hpp:1054
CoinArrayWithLength::switchOn
void switchOn(int alignment=3)
Set the size to -2 and alignment.
Definition: CoinIndexedVector.hpp:547
CoinIndexedVector::scanAndPack
int scanAndPack()
These are same but pack down.
CoinIndexedVector::swap
void swap(int i, int j)
Swap values in positions i and j of indices and elements.
CoinIndexedVector::getIndices
int * getIndices()
Get element values.
Definition: CoinIndexedVector.hpp:117
CoinPartitionedVector::clearAndReset
void clearAndReset()
Reset the vector (as if were just created an empty vector). Gets rid of partitions.
CoinIndexedVector::nElements_
int nElements_
Size of indices and packed elements vectors.
Definition: CoinIndexedVector.hpp:479
CoinArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:519
CoinPartitionedVector::clearPartition
void clearPartition(int partition)
Clear a partition.
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:973
CoinVoidStarArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:949
CoinArrayWithLength::array
const char * array() const
Get Array.
Definition: CoinIndexedVector.hpp:534
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
CoinArrayWithLength::switchedOn
bool switchedOn() const
See if persistence already on.
Definition: CoinIndexedVector.hpp:525
CoinIndexedVector::setPacked
void setPacked()
Mark as packed.
Definition: CoinIndexedVector.hpp:256
CoinFactorizationDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:689
CoinPartitionedVector::setNumElementsPartition
void setNumElementsPartition(int partition, int value)
Set the size of a partition.
Definition: CoinIndexedVector.hpp:1087
CoinIndexedVector::clean
int clean(double tolerance)
set all small values to zero and return number remaining
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(const CoinIntArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:826
CoinPartitionedVector::setPartitions
void setPartitions(int number, const int *starts)
Setup partitions (needs end as well)
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(const CoinIntArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:823
CoinIndexedVector::gutsOfSetConstant
void gutsOfSetConstant(int size, const int *inds, double value)
Copy internal data.
CoinBigIndexArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:851
CoinSort.hpp
CoinIndexedVector::createPacked
void createPacked(int number, const int *indices, const double *elements)
Create packed array.
CoinIndexedVector::quickInsert
void quickInsert(int index, double element)
Insert a nonzero element into the vector.
Definition: CoinIndexedVector.hpp:193
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::append
void append(const CoinPackedVectorBase &caboose)
Append a CoinPackedVector to the end.
CoinBigIndexArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:841
CoinIndexedVector::setNumElements
void setNumElements(int value)
Set the size.
Definition: CoinIndexedVector.hpp:140
CoinUnsignedIntArrayWithLength::conditionalNew
unsigned int * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:912
CoinPartitionedVector::getNumPartitions
int getNumPartitions() const
Get number of partitions.
Definition: CoinIndexedVector.hpp:1069
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
CoinArrayWithLength::CoinArrayWithLength
CoinArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:574
CoinPackedVectorBase.hpp
CoinIndexedVector::setIndexVector
void setIndexVector(int *array)
For very temporary use when user needs to borrow an index vector.
Definition: CoinIndexedVector.hpp:126
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...
CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDouble * version.
Definition: CoinIndexedVector.hpp:727
CoinPartitionedVector::print
void print() const
Scan dense region from start to &lt; end and set up indices returns number found.
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:706
CoinIndexedVector::empty
void empty()
Reset the vector (as if were just created an empty vector)
CoinArrayWithLength::reallyFreeArray
void reallyFreeArray()
Really get rid of array with alignment.
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...
CoinArbitraryArrayWithLength
arbitrary version
Definition: CoinIndexedVector.hpp:997
CoinArbitraryArrayWithLength::operator=
CoinArbitraryArrayWithLength & operator=(const CoinArbitraryArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:1046
CoinBigIndexArrayWithLength::conditionalNew
CoinBigIndex * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:858
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(const CoinDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:661
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(int length=1)
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:1028
CoinBigIndexArrayWithLength
CoinBigIndex * version.
Definition: CoinIndexedVector.hpp:835
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(const CoinDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:664
CoinIndexedVector::setConstant
void setConstant(int size, const int *inds, double elems)
Elements set to have the same scalar value.
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:922
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
CoinArrayWithLength::size_
CoinBigIndex size_
Size of array in bytes.
Definition: CoinIndexedVector.hpp:610
CoinPartitionedVector::startPartitions
const int * startPartitions() const
Get starts.
Definition: CoinIndexedVector.hpp:1077
CoinVoidStarArrayWithLength::conditionalNew
void ** conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:966
CoinArrayWithLength::rawSize
int rawSize() const
Get the size.
Definition: CoinIndexedVector.hpp:522
CoinArrayWithLength::allocate
void allocate(const CoinArrayWithLength &rhs, int numberBytes)
Assignment with length - does not copy.
CoinArrayWithLength::alignment_
int alignment_
Alignment wanted (power of 2)
Definition: CoinIndexedVector.hpp:614
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
CoinIndexedVector::setDenseVector
void setDenseVector(double *array)
For very temporary use when user needs to borrow a dense vector.
Definition: CoinIndexedVector.hpp:123
CoinArrayWithLength::offset_
int offset_
Offset of array.
Definition: CoinIndexedVector.hpp:612
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:814
CoinArrayWithLength::capacity
int capacity() const
Get the capacity (just read it)
Definition: CoinIndexedVector.hpp:528
CoinDoubleArrayWithLength::conditionalNew
double * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:642
CoinFactorizationDoubleArrayWithLength
CoinFactorizationDouble * version.
Definition: CoinIndexedVector.hpp:673
CoinIndexedVector::gutsOfSetVector
void gutsOfSetVector(int size, const int *inds, const double *elems)
Copy internal data.
CoinPartitionedVector::setTempNumElementsPartition
void setTempNumElementsPartition(int partition, int value)
Set the size of a partition (just for a tiny while)
Definition: CoinIndexedVector.hpp:1090
CoinIndexedVector::packedMode_
bool packedMode_
If true then is operating in packed mode.
Definition: CoinIndexedVector.hpp:485
CoinPartitionedVector::sort
void sort()
Sort the indexed storage vector (increasing indices).
CoinFactorizationLongDoubleArrayWithLength::array
long double * array() const
Get Array.
Definition: CoinIndexedVector.hpp:736
CoinIndexedVector::truncate
void truncate(int newSize)
Throw away all entries in rows &gt;= newSize.
CoinIndexedVector::offset_
int offset_
Offset to get where new allocated array.
Definition: CoinIndexedVector.hpp:483
CoinIndexedVector::getMinIndex
int getMinIndex() const
Get value of minimum index.
CoinFactorizationLongDoubleArrayWithLength::operator=
CoinFactorizationLongDoubleArrayWithLength & operator=(const CoinFactorizationLongDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:775
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
CoinDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:635
COIN_INDEXED_TINY_ELEMENT
#define COIN_INDEXED_TINY_ELEMENT
Definition: CoinIndexedVector.hpp:24
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::copy
void copy(const CoinIndexedVector &rhs, double multiplier=1.0)
Copy the contents of one vector into another.
CoinIndexedVector::sortPacked
void sortPacked()
Sort the indexed storage vector (increasing indices).
CoinPartitionedVector::startPartition_
int startPartition_[COIN_PARTITIONS+1]
Starts.
Definition: CoinIndexedVector.hpp:1157
CoinSizeofAsInt
#define CoinSizeofAsInt(type)
Cube Root.
Definition: CoinHelperFunctions.hpp:942
CoinIndexedVector::getIndices
const int * getIndices() const
Get indices of elements.
Definition: CoinIndexedVector.hpp:113
CoinPartitionedVector::getNumElements
int getNumElements() const
Get the size.
Definition: CoinIndexedVector.hpp:1072
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:976
CoinArbitraryArrayWithLength::conditionalNew
char * conditionalNew(int length, int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:1020
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(const CoinBigIndexArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:877
CoinPartitionedVector::CoinPartitionedVector
CoinPartitionedVector()
Default constructor.
CoinIndexedVector::cleanAndPack
int cleanAndPack(double tolerance)
Same but packs down.
CoinIndexedVector::clear
void clear()
Reset the vector (as if were just created an empty vector). This leaves arrays!
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:760
CoinIndexedVector::indices_
int * indices_
Vector indices.
Definition: CoinIndexedVector.hpp:475
CoinIndexedVector::scan
int scan()
Scan dense region and set up indices (returns number found)