1 | /* $Id: ClpCholeskyUfl.hpp 1525 2010-02-26 17:27:59Z mjs $ */ |
---|
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 |
---|
8 | extern "C" { |
---|
9 | #endif |
---|
10 | #ifndef CLP_USE_CHOLMOD |
---|
11 | #include "amd.h" |
---|
12 | #else |
---|
13 | #include "cholmod.h" |
---|
14 | #endif |
---|
15 | #ifdef __cplusplus |
---|
16 | } |
---|
17 | #endif |
---|
18 | class ClpMatrixBase; |
---|
19 | class ClpCholeskyDense; |
---|
20 | |
---|
21 | /** Ufl class for Clp Cholesky factorization |
---|
22 | |
---|
23 | If you wish to use AMD code from University of Florida see |
---|
24 | |
---|
25 | http://www.cise.ufl.edu/research/sparse/amd |
---|
26 | |
---|
27 | for terms of use |
---|
28 | |
---|
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 | |
---|
35 | */ |
---|
36 | class ClpCholeskyUfl : public ClpCholeskyBase { |
---|
37 | |
---|
38 | public: |
---|
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) ; |
---|
44 | #ifdef CLP_USE_CHOLMOD |
---|
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) ; |
---|
55 | #endif |
---|
56 | //@} |
---|
57 | |
---|
58 | |
---|
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 | |
---|
75 | private: |
---|
76 | #ifdef CLP_USE_CHOLMOD |
---|
77 | cholmod_factor * L_ ; |
---|
78 | cholmod_common c_ ; |
---|
79 | #endif |
---|
80 | }; |
---|
81 | |
---|
82 | #endif |
---|