aGrUM 3.3.2
a C++ library for (probabilistic) graphical models
gum::Configuration::Meta::Domain Struct Reference

domain of validity of an int or float key, written after the type in the ### line: float]0,1[, int[1,], int[0,100]. A bracket turned toward the bound includes it, turned away excludes it ; an omitted bound is unbounded. More...

#include <configuration.h>

Collaboration diagram for gum::Configuration::Meta::Domain:
[legend]

Public Member Functions

bool contains (double x) const

Public Attributes

bool hasLower {false}
bool hasUpper {false}
bool lowerIncluded {true}
bool upperIncluded {true}
double lower {0.}
double upper {0.}
std::string text
 the domain as written, without blanks (e.g. ]0,1[) ; empty if none

Detailed Description

domain of validity of an int or float key, written after the type in the ### line: float]0,1[, int[1,], int[0,100]. A bracket turned toward the bound includes it, turned away excludes it ; an omitted bound is unbounded.

Definition at line 115 of file configuration.h.

Member Function Documentation

◆ contains()

bool gum::Configuration::Meta::Domain::contains ( double x) const
Returns
true if x belongs to the domain (a domain without bound contains every number).

Definition at line 297 of file configuration.cpp.

297 {
298 if ((hasLower || hasUpper) && std::isnan(x)) return false;
299 if (hasLower && (x < lower || (x == lower && !lowerIncluded))) return false;
300 if (hasUpper && (x > upper || (x == upper && !upperIncluded))) return false;
301 return true;
302 }

References hasLower, hasUpper, lower, lowerIncluded, upper, and upperIncluded.

Referenced by gum::Configuration::_validate_().

Here is the caller graph for this function:

Member Data Documentation

◆ hasLower

bool gum::Configuration::Meta::Domain::hasLower {false}

Definition at line 116 of file configuration.h.

Referenced by contains().

◆ hasUpper

bool gum::Configuration::Meta::Domain::hasUpper {false}

Definition at line 117 of file configuration.h.

Referenced by contains().

◆ lower

double gum::Configuration::Meta::Domain::lower {0.}

Definition at line 120 of file configuration.h.

Referenced by contains().

◆ lowerIncluded

bool gum::Configuration::Meta::Domain::lowerIncluded {true}

Definition at line 118 of file configuration.h.

Referenced by contains().

◆ text

std::string gum::Configuration::Meta::Domain::text

the domain as written, without blanks (e.g. ]0,1[) ; empty if none

Definition at line 123 of file configuration.h.

Referenced by gum::Configuration::_validate_().

◆ upper

double gum::Configuration::Meta::Domain::upper {0.}

Definition at line 121 of file configuration.h.

Referenced by contains().

◆ upperIncluded

bool gum::Configuration::Meta::Domain::upperIncluded {true}

Definition at line 119 of file configuration.h.

Referenced by contains().


The documentation for this struct was generated from the following files: