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

Last change on this file since 2470 was 2385, checked in by unxusr, 9 months ago

formatting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1/* $Id: ClpCholeskyDense.hpp 2385 2019-01-06 19:43:06Z stefan $ */
2/*
3  Copyright (C) 2003, International Business Machines Corporation
4  and others.  All Rights Reserved.
5
6  This code is licensed under the terms of the Eclipse Public License (EPL).
7*/
8#ifndef ClpCholeskyDense_H
9#define ClpCholeskyDense_H
10
11#include "ClpCholeskyBase.hpp"
12class ClpMatrixBase;
13
14class ClpCholeskyDense : public ClpCholeskyBase {
15
16public:
17  /**@name Virtual methods that the derived classes provides  */
18  /**@{*/
19  /** Orders rows and saves pointer to matrix.and model.
20      Returns non-zero if not enough memory */
21  virtual int order(ClpInterior *model);
22  /** Does Symbolic factorization given permutation.
23         This is called immediately after order.  If user provides this then
24         user must provide factorize and solve.  Otherwise the default factorization is used
25         returns non-zero if not enough memory */
26  virtual int symbolic();
27  /** Factorize - filling in rowsDropped and returning number dropped.
28         If return code negative then out of memory */
29  virtual int factorize(const CoinWorkDouble *diagonal, int *rowsDropped);
30  /** Uses factorization to solve. */
31  virtual void solve(CoinWorkDouble *region);
32  /**@}*/
33
34  /**@name Non virtual methods for ClpCholeskyDense  */
35  /**@{*/
36  /** Reserves space.
37         If factor not NULL then just uses passed space
38      Returns non-zero 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  {
56    return sparseFactor_;
57  }
58  /** Diagonal */
59  inline longDouble *diagonal() const
60  {
61    return diagonal_;
62  }
63  /**@}*/
64
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
79private:
80  /**@name Data members */
81  /**@{*/
82  /** Just borrowing space */
83  bool borrowSpace_;
84  /**@}*/
85};
86
87/* structure for C */
88typedef struct {
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} ClpCholeskyDenseC;
98
99extern "C" {
100void ClpCholeskySpawn(void *);
101}
102/**Non leaf recursive factor */
103void ClpCholeskyCfactor(ClpCholeskyDenseC *thisStruct,
104  longDouble *a, int n, int numberBlocks,
105  longDouble *diagonal, longDouble *work, int *rowsDropped);
106
107/**Non leaf recursive triangle rectangle update */
108void 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);
114/**Non leaf recursive rectangle triangle update */
115void 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);
120/** Non leaf recursive rectangle rectangle update,
121    nUnder is number of rows in iBlock,
122    nUnderK is number of rows in kBlock
123*/
124void 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);
130/**Leaf recursive factor */
131void ClpCholeskyCfactorLeaf(ClpCholeskyDenseC *thisStruct,
132  longDouble *a, int n,
133  longDouble *diagonal, longDouble *work,
134  int *rowsDropped);
135/**Leaf recursive triangle rectangle update */
136void ClpCholeskyCtriRecLeaf(/*ClpCholeskyDenseC * thisStruct,*/
137  longDouble *aTri, longDouble *aUnder,
138  longDouble *diagonal, longDouble *work,
139  int nUnder);
140/**Leaf recursive rectangle triangle update */
141void ClpCholeskyCrecTriLeaf(/*ClpCholeskyDenseC * thisStruct, */
142  longDouble *aUnder, longDouble *aTri,
143  /*longDouble * diagonal,*/ longDouble *work, int nUnder);
144/** Leaf recursive rectangle rectangle update,
145    nUnder is number of rows in iBlock,
146    nUnderK is number of rows in kBlock
147*/
148void 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);
154#endif
155
156/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
157*/
Note: See TracBrowser for help on using the repository browser.