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

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

formatting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.1 KB
RevLine 
[1370]1/* $Id: ClpCholeskyDense.hpp 2385 2019-01-06 19:43:06Z stefan $ */
[1665]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*/
[263]8#ifndef ClpCholeskyDense_H
9#define ClpCholeskyDense_H
10
11#include "ClpCholeskyBase.hpp"
[440]12class ClpMatrixBase;
[263]13
14class ClpCholeskyDense : public ClpCholeskyBase {
[1502]15
[263]16public:
[2385]17  /**@name Virtual methods that the derived classes provides  */
18  /**@{*/
19  /** Orders rows and saves pointer to matrix.and model.
[1525]20      Returns non-zero if not enough memory */
[2385]21  virtual int order(ClpInterior *model);
22  /** Does Symbolic factorization given permutation.
[1525]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 */
[2385]26  virtual int symbolic();
27  /** Factorize - filling in rowsDropped and returning number dropped.
[1525]28         If return code negative then out of memory */
[2385]29  virtual int factorize(const CoinWorkDouble *diagonal, int *rowsDropped);
30  /** Uses factorization to solve. */
31  virtual void solve(CoinWorkDouble *region);
32  /**@}*/
[263]33
[2385]34  /**@name Non virtual methods for ClpCholeskyDense  */
35  /**@{*/
36  /** Reserves space.
[1525]37         If factor not NULL then just uses passed space
38      Returns non-zero if not enough memory */
[2385]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  /**@}*/
[263]64
[2385]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  /**@}*/
[320]78
[263]79private:
[2385]80  /**@name Data members */
81  /**@{*/
82  /** Just borrowing space */
83  bool borrowSpace_;
84  /**@}*/
[263]85};
86
[1368]87/* structure for C */
[1502]88typedef struct {
[2385]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;
[1368]97} ClpCholeskyDenseC;
98
99extern "C" {
[2385]100void ClpCholeskySpawn(void *);
[1368]101}
[1502]102/**Non leaf recursive factor */
[2385]103void ClpCholeskyCfactor(ClpCholeskyDenseC *thisStruct,
104  longDouble *a, int n, int numberBlocks,
105  longDouble *diagonal, longDouble *work, int *rowsDropped);
[1502]106
107/**Non leaf recursive triangle rectangle update */
[2385]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);
[1502]114/**Non leaf recursive rectangle triangle update */
[2385]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);
[1502]120/** Non leaf recursive rectangle rectangle update,
121    nUnder is number of rows in iBlock,
122    nUnderK is number of rows in kBlock
123*/
[2385]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);
[1502]130/**Leaf recursive factor */
[2385]131void ClpCholeskyCfactorLeaf(ClpCholeskyDenseC *thisStruct,
132  longDouble *a, int n,
133  longDouble *diagonal, longDouble *work,
134  int *rowsDropped);
[1502]135/**Leaf recursive triangle rectangle update */
[2385]136void ClpCholeskyCtriRecLeaf(/*ClpCholeskyDenseC * thisStruct,*/
137  longDouble *aTri, longDouble *aUnder,
138  longDouble *diagonal, longDouble *work,
139  int nUnder);
[1502]140/**Leaf recursive rectangle triangle update */
[2385]141void ClpCholeskyCrecTriLeaf(/*ClpCholeskyDenseC * thisStruct, */
142  longDouble *aUnder, longDouble *aTri,
143  /*longDouble * diagonal,*/ longDouble *work, int nUnder);
[1502]144/** Leaf recursive rectangle rectangle update,
145    nUnder is number of rows in iBlock,
146    nUnderK is number of rows in kBlock
147*/
[2385]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);
[263]154#endif
[2385]155
156/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
157*/
Note: See TracBrowser for help on using the repository browser.