source: trunk/Clp/src/ClpCholeskyDense.hpp @ 754

Last change on this file since 754 was 754, checked in by andreasw, 13 years ago

first version

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
Line 
1// Copyright (C) 2003, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#ifndef ClpCholeskyDense_H
4#define ClpCholeskyDense_H
5
6#include "ClpCholeskyBase.hpp"
7class ClpMatrixBase;
8
9/** Dense class for Clp Cholesky factorization
10
11*/
12class ClpCholeskyDense : public ClpCholeskyBase {
13 
14public:
15   /**@name Virtual methods that the derived classes provides  */
16   //@{
17  /** Orders rows and saves pointer to matrix.and model.
18   Returns non-zero if not enough memory */
19  virtual int order(ClpInterior * model) ;
20  /** Does Symbolic factorization given permutation.
21      This is called immediately after order.  If user provides this then
22      user must provide factorize and solve.  Otherwise the default factorization is used
23      returns non-zero if not enough memory */
24  virtual int symbolic();
25  /** Factorize - filling in rowsDropped and returning number dropped.
26      If return code negative then out of memory */
27  virtual int factorize(const double * diagonal, int * rowsDropped) ;
28  /** Uses factorization to solve. */
29  virtual void solve (double * region) ;
30  //@}
31
32   /**@name Non virtual methods for ClpCholeskyDense  */
33   //@{
34  /** Reserves space.
35      If factor not NULL then just uses passed space
36   Returns non-zero if not enough memory */
37   int reserveSpace(const ClpCholeskyBase * factor, int numberRows) ;
38  /** Returns space needed */
39   CoinBigIndex space( int numberRows) const;
40  /** part 2 of Factorize - filling in rowsDropped */
41  void factorizePart2(int * rowsDropped) ;
42  /** part 2 of Factorize - filling in rowsDropped - blocked */
43  void factorizePart3(int * rowsDropped) ;
44  /// Non leaf recursive factor
45  void factor(longDouble * a, int n, int numberBlocks,
46              longDouble * diagonal, longDouble * work, int * rowsDropped);
47  /// Non leaf recursive triangle rectangle update
48  void triRec(longDouble * aTri, int nThis, longDouble * aUnder, longDouble * diagonal, longDouble * work,
49              int nLeft, int iBlock, int jBlock,
50              int numberBlocks);
51  /// Non leaf recursive rectangle triangle update
52  void recTri(longDouble * aUnder, int nTri, int nDo,
53              int iBlock, int jBlock,longDouble * aTri,
54              longDouble * diagonal, longDouble * work, 
55              int numberBlocks);
56  /** Non leaf recursive rectangle rectangle update,
57      nUnder is number of rows in iBlock,
58      nUnderK is number of rows in kBlock
59  */
60  void recRec(longDouble * above, int nUnder, int nUnderK,
61              int nDo, longDouble * aUnder, longDouble *aOther,longDouble * diagonal, longDouble * work,
62              int kBlock,int iBlock, int jBlock,
63              int numberBlocks);
64  /// Leaf recursive factor
65  void factorLeaf(longDouble * a, int n, 
66              longDouble * diagonal, longDouble * work, int * rowsDropped);
67  /// Leaf recursive triangle rectangle update
68  void triRecLeaf(longDouble * aTri, longDouble * aUnder,
69                  longDouble * diagonal, longDouble * work,
70                  int nUnder);
71  /// Leaf recursive rectangle triangle update
72  void recTriLeaf(longDouble * aUnder, longDouble * aTri, 
73                  longDouble * diagonal, longDouble * work, int nUnder);
74  /** Leaf recursive rectangle rectangle update,
75      nUnder is number of rows in iBlock,
76      nUnderK is number of rows in kBlock
77  */
78  void recRecLeaf(longDouble * above, 
79                  longDouble * aUnder, longDouble *aOther, longDouble * diagonal, longDouble * work,
80                  int nUnder);
81  /// Forward part of solve
82  void solveF1(longDouble * a,int n,double * region);
83  void solveF2(longDouble * a,int n,double * region,double * region2);
84  /// Backward part of solve
85  void solveB1(longDouble * a,int n,double * region);
86  void solveB2(longDouble * a,int n,double * region,double * region2);
87  /** Uses factorization to solve. */
88  void solveLong (longDouble * region) ;
89  /// Forward part of solve
90  void solveF1Long(longDouble * a,int n,longDouble * region);
91  void solveF2Long(longDouble * a,int n,longDouble * region,longDouble * region2);
92  /// Backward part of solve
93  void solveB1Long(longDouble * a,int n,longDouble * region);
94  void solveB2Long(longDouble * a,int n,longDouble * region,longDouble * region2);
95  /** Uses factorization to solve. */
96  void solveLongWork (longWork * region) ;
97  /// Forward part of solve
98  void solveF1LongWork(longDouble * a,int n,longWork * region);
99  void solveF2LongWork(longDouble * a,int n,longWork * region,longWork * region2);
100  /// Backward part of solve
101  void solveB1LongWork(longDouble * a,int n,longWork * region);
102  void solveB2LongWork(longDouble * a,int n,longWork * region,longWork * region2);
103  int bNumber(const longDouble * array,int &, int&);
104  /// A
105  inline longDouble * aMatrix() const
106  { return sparseFactor_;}
107  /// Diagonal
108  inline longDouble * diagonal() const
109  { return diagonal_;}
110  //@}
111
112
113  /**@name Constructors, destructor */
114  //@{
115  /** Default constructor. */
116  ClpCholeskyDense();
117  /** Destructor  */
118  virtual ~ClpCholeskyDense();
119  // Copy
120  ClpCholeskyDense(const ClpCholeskyDense&);
121  // Assignment
122  ClpCholeskyDense& operator=(const ClpCholeskyDense&);
123  /// Clone
124  virtual ClpCholeskyBase * clone() const ;
125  //@}
126   
127   
128private:
129  /**@name Data members */
130  //@{
131  /// Just borrowing space
132  bool borrowSpace_;
133  //@}
134};
135
136#endif
Note: See TracBrowser for help on using the repository browser.