PRISMS-PF Manual v3.0-pre
Loading...
Searching...
No Matches
RefinementCriterion.h
1#ifndef INCLUDE_REFINMENTCRITERION_H_
2#define INCLUDE_REFINMENTCRITERION_H_
3
4enum RefinementCriterionFlags
5{
6 criterion_default = 0,
7 criterion_value = 0x0001,
8 criterion_gradient = 0x0002
9};
10
11// Function that enables bitwise OR between flags
12inline RefinementCriterionFlags
13operator|(const RefinementCriterionFlags flag_1, const RefinementCriterionFlags flag_2)
14{
15 return static_cast<RefinementCriterionFlags>(static_cast<unsigned int>(flag_1) |
16 static_cast<unsigned int>(flag_2));
17}
18
19// Function that enables bitwise compound OR between flags
20inline RefinementCriterionFlags &
21operator|=(RefinementCriterionFlags &flag_1, const RefinementCriterionFlags flag_2)
22{
23 flag_1 = flag_1 | flag_2;
24 return flag_1;
25}
26
27// Function that enables bitwise AND between flags
28inline RefinementCriterionFlags
29operator&(const RefinementCriterionFlags flag_1, const RefinementCriterionFlags flag_2)
30{
31 return static_cast<RefinementCriterionFlags>(static_cast<unsigned int>(flag_1) &
32 static_cast<unsigned int>(flag_2));
33}
34
35// Function that enables bitwise compound AND between flags
36inline RefinementCriterionFlags &
37operator&=(RefinementCriterionFlags &flag_1, const RefinementCriterionFlags flag_2)
38{
39 flag_1 = flag_1 & flag_2;
40 return flag_1;
41}
42
48{
49public:
50 std::string variable_name;
51 unsigned int variable_index;
52 RefinementCriterionFlags criterion_type;
53 double value_lower_bound;
54 double value_upper_bound;
55 double gradient_lower_bound;
56};
57
58#endif /* INCLUDE_REFINMENTCRITERION_H_ */
Definition RefinementCriterion.h:48