Molassembler  3.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ValueBounds.h
Go to the documentation of this file.
1 
8 #ifndef INCLUDE_MOLASSEMBLER_DISTANCE_GEOMETRY_VALUE_BOUNDS_H
9 #define INCLUDE_MOLASSEMBLER_DISTANCE_GEOMETRY_VALUE_BOUNDS_H
10 
11 #include <stdexcept>
12 
13 namespace Scine {
14 
15 namespace Molassembler {
16 
17 namespace DistanceGeometry {
18 
19 /* Exchanged types */
23 struct ValueBounds {
24  double lower, upper;
25 
39  constexpr ValueBounds(double passLower, double passUpper)
40  : lower(passLower), upper(passUpper)
41  {
42  if(upper < lower) {
43  throw std::runtime_error("Passed lower value is not smaller than the upper value!");
44  }
45  }
46 
52  ValueBounds();
53 
62  bool operator == (const ValueBounds& other) const;
64  bool operator != (const ValueBounds& other) const;
65 };
66 
67 } // namespace DistanceGeometry
68 
69 } // namespace Molassembler
70 
71 } // namespace Scine
72 
73 #endif
bool operator!=(const ValueBounds &other) const
Negates operator ==.
bool operator==(const ValueBounds &other) const
Returns whether the bounds exactly equal another set of bounds.
Data class for bounded values.
Definition: ValueBounds.h:23
constexpr ValueBounds(double passLower, double passUpper)
Main constructor.
Definition: ValueBounds.h:39
ValueBounds()
Default constructor yields double lowest/max pair.