File: CbcStatistics.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 (101 lines) | stat: -rw-r--r-- 2,579 bytes parent folder | download | duplicates (4)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* $Id: CbcStatistics.hpp 1573 2011-01-05 01:12:36Z lou $ */
// Copyright (C) 2005, International Business Machines
// Corporation and others.  All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).

#ifndef CbcStatistics_H
#define CbcStatistics_H

#include "CbcModel.hpp"

/** For gathering statistics */

class CbcStatistics {
public:
    // Default Constructor
    CbcStatistics ();
    // Branch
    CbcStatistics(CbcNode * node, CbcModel * model);

    ~CbcStatistics();
    // Copy
    CbcStatistics(const CbcStatistics & rhs);
    // Assignment
    CbcStatistics& operator=(const CbcStatistics & rhs);
    // Update at end of branch
    void endOfBranch(int numberIterations, double objectiveValue);
    // Update number of infeasibilities
    void updateInfeasibility(int numberInfeasibilities);
    // Branch found to be infeasible by chooseBranch
    void sayInfeasible();
    // Just prints
    void print(const int * sequenceLookup = NULL) const;
    // Node number
    inline int node() const {
        return id_;
    }
    // Parent node number
    inline int parentNode() const {
        return parentId_;
    }
    // depth
    inline int depth() const {
        return depth_;
    }
    // way
    inline int way() const {
        return way_;
    }
    // value
    inline double value() const {
        return value_;
    }
    // starting objective
    inline double startingObjective() const {
        return startingObjective_;
    }
    // Unsatisfied at beginning
    inline int startingInfeasibility() const {
        return startingInfeasibility_;
    }
    // starting objective
    inline double endingObjective() const {
        return endingObjective_;
    }
    // Unsatisfied at end
    inline int endingInfeasibility() const {
        return endingInfeasibility_;
    }
    // Number iterations
    inline int numberIterations() const {
        return numberIterations_;
    }

protected:
    // Data
    /// Value
    double value_;
    /// Starting objective
    double startingObjective_;
    /// Ending objective
    double endingObjective_;
    /// id
    int id_;
    /// parent id
    int parentId_;
    /// way -1 or +1 is first branch -10 or +10 is second branch
    int way_;
    /// sequence number branched on
    int sequence_;
    /// depth
    int depth_;
    /// starting number of integer infeasibilities
    int startingInfeasibility_;
    /// ending number of integer infeasibilities
    int endingInfeasibility_;
    /// number of iterations
    int numberIterations_;
};

#endif