source: trunk/Clp/src/ClpNetworkBasis.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: 4.1 KB
Line 
1/* $Id: ClpNetworkBasis.hpp 2385 2019-01-06 19:43:06Z stefan $ */
2// Copyright (C) 2003, International Business Machines
3// Corporation and others.  All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5/*
6   Authors
7
8   John Forrest
9
10 */
11#ifndef ClpNetworkBasis_H
12#define ClpNetworkBasis_H
13
14class ClpMatrixBase;
15class CoinIndexedVector;
16class ClpSimplex;
17#include "CoinTypes.hpp"
18#ifndef COIN_FAST_CODE
19#define COIN_FAST_CODE
20#endif
21
22/** This deals with Factorization and Updates for network structures
23 */
24
25class ClpNetworkBasis {
26
27public:
28  /**@name Constructors and destructor and copy */
29  //@{
30  /// Default constructor
31  ClpNetworkBasis();
32  /// Constructor from CoinFactorization
33  ClpNetworkBasis(const ClpSimplex *model,
34    int numberRows, const CoinFactorizationDouble *pivotRegion,
35    const int *permuteBack, const int *startColumn,
36    const int *numberInColumn,
37    const int *indexRow, const CoinFactorizationDouble *element);
38  /// Copy constructor
39  ClpNetworkBasis(const ClpNetworkBasis &other);
40
41  /// Destructor
42  ~ClpNetworkBasis();
43  /// = copy
44  ClpNetworkBasis &operator=(const ClpNetworkBasis &other);
45  //@}
46
47  /**@name Do factorization */
48  //@{
49  /** When part of LP - given by basic variables.
50     Actually does factorization.
51     Arrays passed in have non negative value to say basic.
52     If status is okay, basic variables have pivot row - this is only needed
53     if increasingRows_ >1.
54     If status is singular, then basic variables have pivot row
55     and ones thrown out have -1
56     returns 0 -okay, -1 singular, -2 too many in basis */
57  int factorize(const ClpMatrixBase *matrix,
58    int rowIsBasic[], int columnIsBasic[]);
59  //@}
60
61  /**@name rank one updates which do exist */
62  //@{
63
64  /** Replaces one Column to basis,
65      returns 0=OK, 1=Probably OK, 2=singular!!
66     */
67  int replaceColumn(CoinIndexedVector *column,
68    int pivotRow);
69  //@}
70
71  /**@name various uses of factorization (return code number elements)
72      which user may want to know about */
73  //@{
74  /** Updates one column (FTRAN) from region,
75         Returns pivot value if "pivotRow" >=0
76     */
77  double updateColumn(CoinIndexedVector *regionSparse,
78    CoinIndexedVector *regionSparse2,
79    int pivotRow);
80  /** Updates one column (FTRAN) to/from array
81         ** For large problems you should ALWAYS know where the nonzeros
82         are, so please try and migrate to previous method after you
83         have got code working using this simple method - thank you!
84         (the only exception is if you know input is dense e.g. rhs) */
85  int updateColumn(CoinIndexedVector *regionSparse,
86    double array[]) const;
87  /** Updates one column transpose (BTRAN)
88         ** For large problems you should ALWAYS know where the nonzeros
89         are, so please try and migrate to previous method after you
90         have got code working using this simple method - thank you!
91         (the only exception is if you know input is dense e.g. dense objective)
92         returns number of nonzeros */
93  int updateColumnTranspose(CoinIndexedVector *regionSparse,
94    double array[]) const;
95  /** Updates one column (BTRAN) from region2 */
96  int updateColumnTranspose(CoinIndexedVector *regionSparse,
97    CoinIndexedVector *regionSparse2) const;
98  //@}
99  ////////////////// data //////////////////
100private:
101  // checks looks okay
102  void check();
103  // prints data
104  void print();
105  /**@name data */
106  //@{
107#ifndef COIN_FAST_CODE
108  /// Whether slack value is  +1 or -1
109  double slackValue_;
110#endif
111  /// Number of Rows in factorization
112  int numberRows_;
113  /// Number of Columns in factorization
114  int numberColumns_;
115  /// model
116  const ClpSimplex *model_;
117  /// Parent for each column
118  int *parent_;
119  /// Descendant
120  int *descendant_;
121  /// Pivot row
122  int *pivot_;
123  /// Right sibling
124  int *rightSibling_;
125  /// Left sibling
126  int *leftSibling_;
127  /// Sign of pivot
128  double *sign_;
129  /// Stack
130  int *stack_;
131  /// Permute into array
132  int *permute_;
133  /// Permute back array
134  int *permuteBack_;
135  /// Second stack
136  int *stack2_;
137  /// Depth
138  int *depth_;
139  /// To mark rows
140  char *mark_;
141  //@}
142};
143#endif
144
145/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
146*/
Note: See TracBrowser for help on using the repository browser.