source: branches/unlabeled-1.1.2/include/ClpNetworkBasis.hpp @ 118

Last change on this file since 118 was 118, checked in by forrest, 17 years ago

Adding Network matrix and PlusMinusOne?

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 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;
15/** This deals with Factorization and Updates for network structures
16 */
17
18
19class ClpNetworkBasis {
20
21public:
22
23  /**@name Constructors and destructor and copy */
24  //@{
25  /// Default constructor
26    ClpNetworkBasis (  );
27  /// Copy constructor
28  ClpNetworkBasis ( const ClpNetworkBasis &other);
29
30  /// Destructor
31   ~ClpNetworkBasis (  );
32  /// = copy
33    ClpNetworkBasis & operator = ( const ClpNetworkBasis & other );
34  //@}
35
36  /**@name Do factorization */
37  //@{
38  /** When part of LP - given by basic variables.
39  Actually does factorization.
40  Arrays passed in have non negative value to say basic.
41  If status is okay, basic variables have pivot row - this is only needed
42  if increasingRows_ >1.
43  If status is singular, then basic variables have pivot row
44  and ones thrown out have -1
45  returns 0 -okay, -1 singular, -2 too many in basis */
46  int factorize ( const ClpMatrixBase * matrix, 
47                  int rowIsBasic[], int columnIsBasic[]);
48  //@}
49
50  /**@name rank one updates which do exist */
51  //@{
52
53  /** Replaces one Column to basis,
54   returns 0=OK, 1=Probably OK, 2=singular!!
55  */
56  int replaceColumn ( CoinIndexedVector * column,
57                      int pivotRow);
58  //@}
59
60  /**@name various uses of factorization (return code number elements)
61   which user may want to know about */
62  //@{
63  /** Updates one column (FTRAN) from region2
64      number returned is negative if no room
65      region1 starts as zero and is zero at end */
66  int updateColumn ( CoinIndexedVector * regionSparse,
67                     CoinIndexedVector * regionSparse2);
68  /** Updates one column (FTRAN) to/from array
69      number returned is negative if no room
70      ** For large problems you should ALWAYS know where the nonzeros
71      are, so please try and migrate to previous method after you
72      have got code working using this simple method - thank you!
73      (the only exception is if you know input is dense e.g. rhs)
74      region starts as zero and is zero at end */
75  int updateColumn ( CoinIndexedVector * regionSparse,
76                        double array[] ) const;
77  /** Updates one column transpose (BTRAN)
78      ** For large problems you should ALWAYS know where the nonzeros
79      are, so please try and migrate to previous method after you
80      have got code working using this simple method - thank you!
81      (the only exception is if you know input is dense e.g. dense objective)
82      returns number of nonzeros */
83  int updateColumnTranspose ( CoinIndexedVector * regionSparse,
84                                 double array[] ) const;
85  /** Updates one column (BTRAN) from region2
86      region1 starts as zero and is zero at end */
87  int updateColumnTranspose ( CoinIndexedVector * regionSparse,
88                              CoinIndexedVector * regionSparse2) const;
89  //@}
90////////////////// data //////////////////
91private:
92
93  /**@name data */
94  //@{
95  /// Whether slack value is  +1 or -1
96  double slackValue_;
97  /// Number of Rows in factorization
98  int numberRows_;
99  /// Number of Columns in factorization
100  int numberColumns_;
101  /// Maximum number of pivots before factorization
102  int maximumPivots_;
103  /// Number pivots since last factorization
104  int numberPivots_;
105  /// Pivot order for each Column
106  int *pivotColumn_;
107  /// Permutation vector for pivot row order
108  int *permute_;
109  /// DePermutation vector for pivot row order
110  int *permuteBack_;
111  //@}
112};
113#endif
Note: See TracBrowser for help on using the repository browser.