9 using Row = std::vector<double>;
26 std::istringstream iss2(token);
30 if (std::count(token.begin(), token.end(),
'/') == 0)
return std::nullopt;
32 for (std::string
s; std::getline(iss2,
s,
'/');) {
34 row.push_back(std::stod(
s));
37 if (token.back() ==
'/')
return std::nullopt;
41 return std::move(row);
45 const std::vector<std::string>& tokens) {
49 for (
const auto& word : tokens) {
53 }
else if (word ==
"T") {
58 table.push_back(*
row);
65 return std::move(table);
68 std::vector<std::string>
static Tokenize(
const std::string&
str) {
69 std::istringstream iss(str);
70 std::vector<std::string> tokens;
71 for (std::string
s; iss >>
s;) {
89 std::vector<std::string> tokens =
Tokenize(str);
92 if (tokens[0] ==
"OR") {
94 if (tokens.size() > 1) {
101 if (tokens[0] ==
"AND") {
103 if (tokens.size() > 1) {
static std::optional< Row > ParseConditional(const std::string &token)
static std::vector< std::string > Tokenize(const std::string &str)
const MATRIX::ConstRowXpr row(const MATRIX &A, size_t j)
static Row ParseFalseRow()
Parser for conditional distribution signatures.
static std::optional< Table > ParseConditionalTable(const std::vector< std::string > &tokens)
static std::optional< Table > Parse(const std::string &str)
std::vector< double > Row
std::is_same< bools< Ts::value..., true >, bools< true, Ts::value... > > all_of
static Row ParseTrueRow()