BlisPseudo.h
Go to the documentation of this file.
1 /*===========================================================================*
2  * This file is part of the Bcps Linear Solver (BLIS). *
3  * *
4  * BLIS is distributed under the Eclipse Public License as part of the *
5  * COIN-OR repository (http://www.coin-or.org). *
6  * *
7  * Authors: *
8  * *
9  * Yan Xu, Lehigh University *
10  * Ted Ralphs, Lehigh University *
11  * *
12  * Conceptual Design: *
13  * *
14  * Yan Xu, Lehigh University *
15  * Ted Ralphs, Lehigh University *
16  * Laszlo Ladanyi, IBM T.J. Watson Research Center *
17  * Matthew Saltzman, Clemson University *
18  * *
19  * *
20  * Copyright (C) 2001-2013, Lehigh University, Yan Xu, and Ted Ralphs. *
21  * All Rights Reserved. *
22  *===========================================================================*/
23 
24 #ifndef BlisPseudo_h_
25 #define BlisPseudo_h_
26 
27 #include "CoinError.hpp"
28 
29 //#############################################################################
30 
32 {
33  private:
35  double weight_;
36 
38  int upCount_;
39 
41  double upCost_;
42 
45 
47  double downCost_;
48 
53  double score_;
54 
55  public:
58  weight_(1.0),
59  upCount_(0),
60  upCost_(0.0),
61  downCount_(0),
62  downCost_(0.0),
63  score_(0.0)
64  {}
65 
67  BlisPseudocost(double uc,
68  int un,
69  double dc,
70  int dn,
71  double s)
72  :
73  weight_(1.0),
74  upCount_(un),
75  upCost_(uc),
76  downCount_(dn),
77  downCost_(dc),
78  score_(s)
79  {}
80 
82  void setWeight(double w) {
83  if (w < 0.0 || w > 1.0) {
84  throw CoinError("weight is not in range [0,1]", "setWeight",
85  "BlisPseudo");
86  }
87  weight_= w;
88  }
89 
91  void update(const int dir,
92  const double parentObjValue,
93  const double objValue,
94  const double solValue);
95 
97  void update(const int dir,
98  const double objDiff,
99  const double solValue);
100 
102  int getUpCount() { return upCount_; }
103 
105  double getUpCost() { return upCost_; }
106 
108  int getDownCount() { return downCount_; }
109 
111  double getDownCost() { return downCost_; }
112 
114  double getScore() { return score_; }
115 };
116 
117 #endif
BlisPseudocost()
Default constructor.
Definition: BlisPseudo.h:57
int getDownCount()
Get down branching count.
Definition: BlisPseudo.h:108
void setWeight(double w)
Set weigth.
Definition: BlisPseudo.h:82
double getUpCost()
Get up branching cost.
Definition: BlisPseudo.h:105
BlisPseudocost(double uc, int un, double dc, int dn, double s)
Useful constructor.
Definition: BlisPseudo.h:67
double getDownCost()
Get down branching cost.
Definition: BlisPseudo.h:111
double upCost_
Average object change when branching up.
Definition: BlisPseudo.h:41
int getUpCount()
Get up branching count.
Definition: BlisPseudo.h:102
double score_
The estimated importance.
Definition: BlisPseudo.h:53
int downCount_
How many times being branched down.
Definition: BlisPseudo.h:44
double downCost_
Average object change when branching down.
Definition: BlisPseudo.h:47
int upCount_
How many times being branched up.
Definition: BlisPseudo.h:38
void update(const int dir, const double parentObjValue, const double objValue, const double solValue)
Update pseudocost.
Error Class thrown by an exception.
Definition: CoinError.hpp:42
double weight_
Use to calculate score.
Definition: BlisPseudo.h:35
double getScore()
Get importance.
Definition: BlisPseudo.h:114