source: trunk/Alps/examples/Abc/AbcBranchBase.h @ 277

Last change on this file since 277 was 277, checked in by andreasw, 13 years ago

first working version with autotools

File size: 3.6 KB
Line 
1/*===========================================================================*
2 * This file is part of the Abstract Library for Parallel Search (ALPS).     *
3 *                                                                           *
4 * ALPS is distributed under the Common Public License as part of the        *
5 * COIN-OR repository (http://www.coin-or.org).                              *
6 *                                                                           *
7 * Authors: Yan Xu, SAS Institute Inc.                                       *
8 *          Ted Ralphs, Lehigh University                                    *
9 *          Laszlo Ladanyi, IBM T.J. Watson Research Center                  *
10 *          Matthew Saltzman, Clemson University                             *
11 *                                                                           *
12 *                                                                           *
13 * Copyright (C) 2001-2004, International Business Machines                  *
14 * Corporation, Lehigh University, Yan Xu, Ted Ralphs, Matthew Salzman and   *
15 * others. All Rights Reserved.                                              *
16 *===========================================================================*/
17
18#ifndef AbcBranchBase_h_
19#define AbcBranchBase_h_
20
21//#############################################################################
22// This file is modified from SbbBranchBase.hpp
23//#############################################################################
24
25#include <string>
26#include <vector>
27
28class OsiSolverInterface;
29
30class AbcModel;
31class AbcNode;
32class AbcNodeDesc;
33class AbcBranchingObject;
34
35//#############################################################################
36
37/** Abstract branching decision base class
38
39    In the abstract, an AbcBranchDecision object is expected to be able to
40    compare two possible branching choices.
41
42    The #betterBranch() method is the crucial routine. It is expected to be
43    able to compare two integer variables.
44*/
45class AbcBranchDecision {
46 public:
47    /// Default Constructor
48    AbcBranchDecision ();
49
50    /// Destructor
51    virtual ~AbcBranchDecision();
52
53    /// Clone
54    virtual AbcBranchDecision * clone() const = 0;
55
56    /// Initialize <i>e.g.</i> before starting to choose a branch at a node
57    virtual void initialize(AbcModel * model) = 0;
58
59    /** \brief Compare two branching objects (current just integer variables).
60        Return nonzero if branching using \p thisOne is better than
61        branching using \p bestSoFar.
62   
63        If \p bestSoFar is NULL, the routine should return a nonzero value.
64        This routine is used only after strong branching.
65
66        It is now reccommended that bestBranch is used - see below.
67        This has been left for compatibility.
68    */
69    virtual int
70        betterBranch(int thisOne,
71                     int bestSoFar,
72                     double changeUp, 
73                     int numberInfeasibilitiesUp,
74                     double changeDown, 
75                     int numberInfeasibilitiesDown) = 0 ;
76
77    /** \brief Compare N branching objects. Return index of best
78        and sets way of branching in chosen object.
79   
80        This routine is used only after strong branching.
81        This is reccommended version as it can be more sophisticated
82    */
83    virtual int bestBranch ( AbcModel* model,
84                             int* objects, 
85                             int numberObjects, 
86                             int numberUnsatisfied,
87                             double * changeUp, 
88                             int * numberInfeasibilitiesUp,
89                             double * changeDown, 
90                             int * numberInfeasibilitiesDown,
91                             double objectiveValue );
92   
93 private:
94   
95    /// Assignment is illegal
96    AbcBranchDecision & operator=(const AbcBranchDecision& rhs);
97   
98};
99
100#endif
Note: See TracBrowser for help on using the repository browser.