Clp 1.17.5
Loading...
Searching...
No Matches
CoinAbcBaseFactorization.hpp
Go to the documentation of this file.
1/* $Id: CoinAbcBaseFactorization.hpp 2385 2019-01-06 19:43:06Z unxusr $ */
2// Copyright (C) 2002, International Business Machines
3// Corporation and others, Copyright (C) 2012, FasterCoin. All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5
6/*
7 Authors
8
9 John Forrest
10
11 */
18#include "AbcCommon.hpp"
20#if ABC_PARALLEL
21#define FACTOR_CPU 4
22#else
23#define FACTOR_CPU 1
24#endif
25#define LARGE_SET COIN_INT_MAX - 10
26#define LARGE_UNSET (LARGE_SET + 1)
27
29 friend void CoinAbcFactorizationUnitTest(const std::string &mpsDir);
30
31public:
39 CoinAbcTypeFactorization(const CoinFactorization &other);
40
48 void show_self() const;
50 void sort() const;
54
59
61
65 inline CoinSimplexInt *permute() const
66 {
67 return NULL; //permute_.array();
68 }
70 virtual inline CoinSimplexInt *indices() const
71 {
72 return indexRowU_.array();
73 }
75 virtual inline CoinSimplexInt *pivotColumn() const
76 {
77 return pivotColumn_.array();
78 }
80 virtual inline CoinFactorizationDouble *pivotRegion() const
81 {
83 }
84#if ABC_SMALL < 2
86 inline CoinBigIndex *startRowL() const
87 {
88 return startRowL_.array();
89 }
90#endif
91
93 inline CoinBigIndex *startColumnL() const
94 {
95 return startColumnL_.array();
96 }
97
98#if ABC_SMALL < 2
101 {
102 return indexColumnL_.array();
103 }
104#endif
105
107 inline CoinSimplexInt *indexRowL() const
108 {
109 return indexRowL_.array();
110 }
111
112#if ABC_SMALL < 2
114 inline CoinFactorizationDouble *elementByRowL() const
115 {
116 return elementByRowL_.array();
117 }
118#endif
123 {
124 return firstCount_.array() + numberRows_ + 1;
125 }
127 {
128 return firstCount_.array() + 2 * numberRows_ + 3;
129 }
131 {
132 return firstCount_.array();
133 }
134#if ABC_SMALL < 0
135#define ABC_USE_FUNCTION_POINTERS 0
136#define SMALL_PERMUTE
137#endif
138#ifdef ABC_USE_FUNCTION_POINTERS
139 typedef void (*scatterUpdate)(int, CoinFactorizationDouble, const CoinFactorizationDouble *, CoinFactorizationDouble *);
140#if ABC_USE_FUNCTION_POINTERS
141 typedef struct {
142 scatterUpdate functionPointer;
143 CoinBigIndex offset;
144 int number;
146#else
147 typedef struct {
148 CoinBigIndex offset;
149 int number;
151#endif
153 inline scatterStruct *scatterUColumn() const
154 {
155 return scatterPointersUColumnAddress_;
156 }
157#endif
158
160
164 {
165 return firstCount_.array();
166 }
167
169 inline CoinSimplexInt *nextCount() const
170 {
171 return firstCount_.array() + numberRows_ + 2;
172 }
173
175 inline CoinSimplexInt *lastCount() const
176 {
177 return firstCount_.array() + 3 * numberRows_ + 2;
178 }
179
182 {
183 return numberRowsExtra_;
184 }
186 inline CoinBigIndex numberL() const
187 {
188 return numberL_;
189 }
190
192 inline CoinBigIndex baseL() const
193 {
194 return baseL_;
195 }
198 {
199 return maximumRowsExtra_;
200 }
202 virtual inline CoinBigIndex numberElements() const
203 {
204 return totalElements_;
205 }
208 {
209 return numberInColumn_.array()[numberRowsExtra_];
210 }
215 {
216 return messageLevel_;
217 }
220 virtual void maximumPivots(CoinSimplexInt value);
221
222#if ABC_SMALL < 4
225 {
226 return denseThreshold_;
227 }
230 {
231 denseThreshold_ = value;
232 }
233#endif
236#if 0
238 inline bool forrestTomlin() const
239 { return doForrestTomlin_;}
240 inline void setForrestTomlin(bool value)
241 { doForrestTomlin_=value;}
242#endif
244 inline bool spaceForForrestTomlin() const
245 {
246 CoinBigIndex start = lastEntryByColumnU_;
247 CoinBigIndex space = lengthAreaU_ - (start + numberRowsExtra_);
248 return (space >= 0); //&&doForrestTomlin_;
249 }
251
254
256 inline CoinBigIndex numberElementsU() const
257 {
258 return lengthU_;
259 }
261 inline void setNumberElementsU(CoinBigIndex value)
262 {
263 lengthU_ = value;
264 }
266 inline CoinBigIndex lengthAreaU() const
267 {
268 return lengthAreaU_;
269 }
271 inline CoinBigIndex numberElementsL() const
272 {
273 return lengthL_;
274 }
276 inline CoinBigIndex lengthAreaL() const
277 {
278 return lengthAreaL_;
279 }
281 inline CoinBigIndex numberElementsR() const
282 {
283 return lengthR_;
284 }
286 inline CoinBigIndex numberCompressions() const
287 {
288 return numberCompressions_;
289 }
291 //virtual CoinSimplexInt * pivotRow() const;
293 //virtual CoinFactorizationDouble * workArea() const;
295 //virtual CoinSimplexInt * intWorkArea() const;
297 virtual inline CoinBigIndex *starts() const
298 {
299 return startColumnU_.array();
300 }
302 virtual inline CoinSimplexInt *numberInRow() const
303 {
304 return numberInRow_.array();
305 }
307 virtual inline CoinSimplexInt *numberInColumn() const
308 {
309 return numberInColumn_.array();
310 }
312 virtual inline CoinFactorizationDouble *elements() const
313 {
314 return elementU_.array();
315 }
317 inline CoinBigIndex *startColumnR() const
318 {
319 return reinterpret_cast< CoinBigIndex * >(firstCount_.array() + 3 * numberRows_ + 4);
320 }
322 inline CoinFactorizationDouble *elementU() const
323 {
324 return elementU_.array();
325 }
327 inline CoinSimplexInt *indexRowU() const
328 {
329 return indexRowU_.array();
330 }
332 inline CoinBigIndex *startColumnU() const
333 {
334 return startColumnU_.array();
335 }
336#if COIN_BIG_DOUBLE == 1
338 void toLongArray(CoinIndexedVector *vector, int which) const;
340 void fromLongArray(CoinIndexedVector *vector) const;
342 void fromLongArray(int which) const;
344 long double *denseVector(CoinIndexedVector *vector) const;
346 long double *denseVector(CoinIndexedVector &vector) const;
348 const long double *denseVector(const CoinIndexedVector *vector) const;
350 const long double *denseVector(const CoinIndexedVector &vector) const;
352 void scan(CoinIndexedVector *vector) const;
354 void clearHiddenArrays();
355#else
357 inline double *denseVector(CoinIndexedVector *vector) const
358 {
359 return vector->denseVector();
360 }
361 inline double *denseVector(CoinIndexedVector &vector) const
362 {
363 return vector.denseVector();
364 }
366 inline const double *denseVector(const CoinIndexedVector *vector) const
367 {
368 return vector->denseVector();
369 }
370 inline const double *denseVector(const CoinIndexedVector &vector) const
371 {
372 return vector.denseVector();
373 }
375 inline void toLongArray(CoinIndexedVector *vector, int which) const {}
377 inline void fromLongArray(CoinIndexedVector *vector) const {}
379 inline void fromLongArray(int which) const {}
381 inline void scan(CoinIndexedVector *vector) const
382 {
383 vector->scan(0, numberRows_, zeroTolerance_);
384 }
385#endif
386#ifdef ABC_ORDERED_FACTORIZATION
388 void permuteInForFtran(CoinIndexedVector &regionSparse, bool full = false) const;
390 void permuteInForBtranAndMultiply(CoinIndexedVector &regionSparse, bool full = false) const;
392 void permuteOutForBtran(CoinIndexedVector &regionSparse) const;
393#endif
399 //inline CoinSimplexInt persistenceFlag() const
400 //{ return persistenceFlag_;}
402
405#if 0
410 virtual int checkReplace ( const AbcSimplex * model,
411 CoinIndexedVector * regionSparse,
412 int pivotRow,
413 CoinSimplexDouble & pivotCheck,
414 double acceptablePivot = 1.0e-8);
419 virtual CoinSimplexInt replaceColumn ( CoinIndexedVector * regionSparse,
420 CoinSimplexInt pivotRow,
421 CoinSimplexDouble pivotCheck ,
422 bool skipBtranU=false,
423 CoinSimplexDouble acceptablePivot=1.0e-8);
424#endif
429 virtual
430#ifdef ABC_LONG_FACTORIZATION
431 long
432#endif
433 double
434 checkReplacePart1(CoinIndexedVector *regionSparse,
435 int pivotRow);
440 virtual
441#ifdef ABC_LONG_FACTORIZATION
442 long
443#endif
444 double
445 checkReplacePart1(CoinIndexedVector *regionSparse,
446 CoinIndexedVector *partialUpdate,
447 int pivotRow);
448#ifdef MOVE_REPLACE_PART1A
453 virtual void checkReplacePart1a(CoinIndexedVector *regionSparse,
454 int pivotRow);
455 virtual
456#ifdef ABC_LONG_FACTORIZATION
457 long
458#endif
459 double
460 checkReplacePart1b(CoinIndexedVector *regionSparse,
461 int pivotRow);
462#endif
465 virtual int checkReplacePart2(int pivotRow,
466 CoinSimplexDouble btranAlpha,
467 double ftranAlpha,
468#ifdef ABC_LONG_FACTORIZATION
469 long
470#endif
471 double ftAlpha,
472 double acceptablePivot = 1.0e-8);
475 virtual void replaceColumnPart3(const AbcSimplex *model,
476 CoinIndexedVector *regionSparse,
477 CoinIndexedVector *tableauColumn,
478 int pivotRow,
479#ifdef ABC_LONG_FACTORIZATION
480 long
481#endif
482 double alpha);
485 virtual void replaceColumnPart3(const AbcSimplex *model,
486 CoinIndexedVector *regionSparse,
487 CoinIndexedVector *tableauColumn,
488 CoinIndexedVector *partialUpdate,
489 int pivotRow,
490#ifdef ABC_LONG_FACTORIZATION
491 long
492#endif
493 double alpha);
494#ifdef EARLY_FACTORIZE
496 virtual int replaceColumns(const AbcSimplex *model,
497 CoinIndexedVector &stuff,
498 int firstPivot, int lastPivot, bool cleanUp);
499#endif
501 void updatePartialUpdate(CoinIndexedVector &partialUpdate);
503 inline virtual bool wantsTableauColumn() const
504 {
505 return false;
506 }
510 int replaceColumnU(CoinIndexedVector *regionSparse,
511 CoinBigIndex *deletedPosition,
512 CoinSimplexInt *deletedColumns,
513 CoinSimplexInt pivotRow);
515
519
520
526 virtual CoinSimplexInt updateColumnFT(CoinIndexedVector &regionSparse);
527 virtual int updateColumnFTPart1(CoinIndexedVector &regionSparse);
528 virtual void updateColumnFTPart2(CoinIndexedVector &regionSparse);
532 virtual void updateColumnFT(CoinIndexedVector &regionSparseFT,
533 CoinIndexedVector &partialUpdate,
534 int which);
537 virtual CoinSimplexInt updateColumn(CoinIndexedVector &regionSparse) const;
543 virtual CoinSimplexInt updateTwoColumnsFT(CoinIndexedVector &regionFT,
544 CoinIndexedVector &regionOther);
549 virtual CoinSimplexInt updateColumnTranspose(CoinIndexedVector &regionSparse) const;
551 virtual void updateFullColumn(CoinIndexedVector &regionSparse) const;
553 virtual void updateFullColumnTranspose(CoinIndexedVector &regionSparse) const;
555 virtual void updateWeights(CoinIndexedVector &regionSparse) const;
557 virtual void updateColumnCpu(CoinIndexedVector &regionSparse, int whichCpu) const;
559 virtual void updateColumnTransposeCpu(CoinIndexedVector &regionSparse, int whichCpu) const;
560 void unpack(CoinIndexedVector *regionFrom,
561 CoinIndexedVector *regionTo) const;
562 void pack(CoinIndexedVector *regionFrom,
563 CoinIndexedVector *regionTo) const;
565 inline void goSparse() {}
566 void goSparse2();
567#ifndef NDEBUG
568 virtual void checkMarkArrays() const;
569#endif
570#if ABC_SMALL < 2
573 {
574 return sparseThreshold_;
575 }
576#endif
580
581
586 inline void clearArrays()
587 {
589 }
591
599
602 void printRegion(const CoinIndexedVector &vector, const char *where) const;
603
605
608 virtual void getAreas(CoinSimplexInt numberRows,
609 CoinSimplexInt numberColumns,
610 CoinBigIndex maximumL,
611 CoinBigIndex maximumU);
612
614 virtual void preProcess();
617 double preProcess3();
621#ifdef EARLY_FACTORIZE
623 virtual int factorize(AbcSimplex *model, CoinIndexedVector &stuff);
624#endif
626 virtual void postProcess(const CoinSimplexInt *sequence, CoinSimplexInt *pivotVariable);
628 virtual void makeNonSingular(CoinSimplexInt *sequence);
629
630protected:
637
640 CoinSimplexInt pivotColumn);
643 CoinSimplexInt pivotColumn);
646 CoinSimplexInt pivotColumn);
649 CoinSimplexInt pivotColumn);
652
658 CoinSimplexInt extraNeeded);
659
662 bool reorderU();
666 bool getColumnSpaceIterateR(CoinSimplexInt iColumn, CoinFactorizationDouble value,
667 CoinSimplexInt iRow);
673 CoinBigIndex getColumnSpaceIterate(CoinSimplexInt iColumn, CoinFactorizationDouble value,
674 CoinSimplexInt iRow);
679
684 CoinSimplexInt extraNeeded);
687//#define CHECK_LINKS
688#ifdef CHECK_LINKS
689 void checkLinks(int x = 0);
690#else
691#define checkLinks(x)
692#endif
694 inline void addLink(CoinSimplexInt index, CoinSimplexInt count)
695 {
697 CoinSimplexInt *COIN_RESTRICT firstCount = this->firstCount();
699 CoinSimplexInt next = firstCount[count];
700 firstCount[count] = index;
701 nextCount[index] = next;
702 lastCount[index] = count - numberRows_ - 2; // points to firstCount[count]
703 if (next >= 0)
704 lastCount[next] = index;
705 }
707 inline void deleteLink(CoinSimplexInt index)
708 {
711 CoinSimplexInt next = nextCount[index];
712 CoinSimplexInt last = lastCount[index];
713 assert(next != index);
714 assert(last != index);
715 if (next >= 0)
716 lastCount[next] = last;
717 if (last >= 0) {
718 nextCount[last] = next;
719 } else {
720 int count = last + numberRows_ + 2;
721 CoinSimplexInt *COIN_RESTRICT firstCount = this->firstCount();
722 firstCount[count] = next;
723 }
724 }
726 inline void modifyLink(CoinSimplexInt index, CoinSimplexInt count)
727 {
730 CoinSimplexInt *COIN_RESTRICT firstCount = this->firstCount();
731 CoinSimplexInt next2 = firstCount[count];
732 if (next2 == index)
733 return;
734 firstCount[count] = index;
735 CoinSimplexInt next = nextCount[index];
736 CoinSimplexInt last = lastCount[index];
737 assert(next != index);
738 assert(last != index);
739 nextCount[index] = next2;
740 lastCount[index] = count - numberRows_ - 2; // points to firstCount[count]
741 if (next >= 0)
742 lastCount[next] = last;
743 if (next2 >= 0)
744 lastCount[next2] = index;
745 if (last >= 0) {
746 nextCount[last] = next;
747 } else {
748 int count = last + numberRows_ + 2;
749 firstCount[count] = next;
750 }
751 }
756 void cleanup();
759
761 void updateColumnL(CoinIndexedVector *region
762#if ABC_SMALL < 2
763 ,
764 CoinAbcStatistics &statistics
765#endif
766#if ABC_PARALLEL
767 ,
768 int whichSparse = 0
769#endif
770 ) const;
772 void updateColumnLDensish(CoinIndexedVector *region) const;
774 void updateColumnLDense(CoinIndexedVector *region) const;
776 void updateColumnLSparse(CoinIndexedVector *region
777#if ABC_PARALLEL
778 ,
779 int whichSparse
780#endif
781 ) const;
782
784 void updateColumnR(CoinIndexedVector *region
785#if ABC_SMALL < 2
786 ,
787 CoinAbcStatistics &statistics
788#endif
789#if ABC_PARALLEL
790 ,
791 int whichSparse = 0
792#endif
793 ) const;
796#if ABC_SMALL < 3
797 const
798#endif
799 CoinIndexedVector *regionFT);
801 void updateColumnU(CoinIndexedVector *region
802#if ABC_SMALL < 2
803 ,
804 CoinAbcStatistics &statistics
805#endif
806#if ABC_PARALLEL
807 ,
808 int whichSparse = 0
809#endif
810 ) const;
811
813 void updateColumnUSparse(CoinIndexedVector *regionSparse
814#if ABC_PARALLEL
815 ,
816 int whichSparse
817#endif
818 ) const;
820 void updateColumnUDensish(CoinIndexedVector *regionSparse) const;
822 void updateColumnUDense(CoinIndexedVector *regionSparse) const;
825 CoinSimplexInt &numberNonZero1,
826 CoinFactorizationDouble *COIN_RESTRICT region1,
828 CoinSimplexInt &numberNonZero2,
829 CoinFactorizationDouble *COIN_RESTRICT region2,
830 CoinSimplexInt *COIN_RESTRICT index2) const;
832 void updateColumnPFI(CoinIndexedVector *regionSparse) const;
834 void updateColumnTransposePFI(CoinIndexedVector *region) const;
837 void updateColumnTransposeU(CoinIndexedVector *region,
838 CoinSimplexInt smallestIndex
839#if ABC_SMALL < 2
840 ,
841 CoinAbcStatistics &statistics
842#endif
843#if ABC_PARALLEL
844 ,
845 int whichCpu
846#endif
847 ) const;
850 void updateColumnTransposeUDensish(CoinIndexedVector *region,
851 CoinSimplexInt smallestIndex) const;
854 void updateColumnTransposeUSparse(CoinIndexedVector *region
855#if ABC_PARALLEL
856 ,
857 int whichSparse
858#endif
859 ) const;
862 void updateColumnTransposeUByColumn(CoinIndexedVector *region,
863 CoinSimplexInt smallestIndex) const;
864
866 void updateColumnTransposeR(CoinIndexedVector *region
867#if ABC_SMALL < 2
868 ,
869 CoinAbcStatistics &statistics
870#endif
871 ) const;
873 void updateColumnTransposeRDensish(CoinIndexedVector *region) const;
875 void updateColumnTransposeRSparse(CoinIndexedVector *region) const;
876
878 void updateColumnTransposeL(CoinIndexedVector *region
879#if ABC_SMALL < 2
880 ,
881 CoinAbcStatistics &statistics
882#endif
883#if ABC_PARALLEL
884 ,
885 int whichSparse
886#endif
887 ) const;
889 void updateColumnTransposeLDensish(CoinIndexedVector *region) const;
891 void updateColumnTransposeLByRow(CoinIndexedVector *region) const;
893 void updateColumnTransposeLSparse(CoinIndexedVector *region
894#if ABC_PARALLEL
895 ,
896 int whichSparse
897#endif
898 ) const;
899public:
904 CoinSimplexInt replaceColumnPFI(CoinIndexedVector *regionSparse,
905 CoinSimplexInt pivotRow, CoinSimplexDouble alpha);
906
907protected:
912 int pivot(CoinSimplexInt pivotRow,
913 CoinSimplexInt pivotColumn,
914 CoinBigIndex pivotRowPosition,
915 CoinBigIndex pivotColumnPosition,
916 CoinFactorizationDouble *COIN_RESTRICT work,
918 CoinSimplexInt increment2,
919 int *COIN_RESTRICT markRow);
920 int pivot(CoinSimplexInt &pivotRow,
921 CoinSimplexInt &pivotColumn,
922 CoinBigIndex pivotRowPosition,
923 CoinBigIndex pivotColumnPosition,
924 int *COIN_RESTRICT markRow);
925#if ABC_SMALL < 2
926#define CONVERTROW 2
927#elif ABC_SMALL < 4
928#else
929#undef ABC_DENSE_CODE
930#define ABC_DENSE_CODE 0
931#endif
932
934
935protected:
940 CoinFactorizationDouble *pivotRegionAddress_;
941 CoinFactorizationDouble *elementUAddress_;
945#ifdef ABC_USE_FUNCTION_POINTERS
947 scatterStruct *scatterPointersUColumnAddress_;
948 CoinFactorizationDouble *elementUColumnPlusAddress_;
949#endif
950 CoinBigIndex *startColumnUAddress_;
951#if CONVERTROW
952 CoinBigIndex *convertRowToColumnUAddress_;
953#if CONVERTROW > 1
954 CoinBigIndex *convertColumnToRowUAddress_;
955#endif
956#endif
957#if ABC_SMALL < 2
958 CoinFactorizationDouble *elementRowUAddress_;
959#endif
960 CoinBigIndex *startRowUAddress_;
973 //CoinSimplexInt * saveColumnAddress2_;
976 CoinFactorizationDouble *elementLAddress_;
978 CoinBigIndex *startColumnLAddress_;
979#if ABC_SMALL < 2
980 CoinBigIndex *startRowLAddress_;
981#endif
985 CoinBigIndex *startColumnRAddress_;
987 CoinFactorizationDouble *elementRAddress_;
991 CoinFactorizationDouble *elementByRowLAddress_;
992#if ABC_SMALL < 4
993 CoinFactorizationDouble *denseAreaAddress_;
994#endif
995 CoinFactorizationDouble *workAreaAddress_;
998#ifdef SMALL_PERMUTE
999 CoinSimplexInt *fromSmallToBigRow_;
1000 CoinSimplexInt *fromSmallToBigColumn_;
1001#endif
1014 CoinBigIndex totalElements_;
1016 CoinBigIndex firstZeroed_;
1017#if ABC_SMALL < 2
1020#endif
1024 CoinBigIndex lengthR_;
1026 CoinBigIndex lengthAreaR_;
1028 CoinBigIndex numberL_;
1030 CoinBigIndex baseL_;
1032 CoinBigIndex lengthL_;
1034 CoinBigIndex lengthAreaL_;
1038 CoinBigIndex maximumU_;
1040 CoinBigIndex lengthU_;
1042 CoinBigIndex lengthAreaU_;
1045#ifdef ABC_USE_FUNCTION_POINTERS
1047 CoinBigIndex lastEntryByColumnUPlus_;
1049 CoinBigIndex lengthAreaUPlus_;
1050#endif
1052 CoinBigIndex lastEntryByRowU_;
1055#if ABC_SMALL < 4
1058#endif
1059#if COIN_BIG_DOUBLE == 1
1061 mutable CoinFactorizationLongDoubleArrayWithLength longArray_[FACTOR_CPU];
1063 mutable CoinIndexedVector *associatedVector_[FACTOR_CPU];
1064#endif
1066 CoinIntArrayWithLength pivotColumn_;
1068 CoinIntArrayWithLength permute_;
1070 CoinBigIndexArrayWithLength startRowU_;
1072 CoinIntArrayWithLength numberInRow_;
1074 CoinIntArrayWithLength numberInColumn_;
1076 CoinIntArrayWithLength numberInColumnPlus_;
1079 CoinIntArrayWithLength firstCount_;
1081 CoinIntArrayWithLength nextColumn_;
1083 CoinIntArrayWithLength lastColumn_;
1085 CoinIntArrayWithLength nextRow_;
1087 CoinIntArrayWithLength lastRow_;
1089 CoinIntArrayWithLength saveColumn_;
1091 CoinIntArrayWithLength markRow_;
1093 CoinIntArrayWithLength indexColumnU_;
1095 CoinFactorizationDoubleArrayWithLength pivotRegion_;
1097 CoinFactorizationDoubleArrayWithLength elementU_;
1099 CoinIntArrayWithLength indexRowU_;
1101 CoinBigIndexArrayWithLength startColumnU_;
1102#ifdef ABC_USE_FUNCTION_POINTERS
1104 CoinArbitraryArrayWithLength scatterUColumn_;
1105#endif
1106#if CONVERTROW
1108 CoinBigIndexArrayWithLength convertRowToColumnU_;
1109#if CONVERTROW > 1
1111 CoinBigIndexArrayWithLength convertColumnToRowU_;
1112#endif
1113#endif
1114#if ABC_SMALL < 2
1116 CoinFactorizationDoubleArrayWithLength elementRowU_;
1117#endif
1119 CoinFactorizationDoubleArrayWithLength elementL_;
1121 CoinIntArrayWithLength indexRowL_;
1123 CoinBigIndexArrayWithLength startColumnL_;
1124#if ABC_SMALL < 4
1126 CoinFactorizationDoubleArrayWithLength denseArea_;
1127#endif
1129 CoinFactorizationDoubleArrayWithLength workArea_;
1131 CoinUnsignedIntArrayWithLength workArea2_;
1132#if ABC_SMALL < 2
1134 CoinBigIndexArrayWithLength startRowL_;
1136 CoinIntArrayWithLength indexColumnL_;
1138 CoinFactorizationDoubleArrayWithLength elementByRowL_;
1140 mutable CoinIntArrayWithLength sparse_;
1141#endif
1146 // last slack pivot row
1148#if ABC_SMALL < 2
1150 mutable double ftranCountInput_;
1151 mutable double ftranCountAfterL_;
1152 mutable double ftranCountAfterR_;
1153 mutable double ftranCountAfterU_;
1157#if FACTORIZATION_STATISTICS
1158 double ftranTwiddleFactor1_;
1159 double ftranTwiddleFactor2_;
1160#endif
1162#endif
1165#if ABC_SMALL < 2
1166 mutable double ftranFTCountInput_;
1167 mutable double ftranFTCountAfterL_;
1168 mutable double ftranFTCountAfterR_;
1169 mutable double ftranFTCountAfterU_;
1173#if FACTORIZATION_STATISTICS
1174 double ftranFTTwiddleFactor1_;
1175 double ftranFTTwiddleFactor2_;
1176#endif
1178#endif
1179#if ABC_SMALL < 4
1182#endif
1183#if ABC_SMALL < 2
1184 mutable double btranCountInput_;
1185 mutable double btranCountAfterU_;
1186 mutable double btranCountAfterR_;
1187 mutable double btranCountAfterL_;
1191#if FACTORIZATION_STATISTICS
1192 double btranTwiddleFactor1_;
1193 double btranTwiddleFactor2_;
1194#endif
1196#endif
1199#if ABC_SMALL < 2
1201 mutable double ftranFullCountInput_;
1208#if FACTORIZATION_STATISTICS
1209 double ftranFullTwiddleFactor1_;
1210 double ftranFullTwiddleFactor2_;
1211#endif
1213#endif
1216#if ABC_SMALL < 2
1218 mutable double btranFullCountInput_;
1225#if FACTORIZATION_STATISTICS
1226 double btranFullTwiddleFactor1_;
1227 double btranFullTwiddleFactor2_;
1228#endif
1230#endif
1239 CoinBigIndex sizeSparseArray_;
1240
1241public:
1242#if ABC_SMALL < 2
1243#if ABC_SMALL >= 0
1244 inline bool gotLCopy() const
1245 {
1246 return ((state_ & ABC_FAC_GOT_LCOPY) != 0);
1247 }
1248 inline void setNoGotLCopy() { state_ &= ~ABC_FAC_GOT_LCOPY; }
1249 inline void setYesGotLCopy() { state_ |= ABC_FAC_GOT_LCOPY; }
1250 inline bool gotRCopy() const { return ((state_ & ABC_FAC_GOT_RCOPY) != 0); }
1251 inline void setNoGotRCopy() { state_ &= ~ABC_FAC_GOT_RCOPY; }
1252 inline void setYesGotRCopy() { state_ |= ABC_FAC_GOT_RCOPY; }
1253 inline bool gotUCopy() const { return ((state_ & ABC_FAC_GOT_UCOPY) != 0); }
1254 inline void setNoGotUCopy() { state_ &= ~ABC_FAC_GOT_UCOPY; }
1255 inline void setYesGotUCopy() { state_ |= ABC_FAC_GOT_UCOPY; }
1256 inline bool gotSparse() const { return ((state_ & ABC_FAC_GOT_SPARSE) != 0); }
1257 inline void setNoGotSparse() { state_ &= ~ABC_FAC_GOT_SPARSE; }
1258 inline void setYesGotSparse() { state_ |= ABC_FAC_GOT_SPARSE; }
1259#else
1260 // force use of copies
1261 inline bool gotLCopy() const { return true; }
1262 inline void setNoGotLCopy() {}
1263 inline void setYesGotLCopy() {}
1264 inline bool gotRCopy() const { return true; }
1265 inline void setNoGotRCopy() {}
1266 inline void setYesGotRCopy() {}
1267 inline bool gotUCopy() const { return true; }
1268 inline void setNoGotUCopy() {}
1269 inline void setYesGotUCopy() {}
1270 inline bool gotSparse() const { return true; }
1271 inline void setNoGotSparse() {}
1272 inline void setYesGotSparse() {}
1273#endif
1274#else
1275 // force no use of copies
1276 inline bool gotLCopy() const { return false; }
1277 inline void setNoGotLCopy() {}
1278 inline void setYesGotLCopy() {}
1279 inline bool gotRCopy() const { return false; }
1280 inline void setNoGotRCopy() {}
1281 inline void setYesGotRCopy() {}
1282 inline bool gotUCopy() const { return false; }
1283 inline void setNoGotUCopy() {}
1284 inline void setYesGotUCopy() {}
1285 inline bool gotSparse() const { return false; }
1286 inline void setNoGotSparse() {}
1287 inline void setYesGotSparse() {}
1288#endif
1294 //CoinSimplexInt persistenceFlag_;
1296};
1297
1298/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1299*/
#define COIN_RESTRICT
#define checkLinks(x)
#define FACTOR_CPU
This deals with Factorization and Updates.
#define ABC_FAC_GOT_UCOPY
#define ABC_FAC_GOT_RCOPY
#define ABC_FAC_GOT_SPARSE
#define ABC_FAC_GOT_LCOPY
double CoinSimplexDouble
unsigned int CoinSimplexUnsignedInt
#define ABC_PARALLEL
unsigned char CoinCheckZero
int CoinSimplexInt
#define ABC_SMALL
void(* scatterUpdate)(int, CoinFactorizationDouble, const CoinFactorizationDouble *, double *) SCATTER_ATTRIBUTE
Abstract base class which also has some scalars so can be used from Dense or Simp.
virtual double checkReplacePart1b(CoinIndexedVector *, int)
virtual void checkReplacePart1a(CoinIndexedVector *, int)
int numberRows_
Number of Rows in factorization.
CoinBigIndex * startRowL() const
Start of each row in L.
CoinBigIndex lengthAreaU_
Length of area reserved for U.
CoinIntArrayWithLength indexColumnU_
Base address for U (may change)
void updateColumnTransposeU(CoinIndexedVector *region, CoinSimplexInt smallestIndex, CoinAbcStatistics &statistics) const
Updates part of column transpose (BTRANU), assumes index is sorted i.e.
void deleteLink(CoinSimplexInt index)
Deletes a link in chain of equal counts.
void gutsOfDestructor(CoinSimplexInt type=1)
The real work of constructors etc 0 just scalars, 1 bit normal.
void gutsOfInitialize(CoinSimplexInt type)
1 bit - tolerances etc, 2 more, 4 dummy arrays
CoinSimplexInt maximumRowsExtra() const
Maximum of Rows after iterating.
CoinBigIndex maximumU_
Maximum space used in U.
CoinIntArrayWithLength numberInColumn_
Number in each Column.
CoinFactorizationDoubleArrayWithLength elementU_
Elements of U.
CoinSimplexInt * firstCount() const
For equal counts in factorization.
bool getColumnSpace(CoinSimplexInt iColumn, CoinSimplexInt extraNeeded)
Gets space for one Column with given length, may have to do compression (returns True if successful),...
CoinSimplexInt * pivotLinkedForwards() const
void updateColumnTransposeRDensish(CoinIndexedVector *region) const
Updates part of column transpose (BTRANR) when dense.
CoinFactorizationDouble * elementUAddress_
CoinFactorizationDouble * denseAreaAddress_
virtual double checkReplacePart1(CoinIndexedVector *regionSparse, int pivotRow)
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial...
CoinIntArrayWithLength saveColumn_
Columns left to do in a single pivot.
CoinSimplexInt * nextCount() const
Next Row/Column with count.
bool getRowSpace(CoinSimplexInt iRow, CoinSimplexInt extraNeeded)
Gets space for one Row with given length, may have to do compression (returns True if successful),...
CoinSimplexInt numberRowsSmall_
Size of small inverse.
CoinBigIndex lengthAreaR_
length of area reserved for R
CoinFactorizationDoubleArrayWithLength pivotRegion_
Inverses of pivot values.
CoinBigIndex numberElementsL() const
Returns number in L area.
CoinSimplexInt numberForrestTomlin() const
Length of FT vector.
CoinSimplexInt factorSparse()
Does sparse phase of factorization return code is <0 error, 0= finished.
CoinBigIndex numberL() const
Number in L.
virtual CoinSimplexInt updateColumnFT(CoinIndexedVector &regionSparse)
Later take out return codes (apart from +- 1 on FT)
virtual void makeNonSingular(CoinSimplexInt *sequence)
Makes a non-singular basis by replacing variables.
virtual CoinFactorizationDouble * pivotRegion() const
Returns address of pivot region.
CoinFactorizationDouble * elementU() const
Elements of U.
bool reorderU()
Reorders U so contiguous and in order (if there is space) Returns true if it could.
CoinSimplexInt * pivotLOrder() const
void updateColumnLDense(CoinIndexedVector *region) const
Updates part of column (FTRANL) when dense (i.e. do as inner products)
CoinSimplexDouble adjustedAreaFactor() const
Returns areaFactor but adjusted for dense.
CoinIntArrayWithLength nextRow_
Next Row in memory order.
virtual int checkReplacePart2(int pivotRow, CoinSimplexDouble btranAlpha, double ftranAlpha, double ftAlpha, double acceptablePivot=1.0e-8)
Checks if can replace one Column to basis, returns 0=OK, 1=Probably OK, 2=singular,...
CoinBigIndex baseL() const
Base of L.
virtual void checkMarkArrays() const
void updatePartialUpdate(CoinIndexedVector &partialUpdate)
Update partial Ftran by R update.
virtual void replaceColumnPart3(const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, CoinIndexedVector *partialUpdate, int pivotRow, double alpha)
Replaces one Column to basis, partial update in vector.
void updateColumnTransposeUDensish(CoinIndexedVector *region, CoinSimplexInt smallestIndex) const
Updates part of column transpose (BTRANU) when densish, assumes index is sorted i....
void updateColumnUSparse(CoinIndexedVector *regionSparse) const
Updates part of column (FTRANU) when sparse.
virtual CoinBigIndex numberElements() const
Total number of elements in factorization.
CoinSimplexInt numberRowsExtra_
Number of Rows after iterating.
void checkSparse()
See if worth going sparse.
bool storeFT(const CoinIndexedVector *regionFT)
Store update after doing L and R - retuns false if no room.
CoinBigIndex numberElementsR() const
Returns number in R area.
virtual void updateFullColumn(CoinIndexedVector &regionSparse) const
Updates one full column (FTRAN)
CoinSimplexInt numberR_
Number in R.
CoinBigIndex * startColumnL() const
Start of each column in L.
CoinAbcTypeFactorization & operator=(const CoinAbcTypeFactorization &other)
= copy
CoinFactorizationDoubleArrayWithLength elementByRowL_
Elements in L (row copy)
CoinUnsignedIntArrayWithLength workArea2_
Second work area.
virtual CoinSimplexInt * pivotColumn() const
Returns address of pivotColumn region (also used for permuting)
CoinBigIndex * startColumnR() const
Start of columns for R.
void updateColumnPFI(CoinIndexedVector *regionSparse) const
Updates part of column PFI (FTRAN) (after rest)
void updateColumnL(CoinIndexedVector *region, CoinAbcStatistics &statistics) const
Updates part of column (FTRANL)
CoinSimplexInt * lastCount() const
Previous Row/Column with count.
void doAddresses()
Set up addresses from arrays.
double ftranCountInput_
To decide how to solve.
void separateLinks(CoinSimplexInt, CoinSimplexInt)
CoinBigIndexArrayWithLength startRowL_
Start of each row in L.
friend void CoinAbcFactorizationUnitTest(const std::string &mpsDir)
CoinBigIndexArrayWithLength startColumnL_
Start of each column in L.
virtual CoinSimplexInt * numberInColumn() const
Number of entries in each column.
CoinBigIndex lastEntryByRowU_
Last entry by row for U.
const double * denseVector(const CoinIndexedVector &vector) const
void sort() const
Debug - sort so can compare.
virtual bool wantsTableauColumn() const
Returns true if wants tableauColumn in replaceColumn.
CoinFactorizationDouble * workAreaAddress_
CoinBigIndex lastEntryByColumnU_
Last entry by column for U.
CoinAbcTypeFactorization()
Default constructor.
CoinSimplexInt * pivotLinkedBackwards() const
Forward and backward linked lists (numberRows_+2)
CoinSimplexInt sparseThreshold() const
get sparse threshold
void scan(CoinIndexedVector *vector) const
Scans region to find nonzeros.
void updateColumnLDensish(CoinIndexedVector *region) const
Updates part of column (FTRANL) when densish.
CoinFactorizationDoubleArrayWithLength elementRowU_
Elements of U by row.
CoinSimplexInt state_
State of saved version and what can be done 0 - nothing saved 1 - saved and can go back to previous s...
CoinSimplexDouble maximumCoefficient() const
Returns maximum absolute value in factorization.
virtual void preProcess()
PreProcesses column ordered copy of basis.
CoinBigIndex sizeSparseArray_
Size in bytes of a sparseArray.
void pack(CoinIndexedVector *regionFrom, CoinIndexedVector *regionTo) const
CoinIntArrayWithLength numberInRow_
Number in each Row.
double * denseVector(CoinIndexedVector *vector) const
Returns double * associated with vector.
CoinIntArrayWithLength pivotColumn_
Pivot order for each Column.
CoinSimplexInt maximumRowsExtra_
Maximum number of Rows after iterating.
CoinBigIndex lengthAreaU() const
Returns length of U area.
CoinSimplexInt messageLevel_
Detail in messages.
CoinBigIndex getColumnSpaceIterate(CoinSimplexInt iColumn, CoinFactorizationDouble value, CoinSimplexInt iRow)
getColumnSpaceIterate.
bool pivotRowSingleton(CoinSimplexInt pivotRow, CoinSimplexInt pivotColumn)
Does one pivot on Row Singleton in factorization.
CoinBigIndex lengthAreaL_
Length of area reserved for L.
virtual CoinSimplexInt * indices() const
Returns array to put basis indices in.
void cleanup()
Cleans up at end of factorization.
CoinSimplexInt numberU_
Number in U.
virtual int updateColumnFTPart1(CoinIndexedVector &regionSparse)
void updateTwoColumnsUDensish(CoinSimplexInt &numberNonZero1, CoinFactorizationDouble *COIN_RESTRICT region1, CoinSimplexInt *COIN_RESTRICT index1, CoinSimplexInt &numberNonZero2, CoinFactorizationDouble *COIN_RESTRICT region2, CoinSimplexInt *COIN_RESTRICT index2) const
Updates part of 2 columns (FTRANU) real work.
CoinSimplexInt sparseThreshold_
Below this use sparse technology - if 0 then no L row copy.
CoinBigIndex * startColumnU() const
Start of each column in U.
CoinSimplexInt * indexRowU() const
Row indices of U.
CoinBigIndex lengthAreaL() const
Returns length of L area.
void separateLinks()
Separate out links with same row/column count.
CoinBigIndex firstZeroed_
First place in funny copy zeroed out.
virtual CoinSimplexInt updateTwoColumnsFT(CoinIndexedVector &regionFT, CoinIndexedVector &regionOther)
Updates one column (FTRAN) from region2 Tries to do FT update number returned is negative if no room.
CoinSimplexInt * lastCountAddress_
Previous Row/Column with count.
CoinIntArrayWithLength lastRow_
Previous Row in memory order.
CoinSimplexInt numberRowsExtra() const
Number of Rows after iterating.
int replaceColumnU(CoinIndexedVector *regionSparse, CoinBigIndex *deletedPosition, CoinSimplexInt *deletedColumns, CoinSimplexInt pivotRow)
Combines BtranU and store which elements are to be deleted returns number to be deleted.
void updateColumnR(CoinIndexedVector *region, CoinAbcStatistics &statistics) const
Updates part of column (FTRANR) without FT update.
CoinSimplexInt factorDense()
Does dense phase of factorization return code is <0 error, 0= finished.
CoinSimplexInt * indexRowL() const
Row indices of L.
virtual void updateColumnFT(CoinIndexedVector &regionSparseFT, CoinIndexedVector &partialUpdate, int which)
Updates one column (FTRAN) Tries to do FT update puts partial update in vector.
virtual void maximumPivots(CoinSimplexInt value)
Set maximum pivots.
CoinSimplexInt * nextCountAddress_
Next Row/Column with count.
CoinSimplexInt numberTrials_
Number of trials before rejection.
CoinSimplexInt numberRowsLeft_
Number Rows left (numberRows-numberGood)
const double * denseVector(const CoinIndexedVector *vector) const
Returns double * associated with vector.
void updateColumnLSparse(CoinIndexedVector *region) const
Updates part of column (FTRANL) when sparse.
virtual void getAreas(CoinSimplexInt numberRows, CoinSimplexInt numberColumns, CoinBigIndex maximumL, CoinBigIndex maximumU)
Gets space for a factorization, called by constructors.
virtual void updateColumnFTPart2(CoinIndexedVector &regionSparse)
int wantToGoDense()
After pivoting - returns true if need to go dense.
CoinSimplexInt checkPivot(CoinSimplexDouble saveFromU, CoinSimplexDouble oldPivot) const
Returns accuracy status of replaceColumn returns 0=OK, 1=Probably OK, 2=singular.
CoinBigIndex totalElements_
Number of elements in U (to go) or while iterating total overall.
CoinFactorizationDouble * elementByRowLAddress_
CoinFactorizationDouble * elementByRowL() const
Elements in L (row copy)
virtual void updateWeights(CoinIndexedVector &regionSparse) const
Updates one column for dual steepest edge weights (FTRAN)
CoinBigIndexArrayWithLength startColumnU_
Start of each column in U.
void almostDestructor()
Delete all stuff (leaves as after CoinAbcFactorization())
CoinIntArrayWithLength lastColumn_
Previous Column in memory order.
void updateColumnTransposeRSparse(CoinIndexedVector *region) const
Updates part of column transpose (BTRANR) when sparse.
void modifyLink(CoinSimplexInt index, CoinSimplexInt count)
Modifies links in chain of equal counts.
virtual void updateColumnCpu(CoinIndexedVector &regionSparse, int whichCpu) const
Updates one column (FTRAN)
virtual ~CoinAbcTypeFactorization()
Destructor.
void updateColumnTransposeLByRow(CoinIndexedVector *region) const
Updates part of column transpose (BTRANL) when densish by row.
void afterPivot(CoinSimplexInt pivotRow, CoinSimplexInt pivotColumn)
After pivoting.
CoinSimplexInt leadingDimension_
Leading dimension for dense.
CoinIntArrayWithLength indexRowL_
Row indices of L.
CoinBigIndexArrayWithLength startRowU_
Start of each Row as pointer.
CoinIntArrayWithLength numberInColumnPlus_
Number in each Column including pivoted.
virtual CoinSimplexInt updateColumnTranspose(CoinIndexedVector &regionSparse) const
Updates one column (BTRAN) from regionSparse2 regionSparse starts as zero and is zero at end Note - i...
void setNumberElementsU(CoinBigIndex value)
Setss number in U area.
void messageLevel(CoinSimplexInt value)
void preProcess(CoinSimplexInt)
bool spaceForForrestTomlin() const
True if FT update and space.
void sparseThreshold(CoinSimplexInt value)
set sparse threshold
void fromLongArray(int which) const
From a work array and dis-associate vector.
void updateColumnTransposeUSparse(CoinIndexedVector *region) const
Updates part of column transpose (BTRANU) when sparse, assumes index is sorted i.e.
int pivot(CoinSimplexInt pivotRow, CoinSimplexInt pivotColumn, CoinBigIndex pivotRowPosition, CoinBigIndex pivotColumnPosition, CoinFactorizationDouble *COIN_RESTRICT work, CoinSimplexUnsignedInt *COIN_RESTRICT workArea2, CoinSimplexInt increment2, int *COIN_RESTRICT markRow)
0 fine, -99 singular, 2 dense
void updateColumnTransposeL(CoinIndexedVector *region, CoinAbcStatistics &statistics) const
Updates part of column transpose (BTRANL)
bool pivotOneOtherRow(CoinSimplexInt pivotRow, CoinSimplexInt pivotColumn)
Pivots when just one other row so faster?
void updateColumnTransposeLSparse(CoinIndexedVector *region) const
Updates part of column transpose (BTRANL) when sparse (by Row)
CoinSimplexInt maximumRows_
Maximum rows (ever) (here to use double alignment)
virtual void postProcess(const CoinSimplexInt *sequence, CoinSimplexInt *pivotVariable)
Does post processing on valid factorization - putting variables on correct rows.
void updateColumnU(CoinIndexedVector *region, CoinAbcStatistics &statistics) const
Updates part of column (FTRANU)
CoinSimplexInt * indexColumnL() const
Index of column in row for L.
int pivot(CoinSimplexInt &pivotRow, CoinSimplexInt &pivotColumn, CoinBigIndex pivotRowPosition, CoinBigIndex pivotColumnPosition, int *COIN_RESTRICT markRow)
CoinFactorizationDoubleArrayWithLength denseArea_
Dense area.
CoinSimplexInt * permute() const
Returns address of permute region.
CoinBigIndex lengthR_
Length of R stuff.
CoinAbcTypeFactorization(const CoinAbcTypeFactorization &other)
Copy constructor.
CoinBigIndex numberCompressions_
Number of compressions done.
void unpack(CoinIndexedVector *regionFrom, CoinIndexedVector *regionTo) const
CoinIntArrayWithLength permute_
Permutation vector for pivot row order.
double * denseVector(CoinIndexedVector &vector) const
CoinSimplexInt initialNumberRows_
Rows first time nonzero.
CoinSimplexDouble conditionNumber() const
Condition number - product of pivots after factorization.
void updateColumnUDensish(CoinIndexedVector *regionSparse) const
Updates part of column (FTRANU)
void fromLongArray(CoinIndexedVector *vector) const
From a work array and dis-associate vector.
CoinFactorizationDouble * elementRowUAddress_
CoinSimplexInt replaceColumnPFI(CoinIndexedVector *regionSparse, CoinSimplexInt pivotRow, CoinSimplexDouble alpha)
Replaces one Column to basis for PFI returns 0=OK, 1=Probably OK, 2=singular, 3=no room.
CoinIntArrayWithLength indexColumnL_
Index of column in row for L.
bool getRowSpaceIterate(CoinSimplexInt iRow, CoinSimplexInt extraNeeded)
Gets space for one Row with given length while iterating, may have to do compression (returns True if...
void resetStatistics()
Reset all sparsity etc statistics.
virtual double checkReplacePart1(CoinIndexedVector *regionSparse, CoinIndexedVector *partialUpdate, int pivotRow)
Checks if can replace one Column to basis, returns update alpha Fills in region for use later partial...
double preProcess3()
Return largest element.
void updateColumnTransposePFI(CoinIndexedVector *region) const
Updates part of column transpose PFI (BTRAN) (before rest)
void updateColumnTransposeR(CoinIndexedVector *region, CoinAbcStatistics &statistics) const
Updates part of column transpose (BTRANR)
void goSparse()
makes a row copy of L for speed and to allow very sparse problems
CoinIntArrayWithLength nextColumn_
Next Column in memory order.
virtual CoinSimplexInt factor(AbcSimplex *model)
Does most of factorization.
CoinIntArrayWithLength firstCount_
First Row/Column with count of k, can tell which by offset - Rows then Columns.
virtual CoinFactorizationDouble * elements() const
Returns array to put basis elements in.
CoinSimplexUnsignedInt * workArea2Address_
CoinFactorizationDoubleArrayWithLength workArea_
First work area.
CoinSimplexInt maximumMaximumPivots_
Maximum maximum pivots.
virtual void updateFullColumnTranspose(CoinIndexedVector &regionSparse) const
Updates one full column (BTRAN)
CoinBigIndex numberCompressions() const
Number of compressions done.
void printRegion(const CoinIndexedVector &vector, const char *where) const
void toLongArray(CoinIndexedVector *vector, int which) const
To a work array and associate vector.
CoinIntArrayWithLength markRow_
Marks rows to be updated.
virtual CoinAbcAnyFactorization * clone() const
Clone.
void clearArrays()
Get rid of all memory.
CoinSimplexInt * indexRowRAddress_
Row indices for R.
void updateColumnUDense(CoinIndexedVector *regionSparse) const
Updates part of column (FTRANU) when dense (i.e. do as inner products)
double btranFullCountInput_
To decide how to solve.
double ftranFullCountInput_
To decide how to solve.
void addLink(CoinSimplexInt index, CoinSimplexInt count)
Adds a link in chain of equal counts.
CoinSimplexInt messageLevel() const
Level of detail of messages.
void updateColumnTransposeLDensish(CoinIndexedVector *region) const
Updates part of column transpose (BTRANL) when densish by column.
void setDenseThreshold(CoinSimplexInt value)
Sets dense threshold.
CoinSimplexInt numberGoodL_
Number factorized in L.
CoinSimplexInt denseThreshold() const
Gets dense threshold.
CoinSimplexInt denseThreshold_
Dense threshold (here to use double alignment)
void checkConsistency()
Checks that row and column copies look OK.
CoinFactorizationDouble * pivotRegionAddress_
CoinIntArrayWithLength sparse_
Sparse regions.
CoinIntArrayWithLength indexRowU_
Row indices of U.
virtual void updateColumnTransposeCpu(CoinIndexedVector &regionSparse, int whichCpu) const
Updates one column (BTRAN)
virtual CoinSimplexInt * numberInRow() const
Number of entries in each row.
CoinFactorizationDouble * elementRAddress_
Elements of R.
virtual void replaceColumnPart3(const AbcSimplex *model, CoinIndexedVector *regionSparse, CoinIndexedVector *tableauColumn, int pivotRow, double alpha)
Replaces one Column to basis, partial update already in U.
CoinBigIndex numberElementsU() const
Returns number in U area.
void updateColumnTransposeUByColumn(CoinIndexedVector *region, CoinSimplexInt smallestIndex) const
Updates part of column transpose (BTRANU) by column assumes index is sorted i.e.
bool getColumnSpaceIterateR(CoinSimplexInt iColumn, CoinFactorizationDouble value, CoinSimplexInt iRow)
getColumnSpaceIterateR.
CoinAbcTypeFactorization(const CoinFactorization &other)
Copy constructor.
CoinFactorizationDoubleArrayWithLength elementL_
Elements of L.
CoinFactorizationDouble * elementLAddress_
virtual CoinSimplexInt updateColumn(CoinIndexedVector &regionSparse) const
This version has same effect as above with FTUpdate==false so number returned is always >=0.
void gutsOfCopy(const CoinAbcTypeFactorization &other)
void show_self() const
Debug show object (shows one representation)
void pivotColumnSingleton(CoinSimplexInt pivotRow, CoinSimplexInt pivotColumn)
Does one pivot on Column Singleton in factorization (can't return false)
virtual CoinBigIndex * starts() const
Returns pivot row.