Camargue
price_util.hpp
Go to the documentation of this file.
1 
6 #ifndef CMR_PRICE_UTIL_H
7 #define CMR_PRICE_UTIL_H
8 
9 #include "util.hpp"
10 
11 #include <array>
12 #include <iostream>
13 #include <string>
14 
15 namespace CMR {
16 
17 namespace Price {
18 
19 constexpr int Nearest = 50;
20 
21 constexpr int AddBatch = 100;
22 constexpr int PoolSize = 1000;
23 constexpr int EstBatch = 20000;
24 constexpr int ScaleBatch = 3;
25 
26 constexpr int f64Batch = 5000000;
27 
28 constexpr double MaxPenalty = 0.10;
29 
30 constexpr double RecoverMaxPen = 0.00000001;
31 
33 enum class ScanStat {
34  Partial,
35  PartOpt,
36  Full,
37  FullOpt
38 };
39 
40 
41 inline std::ostream &operator<<(std::ostream &os, ScanStat stat)
42 {
43  std::string out;
44  switch (stat) {
45  case ScanStat::Partial:
46  out = "searched Partial";
47  break;
48  case ScanStat::PartOpt:
49  out = "optimal for Partial";
50  break;
51  case ScanStat::Full:
52  out = "searched Full";
53  break;
54  case ScanStat::FullOpt:
55  out = "optimal for Full";
56  break;
57  }
58 
59  os << out;
60  return os;
61 }
62 
63 
64 template <typename numtype>
65 struct PrEdge : EndPts {
66  PrEdge() = default;
67 
68  PrEdge(int end0, int end1) : EndPts(end0, end1), redcost(1.0) {}
69 
70  PrEdge(int end0, int end1, numtype rc) : EndPts(end0, end1), redcost(rc) {}
71 
72  bool operator<(const PrEdge &rhs) const { return redcost < rhs.redcost; }
73 
74  numtype redcost;
75 };
76 
77 }
78 
79 }
80 
81 #endif
Scanned some edges, found some with negative reduced cost.
constexpr int f64Batch
Max number to generate during exact lb.
Definition: price_util.hpp:26
Definition: price_util.hpp:65
Utility functions, macros, and structures.
constexpr int AddBatch
Number added to CoreLP at a time.
Definition: price_util.hpp:21
ScanStat
Return type for edge pricing routines.
Definition: price_util.hpp:33
Scanned some edges, found none with negative reduced cost.
The namespace for this project.
Definition: abc_nodesel.hpp:20
constexpr int PoolSize
Number of negative rc edges to keep in pool.
Definition: price_util.hpp:22
Simple base class for storing edge of a graph as a sorted pair of nodes.
Definition: util.hpp:239
constexpr int ScaleBatch
Scale factor for EstBatch.
Definition: price_util.hpp:24
constexpr int Nearest
Number of nearest edges to each node examined.
Definition: price_util.hpp:19
constexpr int EstBatch
Max number of edges to estimate red cost.
Definition: price_util.hpp:23
Scanned all edges, found some with negative reduced cost.
Scanned all edges, none had negative reduced cost.