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