source: stable/1.6/Clp/src/ClpFactorization.hpp @ 1609

Last change on this file since 1609 was 1055, checked in by forrest, 13 years ago

out };

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1// Copyright (C) 2002, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#ifndef ClpFactorization_H
4#define ClpFactorization_H
5
6
7#include "CoinPragma.hpp"
8
9#include "CoinFactorization.hpp"
10class ClpMatrixBase;
11class ClpSimplex;
12class ClpNetworkBasis;
13
14/** This just implements CoinFactorization when an ClpMatrixBase object
15    is passed.  If a network then has a dummy CoinFactorization and
16    a genuine ClpNetworkBasis object
17*/
18
19class ClpFactorization : public CoinFactorization {
20 
21public:
22  /**@name factorization */
23   //@{
24  /** When part of LP - given by basic variables.
25  Actually does factorization.
26  Arrays passed in have non negative value to say basic.
27  If status is okay, basic variables have pivot row - this is only needed
28  if increasingRows_ >1.
29  Allows scaling
30  If status is singular, then basic variables have pivot row
31  and ones thrown out have -1
32  returns 0 -okay, -1 singular, -2 too many in basis, -99 memory */
33  int factorize (ClpSimplex * model,int solveType, bool valuesPass);
34   //@}
35
36
37  /**@name Constructors, destructor */
38   //@{
39   /** Default constructor. */
40   ClpFactorization();
41   /** Destructor */
42   ~ClpFactorization();
43   //@}
44
45   /**@name Copy method */
46   //@{
47   /** The copy constructor. */
48   ClpFactorization(const ClpFactorization&);
49   /** The copy constructor from an CoinFactorization. */
50   ClpFactorization(const CoinFactorization&);
51
52   ClpFactorization& operator=(const ClpFactorization&);
53   //@}
54   
55  /*  **** below here is so can use networkish basis */
56  /**@name rank one updates which do exist */
57  //@{
58
59  /** Replaces one Column to basis,
60   returns 0=OK, 1=Probably OK, 2=singular, 3=no room
61      If checkBeforeModifying is true will do all accuracy checks
62      before modifying factorization.  Whether to set this depends on
63      speed considerations.  You could just do this on first iteration
64      after factorization and thereafter re-factorize
65   partial update already in U */
66  int replaceColumn ( const ClpSimplex * model,
67                      CoinIndexedVector * regionSparse,
68                      CoinIndexedVector * tableauColumn,
69                      int pivotRow,
70                      double pivotCheck ,
71                      bool checkBeforeModifying=false);
72  //@}
73
74  /**@name various uses of factorization (return code number elements)
75   which user may want to know about */
76  //@{
77  /** Updates one column (FTRAN) from region2
78      Tries to do FT update
79      number returned is negative if no room
80      region1 starts as zero and is zero at end */
81  int updateColumnFT ( CoinIndexedVector * regionSparse,
82                       CoinIndexedVector * regionSparse2);
83  int updateColumn ( CoinIndexedVector * regionSparse,
84                     CoinIndexedVector * regionSparse2,
85                     bool noPermute=false) const;
86  /// For debug (no statistics update)
87  int updateColumnForDebug ( CoinIndexedVector * regionSparse,
88                     CoinIndexedVector * regionSparse2,
89                     bool noPermute=false) const;
90  /** Updates one column (BTRAN) from region2
91      region1 starts as zero and is zero at end */
92  int updateColumnTranspose ( CoinIndexedVector * regionSparse,
93                              CoinIndexedVector * regionSparse2) const;
94  //@}
95   
96  /**@name other stuff */
97  //@{
98  /** makes a row copy of L for speed and to allow very sparse problems */
99  void goSparse();
100  /// Cleans up i.e. gets rid of network basis
101  void cleanUp();
102  /// Says whether to redo pivot order
103  bool needToReorder() const;
104#ifndef SLIM_CLP
105  /// Says if a network basis
106  inline bool networkBasis() const
107  { return (networkBasis_!=NULL);}
108#else
109  /// Says if a network basis
110  inline bool networkBasis() const
111  { return false;}
112#endif
113  /// Fills weighted row list
114  void getWeights(int * weights) const;
115  //@}
116
117////////////////// data //////////////////
118private:
119
120  /**@name data */
121  //@{
122  /// Pointer to network basis
123#ifndef SLIM_CLP
124  ClpNetworkBasis * networkBasis_;
125#endif
126  //@}
127};
128
129#endif
Note: See TracBrowser for help on using the repository browser.