CoinUtils  2.10.14
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 
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();
148 #ifndef CLP_NO_VECTOR
149 
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 
358  { std::sort(indices_,indices_+nElements_); }
359 
361 
363 
365  void sortPacked();
366 
368 
369  //#############################################################################
370 
384  const CoinIndexedVector& op2);
385 
388  const CoinIndexedVector& op2);
389 
392  const CoinIndexedVector& op2);
393 
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 
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);
448 #ifndef CLP_NO_VECTOR
449 
451 #endif
452 
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_;
483  int offset_;
487 };
488 
489 //#############################################################################
495 void
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);
566 
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);
591  void copy(const CoinArrayWithLength & rhs, int numberBytes=-1);
593  void allocate(const CoinArrayWithLength & rhs, int numberBytes);
597  void getArray(int size);
601  void getCapacity(int numberBytes,int numberIfNeeded=-1);
603 
604 protected:
607  char * array_;
612  int offset_;
616 };
618 
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 
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) {}
662  : CoinArrayWithLength(rhs) {}
665  : CoinArrayWithLength(rhs) {}
668  { CoinArrayWithLength::operator=(rhs); return *this;}
670 };
672 
674 
675 public:
678  inline int getSize() const
682  inline CoinFactorizationDouble * array() const
683  { return reinterpret_cast<CoinFactorizationDouble *> ((size_>-2) ? array_ : NULL); }
685 
688  inline void setSize(int value)
692 
695  inline CoinFactorizationDouble * conditionalNew(int sizeWanted)
697  { return reinterpret_cast<CoinFactorizationDouble *> (CoinArrayWithLength::conditionalNew(sizeWanted>=0 ? static_cast<long> (( sizeWanted)*CoinSizeofAsInt(CoinFactorizationDouble)) : -1)); }
699 
704  { array_=NULL; size_=-1;}
707  { array_=new char [size*CoinSizeofAsInt(CoinFactorizationDouble)]; size_=-1;}
712  inline CoinFactorizationDoubleArrayWithLength(int size, int mode)
716  : CoinArrayWithLength(rhs) {}
719  : CoinArrayWithLength(rhs) {}
722  { CoinArrayWithLength::operator=(rhs); return *this;}
724 };
726 
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 
758  { array_=NULL; size_=-1;}
761  { array_=new char [size*CoinSizeofAsInt(long double)]; size_=-1;}
767  : CoinArrayWithLength(size*CoinSizeofAsInt(long double),mode) {}
770  : CoinArrayWithLength(rhs) {}
773  : CoinArrayWithLength(rhs) {}
776  { CoinArrayWithLength::operator=(rhs); return *this;}
778 };
780 
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 
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) {}
824  : CoinArrayWithLength(rhs) {}
827  : CoinArrayWithLength(rhs) {}
830  { CoinArrayWithLength::operator=(rhs); return *this;}
832 };
834 
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 
866  { array_=NULL; size_=-1;}
869  { array_=new char [size*CoinSizeofAsInt(CoinBigIndex)]; size_=-1;}
874  inline CoinBigIndexArrayWithLength(int size, int mode)
878  : CoinArrayWithLength(rhs) {}
881  : CoinArrayWithLength(rhs) {}
884  { CoinArrayWithLength::operator=(rhs); return *this;}
886 };
888 
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 
920  { array_=NULL; size_=-1;}
923  { array_=new char [size*CoinSizeofAsInt(unsigned int)]; size_=-1;}
928  inline CoinUnsignedIntArrayWithLength(int size, int mode)
929  : CoinArrayWithLength(size*CoinSizeofAsInt(unsigned int),mode) {}
932  : CoinArrayWithLength(rhs) {}
935  : CoinArrayWithLength(rhs) {}
938  { CoinArrayWithLength::operator=(rhs); return *this;}
940 };
942 
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 
974  { array_=NULL; size_=-1;}
977  { array_=new char [size*CoinSizeofAsInt(void *)]; size_=-1;}
982  inline CoinVoidStarArrayWithLength(int size, int mode)
983  : CoinArrayWithLength(size*CoinSizeofAsInt(void *),mode) {}
986  : CoinArrayWithLength(rhs) {}
989  : CoinArrayWithLength(rhs) {}
992  { CoinArrayWithLength::operator=(rhs); return *this;}
994 };
996 
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;}
1041  : CoinArrayWithLength(rhs) {}
1044  : CoinArrayWithLength(rhs) {}
1047  { CoinArrayWithLength::operator=(rhs); return *this;}
1049 
1050 protected:
1053  int lengthInBytes_;
1056 };
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; }
1095  void compact();
1098  void reserve(int n);
1100  void setPartitions(int number,const int * starts);
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 
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);
1153 protected:
1163 };
1164 #endif
CoinFactorizationLongDoubleArrayWithLength::operator=
CoinFactorizationLongDoubleArrayWithLength & operator=(const CoinFactorizationLongDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:775
CoinIndexedVector::isApproximatelyEqual
int isApproximatelyEqual(const CoinIndexedVector &rhs, double tolerance=1.0e-8) const
Equal with a tolerance (returns -1 or position of inequality).
CoinIndexedVector
Indexed Vector.
Definition: CoinIndexedVector.hpp:104
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(const CoinIntArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:823
CoinIndexedVector::offset_
int offset_
Offset to get where new allocated array.
Definition: CoinIndexedVector.hpp:483
CoinIndexedVector::CoinIndexedVector
CoinIndexedVector(int size)
Alternate Constructors - just size.
CoinIndexedVector::CoinIndexedVector
CoinIndexedVector(const CoinIndexedVector &)
Copy constructor.
CoinIndexedVector::scanAndPack
int scanAndPack(double tolerance)
CoinPartitionedVector::clearPartition
void clearPartition(int partition)
Clear a partition.
CoinIndexedVector::cleanAndPackSafe
int cleanAndPackSafe(double tolerance)
Same but packs down and is safe (i.e. if order is odd)
CoinIndexedVector::setPackedMode
void setPackedMode(bool yesNo)
Sets packed mode.
Definition: CoinIndexedVector.hpp:424
CoinIndexedVector::getIndices
int * getIndices()
Get element values.
Definition: CoinIndexedVector.hpp:117
CoinIndexedVector::zero
void zero(int index)
Makes nonzero tiny.
Definition: CoinIndexedVector.hpp:243
CoinIndexedVector::scan
int scan(int start, int end, double tolerance)
Scan dense region from start to < end and set up indices returns number found.
CoinArrayWithLength::allocate
void allocate(const CoinArrayWithLength &rhs, int numberBytes)
Assignment with length - does not copy.
CoinArrayWithLength::CoinArrayWithLength
CoinArrayWithLength(int size, int mode)
Alternate Constructor - length in bytes mode - 0 size_ set to size mode>0 size_ set to size and zeroe...
CoinArrayWithLength::switchOff
void switchOff()
Set the size to -1.
Definition: CoinIndexedVector.hpp:544
COIN_PARTITIONS
#define COIN_PARTITIONS
Definition: CoinIndexedVector.hpp:1061
CoinPartitionedVector::numberPartitions_
int numberPartitions_
Number of partitions (0 means off)
Definition: CoinIndexedVector.hpp:1161
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(const CoinUnsignedIntArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:934
CoinIndexedVector::denseVector
double * denseVector() const
Get the vector as a dense vector.
Definition: CoinIndexedVector.hpp:121
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(int size, int mode)
Alternate Constructor - length in bytes mode - 0 size_ set to size 1 size_ set to size and zeroed.
Definition: CoinIndexedVector.hpp:766
CoinFactorizationDoubleArrayWithLength::operator=
CoinFactorizationDoubleArrayWithLength & operator=(const CoinFactorizationDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:721
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(const CoinVoidStarArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:985
CoinDoubleArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:625
CoinIndexedVector::clear
void clear()
Reset the vector (as if were just created an empty vector). This leaves arrays!
CoinArrayWithLength::setCapacity
void setCapacity()
Set the capacity to >=0 if <=-2.
Definition: CoinIndexedVector.hpp:531
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(const CoinBigIndexArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:880
CoinArrayWithLength::operator=
CoinArrayWithLength & operator=(const CoinArrayWithLength &rhs)
Assignment operator.
CoinArrayWithLength::CoinArrayWithLength
CoinArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:570
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:649
CoinVoidStarArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:949
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(int length, int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:1031
CoinArbitraryArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:1013
CoinArbitraryArrayWithLength::operator=
CoinArbitraryArrayWithLength & operator=(const CoinArbitraryArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:1046
CoinIndexedVector::CoinIndexedVectorUnitTest
friend void CoinIndexedVectorUnitTest()
A function that tests the methods in the CoinIndexedVector class.
CoinIndexedVector::nElements_
int nElements_
Size of indices and packed elements vectors.
Definition: CoinIndexedVector.hpp:479
CoinFactorizationDouble
double CoinFactorizationDouble
Definition: CoinTypes.hpp:57
CoinIndexedVector::insert
void insert(int index, double element)
Insert an element into the vector.
CoinIndexedVectorUnitTest
void CoinIndexedVectorUnitTest()
A function that tests the methods in the CoinIndexedVector class.
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:814
CoinArrayWithLength::CoinArrayWithLength
CoinArrayWithLength(const CoinArrayWithLength *rhs)
Copy constructor.2.
CoinIndexedVector::packedMode_
bool packedMode_
If true then is operating in packed mode.
Definition: CoinIndexedVector.hpp:485
CoinIndexedVector::operator*=
void operator*=(double value)
multiply every entry by value
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(const CoinFactorizationLongDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:772
CoinPartitionedVector::CoinPartitionedVector
CoinPartitionedVector()
Default constructor.
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength(const CoinIntArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:826
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:973
CoinFactorizationDoubleArrayWithLength::conditionalNew
CoinFactorizationDouble * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:696
CoinIndexedVector::getMinIndex
int getMinIndex() const
Get value of minimum index.
CoinIndexedVector::setNumElements
void setNumElements(int value)
Set the size.
Definition: CoinIndexedVector.hpp:140
CoinIndexedVector::operator/=
void operator/=(double value)
divide every entry by value (** 0 vanishes)
CoinUnsignedIntArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:905
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:652
CoinIndexedVector::scan
int scan(double tolerance)
Scan dense region and set up indices (returns number found).
CoinIndexedVector::~CoinIndexedVector
~CoinIndexedVector()
Destructor.
CoinPartitionedVector::setNumElementsPartition
void setNumElementsPartition(int partition, int value)
Set the size of a partition.
Definition: CoinIndexedVector.hpp:1087
CoinArrayWithLength::CoinArrayWithLength
CoinArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:574
CoinIndexedVector::operator-
CoinIndexedVector operator-(const CoinIndexedVector &op2)
Return the difference of two indexed vectors.
CoinIndexedVector::truncate
void truncate(int newSize)
Throw away all entries in rows >= newSize.
CoinIndexedVector::sortIncrIndex
void sortIncrIndex()
Definition: CoinIndexedVector.hpp:357
CoinArbitraryArrayWithLength::array
void ** array() const
Get Array.
Definition: CoinIndexedVector.hpp:1006
CoinDoubleArrayWithLength::array
double * array() const
Get Array.
Definition: CoinIndexedVector.hpp:628
CoinPartitionedVector::CoinPartitionedVector
CoinPartitionedVector(int size, const int *inds, const double *elems)
Alternate Constructors - set elements to vector of doubles.
CoinIndexedVector::CoinIndexedVector
CoinIndexedVector(int size, const double *elements)
Alternate Constructors - construct full storage with indices 0 through size-1.
CoinPartitionedVector::~CoinPartitionedVector
~CoinPartitionedVector()
Destructor.
CoinFactorizationDoubleArrayWithLength::array
CoinFactorizationDouble * array() const
Get Array.
Definition: CoinIndexedVector.hpp:682
CoinUnsignedIntArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:895
CoinPartitionedVector::print
void print() const
Scan dense region from start to < end and set up indices returns number found.
CoinIndexedVector::clean
int clean(double tolerance)
set all small values to zero and return number remaining
CoinPartitionedVector::setPartitions
void setPartitions(int number, const int *starts)
Setup partitions (needs end as well)
CoinVoidStarArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:959
CoinArbitraryArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:1003
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:703
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
CoinPartitionedVector::CoinPartitionedVector
CoinPartitionedVector(const CoinPartitionedVector &)
Copy constructor.
COIN_DBL_MIN
const double COIN_DBL_MIN
Definition: CoinFinite.hpp:17
CoinIndexedVector::CoinIndexedVector
CoinIndexedVector(const CoinPackedVectorBase &rhs)
Copy constructor from a PackedVectorBase.
CoinIndexedVector::setVector
void setVector(int numberIndices, const int *inds, const double *elems)
Set vector numberIndices, indices, and elements.
CoinIndexedVector::operator/=
void operator/=(const CoinIndexedVector &op2)
The element-wise ratio of two indexed vectors (0.0/0.0 => 0.0) (0 vanishes)
CoinIndexedVector::operator+=
void operator+=(double value)
add value to every entry
CoinIndexedVector::operator==
bool operator==(const CoinIndexedVector &rhs) const
Equal.
CoinIndexedVector::operator[]
double & operator[](int i) const
Access the i'th element of the full storage vector.
CoinPartitionedVector::CoinPartitionedVector
CoinPartitionedVector(const CoinPartitionedVector *)
Copy constructor.2.
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::getMaxIndex
int getMaxIndex() const
Get value of maximum index.
CoinIndexedVector::scanAndPack
int scanAndPack(int start, int end, double tolerance)
CoinIndexedVector::gutsOfSetPackedVector
void gutsOfSetPackedVector(int size, int numberIndices, const int *inds, const double *elems)
CoinArrayWithLength::array_
char * array_
Array.
Definition: CoinIndexedVector.hpp:608
CoinIntArrayWithLength::array
int * array() const
Get Array.
Definition: CoinIndexedVector.hpp:790
CoinIndexedVector::gutsOfSetConstant
void gutsOfSetConstant(int size, const int *inds, double value)
CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDouble * version.
Definition: CoinIndexedVector.hpp:727
CoinIndexedVector::operator+=
void operator+=(const CoinIndexedVector &op2)
The sum of two indexed vectors.
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
CoinPartitionedVector::getNumPartitions
int getNumPartitions() const
Get number of partitions.
Definition: CoinIndexedVector.hpp:1069
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(int length=1)
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:1028
CoinPartitionedVector::CoinPartitionedVector
CoinPartitionedVector(int size, const int *inds, double element)
Alternate Constructors - set elements to same scalar value.
CoinIntArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:797
CoinIndexedVector::gutsOfSetVector
void gutsOfSetVector(int size, const int *inds, const double *elems)
Copy internal data.
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:868
CoinIndexedVector::operator+
CoinIndexedVector operator+(const CoinIndexedVector &op2)
Return the sum of two indexed vectors.
CoinFactorizationDoubleArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:679
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::createUnpacked
void createUnpacked(int number, const int *indices, const double *elements)
Create unpacked array.
CoinArrayWithLength
Pointer with length in bytes.
Definition: CoinIndexedVector.hpp:513
CoinPartitionedVector::computeNumberElements
void computeNumberElements()
Add up number of elements in partitions.
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(const CoinDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:664
CoinIndexedVector::checkClear
void checkClear()
For debug check vector is clear i.e. no elements.
CoinIndexedVector::CoinIndexedVector
CoinIndexedVector(int size, const int *inds, double element)
Alternate Constructors - set elements to same scalar value.
CoinSizeofAsInt
#define CoinSizeofAsInt(type)
Cube Root.
Definition: CoinHelperFunctions.hpp:942
CoinUnsignedIntArrayWithLength::array
unsigned int * array() const
Get Array.
Definition: CoinIndexedVector.hpp:898
CoinBigIndexArrayWithLength::array
CoinBigIndex * array() const
Get Array.
Definition: CoinIndexedVector.hpp:844
CoinArrayWithLength::offset_
int offset_
Offset of array.
Definition: CoinIndexedVector.hpp:612
CoinIndexedVector::append
void append(const CoinPackedVectorBase &caboose)
Append a CoinPackedVector to the end.
CoinIndexedVector::add
void add(int index, double element)
Insert or if exists add an element into the vector Any resulting zero elements will be made tiny.
CoinArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:541
CoinDoubleArrayWithLength::CoinDoubleArrayWithLength
CoinDoubleArrayWithLength(const CoinDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:661
CoinArrayWithLength::conditionalNew
char * conditionalNew(long sizeWanted)
Conditionally gets new array.
CoinPartitionedVector::CoinPartitionedVector
CoinPartitionedVector(int size, const double *elements)
Alternate Constructors - construct full storage with indices 0 through size-1.
CoinPartitionedVector::checkClean
void checkClean()
For debug check vector is clean i.e. elements match indices.
CoinIndexedVector::operator=
CoinIndexedVector & operator=(const CoinPackedVectorBase &rhs)
Assignment operator from a CoinPackedVectorBase.
CoinPartitionedVector::operator=
CoinPartitionedVector & operator=(const CoinPartitionedVector &)
Assignment operator.
CoinIndexedVector::sortDecrIndex
void sortDecrIndex()
CoinVoidStarArrayWithLength::operator=
CoinVoidStarArrayWithLength & operator=(const CoinVoidStarArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:991
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
CoinArrayWithLength::alignment_
int alignment_
Alignment wanted (power of 2)
Definition: CoinIndexedVector.hpp:614
CoinArrayWithLength::switchOn
void switchOn(int alignment=3)
Set the size to -2 and alignment.
Definition: CoinIndexedVector.hpp:547
CoinFactorizationLongDoubleArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:733
CoinPartitionedVector::CoinPartitionedVector
CoinPartitionedVector(int size)
Alternate Constructors - just size.
CoinIntArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:787
CoinIndexedVector::returnVector
void returnVector()
Return ownership of the arguments to this vector.
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(const CoinVoidStarArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:988
CoinVoidStarArrayWithLength::conditionalNew
void ** conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:966
CoinIndexedVector::setIndexVector
void setIndexVector(int *array)
For very temporary use when user needs to borrow an index vector.
Definition: CoinIndexedVector.hpp:126
CoinIndexedVector::setPacked
void setPacked()
Mark as packed.
Definition: CoinIndexedVector.hpp:256
CoinVoidStarArrayWithLength
void * version
Definition: CoinIndexedVector.hpp:943
CoinIndexedVector::elements_
double * elements_
Vector elements.
Definition: CoinIndexedVector.hpp:477
CoinUnsignedIntArrayWithLength::operator=
CoinUnsignedIntArrayWithLength & operator=(const CoinUnsignedIntArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:937
CoinArrayWithLength::CoinArrayWithLength
CoinArrayWithLength(const CoinArrayWithLength &rhs)
Copy constructor.
CoinArrayWithLength::setPersistence
void setPersistence(int flag, int currentLength)
Does what is needed to set persistence.
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(int size, int mode)
Alternate Constructor - length in bytes mode - 0 size_ set to size 1 size_ set to size and zeroed.
Definition: CoinIndexedVector.hpp:712
CoinIndexedVector::append
void append(CoinIndexedVector &other, int adjustIndex, bool zapElements=false)
Append a CoinIndexedVector to the end and modify indices.
CoinArrayWithLength::switchedOn
bool switchedOn() const
See if persistence already on.
Definition: CoinIndexedVector.hpp:525
CoinIndexedVector::cleanAndPack
int cleanAndPack(double tolerance)
Same but packs down.
CoinDoubleArrayWithLength::operator=
CoinDoubleArrayWithLength & operator=(const CoinDoubleArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:667
CoinIndexedVector::CoinIndexedVector
CoinIndexedVector()
Default constructor.
CoinPartitionedVector
Definition: CoinIndexedVector.hpp:1057
CoinIntArrayWithLength::conditionalNew
int * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:804
CoinHelperFunctions.hpp
CoinPartitionedVector::numberElementsPartition_
int numberElementsPartition_[COIN_PARTITIONS]
Size of indices in a partition.
Definition: CoinIndexedVector.hpp:1159
CoinIndexedVector::sortIncrElement
void sortIncrElement()
CoinIndexedVector::createPacked
void createPacked(int number, const int *indices, const double *elements)
Create packed array.
CoinPartitionedVector::sort
void sort()
Sort the indexed storage vector (increasing indices).
CoinArrayWithLength::clear
void clear()
Zero out array.
CoinPartitionedVector::compact
void compact()
Add up number of elements in partitions and pack and get rid of partitions.
CoinArrayWithLength::getArray
void getArray(int size)
Get array with alignment.
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(const CoinUnsignedIntArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:931
CoinIndexedVector::swap
void swap(int i, int j)
Swap values in positions i and j of indices and elements.
CoinIndexedVector::borrowVector
void borrowVector(int size, int numberIndices, int *inds, double *elems)
Borrow ownership of the arguments to this vector.
CoinPartitionedVector::checkClear
void checkClear()
For debug check vector is clear i.e. no elements.
CoinIntArrayWithLength
int * version
Definition: CoinIndexedVector.hpp:781
CoinArrayWithLength::copy
void copy(const CoinArrayWithLength &rhs, int numberBytes=-1)
Assignment with length (if -1 use internal length)
CoinArrayWithLength::reallyFreeArray
void reallyFreeArray()
Really get rid of array with alignment.
CoinPackedVectorBase
Abstract base class for various sparse vectors.
Definition: CoinPackedVectorBase.hpp:23
CoinDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:635
CoinIndexedVector::operator=
CoinIndexedVector & operator=(const CoinIndexedVector &)
Assignment operator.
CoinIndexedVector::setDenseVector
void setDenseVector(double *array)
For very temporary use when user needs to borrow a dense vector.
Definition: CoinIndexedVector.hpp:123
CoinArrayWithLength::getCapacity
void getCapacity(int numberBytes, int numberIfNeeded=-1)
Get enough space (if more needed then do at least needed)
CoinIndexedVector::operator-=
void operator-=(double value)
subtract value from every entry
CoinFactorizationLongDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:743
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:922
CoinIndexedVector::operator*=
void operator*=(const CoinIndexedVector &op2)
The element-wise product of two indexed vectors.
CoinIndexedVector::operator==
bool operator==(const CoinPackedVectorBase &rhs) const
Equal.
CoinIndexedVector::operator*
CoinIndexedVector operator*(const CoinIndexedVector &op2)
Return the element-wise product of two indexed vectors.
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:760
CoinIndexedVector::expand
void expand()
This is mainly for testing - goes from packed to indexed.
CoinVoidStarArrayWithLength::array
void ** array() const
Get Array.
Definition: CoinIndexedVector.hpp:952
CoinPartitionedVector::setTempNumElementsPartition
void setTempNumElementsPartition(int partition, int value)
Set the size of a partition (just for a tiny while)
Definition: CoinIndexedVector.hpp:1090
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength(const CoinFactorizationLongDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:769
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(const CoinArbitraryArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:1040
CoinPartitionedVector::startPartition
int startPartition(int partition) const
Get starts.
Definition: CoinIndexedVector.hpp:1074
CoinIntArrayWithLength::CoinIntArrayWithLength
CoinIntArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:811
CoinFactorizationDoubleArrayWithLength
CoinFactorizationDouble * version.
Definition: CoinIndexedVector.hpp:673
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:865
CoinIndexedVector::getIndices
const int * getIndices() const
Get indices of elements.
Definition: CoinIndexedVector.hpp:113
CoinArrayWithLength::swap
void swap(CoinArrayWithLength &other)
Swaps memory between two members.
CoinUnsignedIntArrayWithLength::conditionalNew
unsigned int * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:912
CoinIndexedVector::operator!=
bool operator!=(const CoinIndexedVector &rhs) const
Not equal.
CoinIndexedVector::operator-=
void operator-=(const CoinIndexedVector &op2)
The difference of two indexed vectors.
CoinArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:519
CoinIndexedVector::scan
int scan()
Scan dense region and set up indices (returns number found)
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
CoinIndexedVector::capacity_
int capacity_
Amount of memory allocated for indices_, and elements_.
Definition: CoinIndexedVector.hpp:481
CoinIndexedVector::empty
void empty()
Reset the vector (as if were just created an empty vector)
CoinUnsignedIntArrayWithLength
unsigned int * version
Definition: CoinIndexedVector.hpp:889
CoinIndexedVector::setCapacity
void setCapacity(int value)
Definition: CoinIndexedVector.hpp:421
CoinIndexedVector::getNumElements
int getNumElements() const
Get the size.
Definition: CoinIndexedVector.hpp:111
CoinIntArrayWithLength::operator=
CoinIntArrayWithLength & operator=(const CoinIntArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:829
CoinArrayWithLength::conditionalDelete
void conditionalDelete()
Conditionally deletes.
CoinVoidStarArrayWithLength::CoinVoidStarArrayWithLength
CoinVoidStarArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:976
CoinFactorizationLongDoubleArrayWithLength::CoinFactorizationLongDoubleArrayWithLength
CoinFactorizationLongDoubleArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:757
CoinIndexedVector::capacity
int capacity() const
capacity returns the size which could be accomodated without having to reallocate storage.
Definition: CoinIndexedVector.hpp:420
CoinIndexedVector::setFull
void setFull(int size, const double *elems)
Indices are not specified and are taken to be 0,1,...,size-1.
CoinIndexedVector::sortPacked
void sortPacked()
CoinArrayWithLength::rawSize
int rawSize() const
Get the size.
Definition: CoinIndexedVector.hpp:522
CoinArbitraryArrayWithLength::conditionalNew
char * conditionalNew(int length, int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:1020
CoinIndexedVector::createOneUnpackedElement
void createOneUnpackedElement(int index, double element)
Create unpacked singleton.
CoinPartitionedVector::startPartitions
const int * startPartitions() const
Get starts.
Definition: CoinIndexedVector.hpp:1077
CoinIndexedVector::scanAndPack
int scanAndPack()
These are same but pack down.
CoinIndexedVector::operator/
CoinIndexedVector operator/(const CoinIndexedVector &op2)
Return the element-wise ratio of two indexed vectors (0.0/0.0 => 0.0) (0 vanishes)
COIN_INDEXED_TINY_ELEMENT
#define COIN_INDEXED_TINY_ELEMENT
Definition: CoinIndexedVector.hpp:24
CoinPartitionedVector::clearAndKeep
void clearAndKeep()
Reset the vector (as if were just created an empty vector). Keeps partitions.
CoinIndexedVector::print
void print() const
Print out.
CoinIndexedVector::operator!=
bool operator!=(const CoinPackedVectorBase &rhs) const
Not equal.
CoinDoubleArrayWithLength
double * version
Definition: CoinIndexedVector.hpp:619
CoinIndexedVector::checkClean
void checkClean()
For debug check vector is clean i.e. elements match indices.
CoinBigIndexArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:851
CoinIndexedVector::reserve
void reserve(int n)
Reserve space.
CoinBigIndexArrayWithLength::conditionalNew
CoinBigIndex * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:858
CoinIndexedVector::sort
void sort()
Sort the indexed storage vector (increasing indices).
Definition: CoinIndexedVector.hpp:354
CoinDoubleArrayWithLength::conditionalNew
double * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:642
CoinFactorizationDoubleArrayWithLength::setSize
void setSize(int value)
Set the size.
Definition: CoinIndexedVector.hpp:689
CoinArbitraryArrayWithLength
arbitrary version
Definition: CoinIndexedVector.hpp:997
CoinIndexedVector::CoinIndexedVector
CoinIndexedVector(int size, const int *inds, const double *elems)
Alternate Constructors - set elements to vector of doubles.
CoinIndexedVector::gutsOfSetVector
void gutsOfSetVector(int size, int numberIndices, const int *inds, const double *elems)
CoinArrayWithLength::size_
CoinBigIndex size_
Size of array in bytes.
Definition: CoinIndexedVector.hpp:610
CoinArrayWithLength::capacity
int capacity() const
Get the capacity (just read it)
Definition: CoinIndexedVector.hpp:528
CoinSort.hpp
CoinBigIndexArrayWithLength::operator=
CoinBigIndexArrayWithLength & operator=(const CoinBigIndexArrayWithLength &rhs)
Assignment operator.
Definition: CoinIndexedVector.hpp:883
CoinIndexedVector::CoinIndexedVector
CoinIndexedVector(const CoinIndexedVector *)
Copy constructor.2.
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(const CoinFactorizationDoubleArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:718
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(int size)
Alternate Constructor - length in bytes - size_ -1.
Definition: CoinIndexedVector.hpp:706
CoinIndexedVector::scanAndPack
int scanAndPack(int start, int end)
CoinIndexedVector::scan
int scan(int start, int end)
Scan dense region from start to < end and set up indices returns number found.
CoinArbitraryArrayWithLength::CoinArbitraryArrayWithLength
CoinArbitraryArrayWithLength(const CoinArbitraryArrayWithLength *rhs)
Copy constructor.2.
Definition: CoinIndexedVector.hpp:1043
CoinIndexedVector::indices_
int * indices_
Vector indices.
Definition: CoinIndexedVector.hpp:475
CoinArbitraryArrayWithLength::lengthInBytes_
int lengthInBytes_
Length in bytes.
Definition: CoinIndexedVector.hpp:1054
CoinPartitionedVector::startPartition_
int startPartition_[COIN_PARTITIONS+1]
Starts.
Definition: CoinIndexedVector.hpp:1157
CoinPackedVectorBase.hpp
CoinIndexedVector::packedMode
bool packedMode() const
Gets packed mode.
Definition: CoinIndexedVector.hpp:427
CoinArrayWithLength::extend
void extend(int newSize)
Extend a persistent array keeping data (size in bytes)
CoinIndexedVector::setVector
void setVector(int size, int numberIndices, const int *inds, const double *elems)
Set vector size, indices, and elements.
CoinPartitionedVector::reserve
void reserve(int n)
Reserve space.
CoinIndexedVector::setConstant
void setConstant(int size, const int *inds, double elems)
Elements set to have the same scalar value.
CoinUnsignedIntArrayWithLength::CoinUnsignedIntArrayWithLength
CoinUnsignedIntArrayWithLength()
Default constructor - NULL.
Definition: CoinIndexedVector.hpp:919
CoinBigIndex
int CoinBigIndex
Definition: Coin_C_defines.h:105
CoinFactorizationDoubleArrayWithLength::CoinFactorizationDoubleArrayWithLength
CoinFactorizationDoubleArrayWithLength(const CoinFactorizationDoubleArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:715
CoinIndexedVector::copy
void copy(const CoinIndexedVector &rhs, double multiplier=1.0)
Copy the contents of one vector into another.
CoinFactorizationLongDoubleArrayWithLength::conditionalNew
long double * conditionalNew(int sizeWanted)
Conditionally gets new array.
Definition: CoinIndexedVector.hpp:750
CoinBigIndexArrayWithLength::getSize
int getSize() const
Get the size.
Definition: CoinIndexedVector.hpp:841
CoinArrayWithLength::array
const char * array() const
Get Array.
Definition: CoinIndexedVector.hpp:534
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
CoinIndexedVector::quickInsert
void quickInsert(int index, double element)
Insert a nonzero element into the vector.
Definition: CoinIndexedVector.hpp:193
CoinPartitionedVector::clearAndReset
void clearAndReset()
Reset the vector (as if were just created an empty vector). Gets rid of partitions.
CoinFinite.hpp
CoinIndexedVector::setElement
void setElement(int index, double element)
Set an existing element in the indexed vector The first argument is the "index" into the elements() a...
CoinFactorizationLongDoubleArrayWithLength::array
long double * array() const
Get Array.
Definition: CoinIndexedVector.hpp:736
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
CoinPartitionedVector::getNumElements
int getNumElements() const
Get the size.
Definition: CoinIndexedVector.hpp:1072
CoinArrayWithLength::~CoinArrayWithLength
~CoinArrayWithLength()
Destructor.
CoinIndexedVector::sortDecrElement
void sortDecrElement()
CoinBigIndexArrayWithLength::CoinBigIndexArrayWithLength
CoinBigIndexArrayWithLength(const CoinBigIndexArrayWithLength &rhs)
Copy constructor.
Definition: CoinIndexedVector.hpp:877
CoinBigIndexArrayWithLength
CoinBigIndex * version.
Definition: CoinIndexedVector.hpp:835