File: CbcSubProblem.hpp

package info (click to toggle)
coinor-cbc 2.9.9+repack1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,848 kB
  • ctags: 5,787
  • sloc: cpp: 104,337; sh: 8,921; xml: 2,950; makefile: 520; ansic: 491; awk: 197
file content (83 lines) | stat: -rw-r--r-- 2,256 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// $Id: CbcSubProblem.hpp 1899 2013-04-09 18:12:08Z stefan $
// Copyright (C) 2002, International Business Machines
// Corporation and others.  All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).

// Edwin 11/10/2009-- carved out of CbcBranchActual

#ifndef CbcSubProblem_H
#define CbcSubProblem_H

#ifdef COIN_HAS_CLP
#include "ClpSimplex.hpp"
#include "ClpNode.hpp"

/** Defines a general subproblem
    Basis will be made more compact later
*/
class CoinWarmStartDiff;
class CbcSubProblem {

public:

    /// Default constructor
    CbcSubProblem ();

    /// Constructor from model
    CbcSubProblem (const OsiSolverInterface * solver,
                   const double * lowerBefore,
                   const double * upperBefore,
                   const unsigned char * status,
                   int depth);

    /// Copy constructor
    CbcSubProblem ( const CbcSubProblem &);

    /// Assignment operator
    CbcSubProblem & operator= (const CbcSubProblem& rhs);

    /// Destructor
    virtual ~CbcSubProblem ();

    /// Take over
  void takeOver ( CbcSubProblem &, bool cleanup);
    /// Apply subproblem (1=bounds, 2=basis, 3=both)
    void apply(OsiSolverInterface * model, int what = 3) const;

public:
    /// Value of objective
    double objectiveValue_;
    /// Sum of infeasibilities
    double sumInfeasibilities_;
    /// Branch value
    double branchValue_;
    /// Dj on branching variable at end
    double djValue_;
    /** Which variable (top bit if upper bound changing)
        next bit if changing on down branch only */
    int * variables_;
    /// New bound
    double * newBounds_;
    /// Status
    mutable CoinWarmStartBasis * status_;
    /// Depth
    int depth_;
    /// Number of Extra bound changes
    int numberChangedBounds_;
    /// Number of infeasibilities
    int numberInfeasibilities_;
    /** Status 1 bit going up on first, 2 bit set first branch infeasible on second, 4 bit redundant branch,
	bits after 256 give reason for stopping (just last node)
	0 - solution
	1 - infeasible
	2 - maximum depth
	>2 - error or max time or something
    */
    int problemStatus_;
    /// Variable branched on
    int branchVariable_;
};

#endif //COIN_HAS_CLP
#endif