Changeset 2385 for trunk/Clp/src/ClpCholeskyDense.hpp
 Timestamp:
 Jan 6, 2019 2:43:06 PM (18 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Clp/src/ClpCholeskyDense.hpp
r2271 r2385 15 15 16 16 public: 17 18 19 17 /**@name Virtual methods that the derived classes provides */ 18 /**@{*/ 19 /** Orders rows and saves pointer to matrix.and model. 20 20 Returns nonzero if not enough memory */ 21 virtual int order(ClpInterior * model);22 21 virtual int order(ClpInterior *model); 22 /** Does Symbolic factorization given permutation. 23 23 This is called immediately after order. If user provides this then 24 24 user must provide factorize and solve. Otherwise the default factorization is used 25 25 returns nonzero if not enough memory */ 26 27 26 virtual int symbolic(); 27 /** Factorize  filling in rowsDropped and returning number dropped. 28 28 If return code negative then out of memory */ 29 virtual int factorize(const CoinWorkDouble * diagonal, int * rowsDropped);30 31 virtual void solve (CoinWorkDouble * region);32 29 virtual int factorize(const CoinWorkDouble *diagonal, int *rowsDropped); 30 /** Uses factorization to solve. */ 31 virtual void solve(CoinWorkDouble *region); 32 /**@}*/ 33 33 34 35 36 34 /**@name Non virtual methods for ClpCholeskyDense */ 35 /**@{*/ 36 /** Reserves space. 37 37 If factor not NULL then just uses passed space 38 38 Returns nonzero if not enough memory */ 39 int reserveSpace(const ClpCholeskyBase * factor, int numberRows) ; 40 /** Returns space needed */ 41 int space( int numberRows) const; 42 /** part 2 of Factorize  filling in rowsDropped */ 43 void factorizePart2(int * rowsDropped) ; 44 /** part 2 of Factorize  filling in rowsDropped  blocked */ 45 void factorizePart3(int * rowsDropped) ; 46 /** Forward part of solve */ 47 void solveF1(longDouble * a, int n, CoinWorkDouble * region); 48 void solveF2(longDouble * a, int n, CoinWorkDouble * region, CoinWorkDouble * region2); 49 /** Backward part of solve */ 50 void solveB1(longDouble * a, int n, CoinWorkDouble * region); 51 void solveB2(longDouble * a, int n, CoinWorkDouble * region, CoinWorkDouble * region2); 52 int bNumber(const longDouble * array, int &, int&); 53 /** A */ 54 inline longDouble * aMatrix() const { 55 return sparseFactor_; 56 } 57 /** Diagonal */ 58 inline longDouble * diagonal() const { 59 return diagonal_; 60 } 61 /**@}*/ 39 int reserveSpace(const ClpCholeskyBase *factor, int numberRows); 40 /** Returns space needed */ 41 int space(int numberRows) const; 42 /** part 2 of Factorize  filling in rowsDropped */ 43 void factorizePart2(int *rowsDropped); 44 /** part 2 of Factorize  filling in rowsDropped  blocked */ 45 void factorizePart3(int *rowsDropped); 46 /** Forward part of solve */ 47 void solveF1(longDouble *a, int n, CoinWorkDouble *region); 48 void solveF2(longDouble *a, int n, CoinWorkDouble *region, CoinWorkDouble *region2); 49 /** Backward part of solve */ 50 void solveB1(longDouble *a, int n, CoinWorkDouble *region); 51 void solveB2(longDouble *a, int n, CoinWorkDouble *region, CoinWorkDouble *region2); 52 int bNumber(const longDouble *array, int &, int &); 53 /** A */ 54 inline longDouble *aMatrix() const 55 { 56 return sparseFactor_; 57 } 58 /** Diagonal */ 59 inline longDouble *diagonal() const 60 { 61 return diagonal_; 62 } 63 /**@}*/ 62 64 63 64 /**@name Constructors, destructor */ 65 /**@{*/ 66 /** Default constructor. */ 67 ClpCholeskyDense(); 68 /** Destructor */ 69 virtual ~ClpCholeskyDense(); 70 /** Copy */ 71 ClpCholeskyDense(const ClpCholeskyDense&); 72 /** Assignment */ 73 ClpCholeskyDense& operator=(const ClpCholeskyDense&); 74 /** Clone */ 75 virtual ClpCholeskyBase * clone() const ; 76 /**@}*/ 77 65 /**@name Constructors, destructor */ 66 /**@{*/ 67 /** Default constructor. */ 68 ClpCholeskyDense(); 69 /** Destructor */ 70 virtual ~ClpCholeskyDense(); 71 /** Copy */ 72 ClpCholeskyDense(const ClpCholeskyDense &); 73 /** Assignment */ 74 ClpCholeskyDense &operator=(const ClpCholeskyDense &); 75 /** Clone */ 76 virtual ClpCholeskyBase *clone() const; 77 /**@}*/ 78 78 79 79 private: 80 81 82 83 84 80 /**@name Data members */ 81 /**@{*/ 82 /** Just borrowing space */ 83 bool borrowSpace_; 84 /**@}*/ 85 85 }; 86 86 87 87 /* structure for C */ 88 88 typedef struct { 89 longDouble *diagonal_;90 longDouble *a;91 longDouble *work;92 int *rowsDropped;93 94 95 96 89 longDouble *diagonal_; 90 longDouble *a; 91 longDouble *work; 92 int *rowsDropped; 93 double doubleParameters_[1]; /* corresponds to 10 */ 94 int integerParameters_[2]; /* corresponds to 34, nThreads */ 95 int n; 96 int numberBlocks; 97 97 } ClpCholeskyDenseC; 98 98 99 99 extern "C" { 100 100 void ClpCholeskySpawn(void *); 101 101 } 102 102 /**Non leaf recursive factor */ 103 void 104 ClpCholeskyCfactor(ClpCholeskyDenseC * thisStruct, 105 longDouble * a, int n, int numberBlocks, 106 longDouble * diagonal, longDouble * work, int * rowsDropped); 103 void ClpCholeskyCfactor(ClpCholeskyDenseC *thisStruct, 104 longDouble *a, int n, int numberBlocks, 105 longDouble *diagonal, longDouble *work, int *rowsDropped); 107 106 108 107 /**Non leaf recursive triangle rectangle update */ 109 void 110 ClpCholeskyCtriRec(ClpCholeskyDenseC * thisStruct, 111 longDouble * aTri, int nThis, 112 longDouble * aUnder, longDouble * diagonal, 113 longDouble * work, 114 int nLeft, int iBlock, int jBlock, 115 int numberBlocks); 108 void ClpCholeskyCtriRec(ClpCholeskyDenseC *thisStruct, 109 longDouble *aTri, int nThis, 110 longDouble *aUnder, longDouble *diagonal, 111 longDouble *work, 112 int nLeft, int iBlock, int jBlock, 113 int numberBlocks); 116 114 /**Non leaf recursive rectangle triangle update */ 117 void 118 ClpCholeskyCrecTri(ClpCholeskyDenseC * thisStruct, 119 longDouble * aUnder, int nTri, int nDo, 120 int iBlock, int jBlock, longDouble * aTri, 121 longDouble * diagonal, longDouble * work, 122 int numberBlocks); 115 void ClpCholeskyCrecTri(ClpCholeskyDenseC *thisStruct, 116 longDouble *aUnder, int nTri, int nDo, 117 int iBlock, int jBlock, longDouble *aTri, 118 longDouble *diagonal, longDouble *work, 119 int numberBlocks); 123 120 /** Non leaf recursive rectangle rectangle update, 124 121 nUnder is number of rows in iBlock, 125 122 nUnderK is number of rows in kBlock 126 123 */ 127 void 128 ClpCholeskyCrecRec(ClpCholeskyDenseC * thisStruct, 129 longDouble * above, int nUnder, int nUnderK, 130 int nDo, longDouble * aUnder, longDouble *aOther, 131 longDouble * work, 132 int iBlock, int jBlock, 133 int numberBlocks); 124 void ClpCholeskyCrecRec(ClpCholeskyDenseC *thisStruct, 125 longDouble *above, int nUnder, int nUnderK, 126 int nDo, longDouble *aUnder, longDouble *aOther, 127 longDouble *work, 128 int iBlock, int jBlock, 129 int numberBlocks); 134 130 /**Leaf recursive factor */ 135 void 136 ClpCholeskyCfactorLeaf(ClpCholeskyDenseC * thisStruct, 137 longDouble * a, int n, 138 longDouble * diagonal, longDouble * work, 139 int * rowsDropped); 131 void ClpCholeskyCfactorLeaf(ClpCholeskyDenseC *thisStruct, 132 longDouble *a, int n, 133 longDouble *diagonal, longDouble *work, 134 int *rowsDropped); 140 135 /**Leaf recursive triangle rectangle update */ 141 void 142 ClpCholeskyCtriRecLeaf(/*ClpCholeskyDenseC * thisStruct,*/ 143 longDouble * aTri, longDouble * aUnder, 144 longDouble * diagonal, longDouble * work, 145 int nUnder); 136 void ClpCholeskyCtriRecLeaf(/*ClpCholeskyDenseC * thisStruct,*/ 137 longDouble *aTri, longDouble *aUnder, 138 longDouble *diagonal, longDouble *work, 139 int nUnder); 146 140 /**Leaf recursive rectangle triangle update */ 147 void 148 ClpCholeskyCrecTriLeaf(/*ClpCholeskyDenseC * thisStruct, */ 149 longDouble * aUnder, longDouble * aTri, 150 /*longDouble * diagonal,*/ longDouble * work, int nUnder); 141 void ClpCholeskyCrecTriLeaf(/*ClpCholeskyDenseC * thisStruct, */ 142 longDouble *aUnder, longDouble *aTri, 143 /*longDouble * diagonal,*/ longDouble *work, int nUnder); 151 144 /** Leaf recursive rectangle rectangle update, 152 145 nUnder is number of rows in iBlock, 153 146 nUnderK is number of rows in kBlock 154 147 */ 155 void 156 ClpCholeskyCrecRecLeaf(/*ClpCholeskyDenseC * thisStruct, */ 157 const longDouble * COIN_RESTRICT above, 158 const longDouble * COIN_RESTRICT aUnder, 159 longDouble * COIN_RESTRICT aOther, 160 const longDouble * COIN_RESTRICT work, 161 int nUnder); 148 void ClpCholeskyCrecRecLeaf(/*ClpCholeskyDenseC * thisStruct, */ 149 const longDouble *COIN_RESTRICT above, 150 const longDouble *COIN_RESTRICT aUnder, 151 longDouble *COIN_RESTRICT aOther, 152 const longDouble *COIN_RESTRICT work, 153 int nUnder); 162 154 #endif 155 156 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2 157 */
Note: See TracChangeset
for help on using the changeset viewer.