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

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

first version

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