souffle  2.0.2-371-g6315b36
Data Structures | Functions
souffle::evaluator Namespace Reference

Data Structures

struct  lxor_infix
 

Functions

template<typename A >
bool lxor (A x, A y)
 
template<typename A >
lxor_infix::curry< A > operator+ (A x, lxor_infix)
 
template<typename A , typename F >
void runRange (A from, A to, A step, F &&go)
 
template<typename A , typename F >
void runRange (A from, A to, F &&go)
 
template<typename A >
symbol2numeric (const std::string &src)
 

Function Documentation

◆ lxor()

template<typename A >
bool souffle::evaluator::lxor ( x,
y 
)

Definition at line 73 of file EvaluatorUtil.h.

76  {

References souffle::evaluator::lxor_infix::curry< A >::operator+(), and souffle::evaluator::lxor_infix::curry< A >::x.

Here is the call graph for this function:

◆ operator+()

template<typename A >
lxor_infix::curry<A> souffle::evaluator::operator+ ( x,
lxor_infix   
)

Definition at line 93 of file EvaluatorUtil.h.

◆ runRange() [1/2]

template<typename A , typename F >
void souffle::evaluator::runRange ( from,
to,
step,
F &&  go 
)

Definition at line 33 of file EvaluatorUtil.h.

33  {
34  for (auto x = from; to < x; x += step) {
35  GO(x);
36  }
37  } else if (from != to) {
38  // `step = 0` edge case, only if non-empty range
39  GO(from);
40  }
41 #undef GO
42 }
43 
44 template <typename A, typename F /* Tuple<RamDomain,1> -> void */>
45 void runRange(A from, A to, F&& go) {
46  return runRange(from, to, A(from <= to ? 1 : -1), std::forward<F>(go));
47 }
48 

◆ runRange() [2/2]

template<typename A , typename F >
void souffle::evaluator::runRange ( from,
to,
F &&  go 
)

Definition at line 51 of file EvaluatorUtil.h.

51  {
52  if constexpr (std::is_same_v<RamFloat, A>) {
53  return RamFloatFromString(src);

References souffle::RamFloatFromString(), and souffle::RamSignedFromString().

Here is the call graph for this function:

◆ symbol2numeric()

template<typename A >
A souffle::evaluator::symbol2numeric ( const std::string &  src)

Definition at line 56 of file EvaluatorUtil.h.

56  {
57  return RamUnsignedFromString(src);
58  }
59  } catch (...) {
60  tfm::format(std::cerr, "error: wrong string provided by `to_number(\"%s\")` functor.\n", src);
61  raise(SIGFPE);
62  abort(); // UNREACHABLE: `raise` lacks a no-return attribute
63  }
64 };
65 
66 template <typename A>
67 bool lxor(A x, A y) {
68  return (x || y) && (!x != !y);
69 }
70 
tinyformat::format
void format(std::ostream &out, const char *fmt)
Definition: tinyformat.h:1089
souffle::evaluator::runRange
void runRange(A from, A to, F &&go)
Definition: EvaluatorUtil.h:51
souffle::evaluator::lxor
bool lxor(A x, A y)
Definition: EvaluatorUtil.h:73
souffle::RamUnsignedFromString
RamUnsigned RamUnsignedFromString(const std::string &str, std::size_t *position=nullptr, const int base=10)
Converts a string to a RamUnsigned.
Definition: StringUtil.h:110
GO
#define GO(x)
souffle::RamFloatFromString
RamFloat RamFloatFromString(const std::string &str, std::size_t *position=nullptr)
Converts a string to a RamFloat.
Definition: StringUtil.h:93