36 void print(
const std::string&
s =
"Assignment: ")
const {
37 std::cout <<
s <<
": ";
38 for(
const typename Assignment::value_type& keyValue: *
this)
39 std::cout <<
"(" << keyValue.first <<
", " << keyValue.second <<
")";
40 std::cout << std::endl;
44 return (*
this == other);
63 const std::vector<std::pair<L, size_t> >&
keys) {
64 std::vector<Assignment<L> > allPossValues;
67 for(
const DiscreteKey&
key:
keys)
68 values[
key.first] = 0;
70 allPossValues.push_back(values);
72 for (j = 0; j < keys.size(); j++) {
73 L idx = keys[
j].first;
75 if (values[idx] < keys[j].second)
std::vector< Assignment< L > > cartesianProduct(const std::vector< std::pair< L, size_t > > &keys)
Get Cartesian product consisting all possible configurations.
bool equals(const Assignment &other, double tol=1e-9) const
void print(const std::string &s="Assignment: ") const
std::pair< Key, size_t > DiscreteKey
Array< double, 1, 3 > e(1./3., 0.5, 2.)