| 1 | /* $Id: ClpCholeskyUfl.hpp 1753 2011-06-19 16:27:26Z stefan $ */ |
| 2 | // Copyright (C) 2004, 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 ClpCholeskyUfl_H |
| 7 | #define ClpCholeskyUfl_H |
| 8 | |
| 9 | #include "ClpCholeskyBase.hpp" |
| 10 | |
| 11 | class ClpMatrixBase; |
| 12 | class ClpCholeskyDense; |
| 13 | |
| 14 | typedef struct cholmod_factor_struct cholmod_factor; |
| 15 | typedef struct cholmod_common_struct cholmod_common; |
| 16 | |
| 17 | /** Ufl class for Clp Cholesky factorization |
| 18 | |
| 19 | If you wish to use AMD code from University of Florida see |
| 20 | |
| 21 | http://www.cise.ufl.edu/research/sparse/amd |
| 22 | |
| 23 | for terms of use |
| 24 | |
| 25 | If you wish to use CHOLMOD code from University of Florida see |
| 26 | |
| 27 | http://www.cise.ufl.edu/research/sparse/cholmod |
| 28 | |
| 29 | for terms of use |
| 30 | |
| 31 | */ |
| 32 | class ClpCholeskyUfl : public ClpCholeskyBase { |
| 33 | |
| 34 | public: |
| 35 | /**@name Virtual methods that the derived classes provides */ |
| 36 | //@{ |
| 37 | /** Orders rows and saves pointer to matrix.and model. |
| 38 | Returns non-zero if not enough memory */ |
| 39 | virtual int order(ClpInterior * model) override ; |
| 40 | /** Does Symbolic factorization given permutation using CHOLMOD (if available). |
| 41 | This is called immediately after order. If user provides this then |
| 42 | user must provide factorize and solve. Otherwise the default factorization is used |
| 43 | returns non-zero if not enough memory. */ |
| 44 | virtual int symbolic() override; |
| 45 | /** Factorize - filling in rowsDropped and returning number dropped using CHOLMOD (if available). |
| 46 | If return code negative then out of memory */ |
| 47 | virtual int factorize(const double * diagonal, int * rowsDropped) override ; |
| 48 | /** Uses factorization to solve. Uses CHOLMOD (if available). */ |
| 49 | virtual void solve (double * region) override ; |
| 50 | //@} |
| 51 | |
| 52 | |
| 53 | /**@name Constructors, destructor */ |
| 54 | //@{ |
| 55 | /** Constructor which has dense columns activated. |
| 56 | Default is off. */ |
| 57 | ClpCholeskyUfl(int denseThreshold = -1); |
| 58 | /** Destructor */ |
| 59 | virtual ~ClpCholeskyUfl(); |
| 60 | /// Clone |
| 61 | virtual ClpCholeskyBase * clone() const override ; |
| 62 | //@} |
| 63 | |
| 64 | |
| 65 | private: |
| 66 | cholmod_factor * L_ ; |
| 67 | cholmod_common * c_ ; |
| 68 | |
| 69 | // Copy |
| 70 | ClpCholeskyUfl(const ClpCholeskyUfl&); |
| 71 | // Assignment |
| 72 | ClpCholeskyUfl& operator=(const ClpCholeskyUfl&); |
| 73 | }; |
| 74 | |
| 75 | #endif |
| 76 | |