Skip to content

Instantly share code, notes, and snippets.

@tautologico
Created December 4, 2013 14:37
Show Gist options
  • Select an option

  • Save tautologico/7788447 to your computer and use it in GitHub Desktop.

Select an option

Save tautologico/7788447 to your computer and use it in GitHub Desktop.
assign.iter()
.zip(self.vars.iter())
.filter(|&(_, var)| res_vars.contains(var))
.map(|(val, var)| (val, self.table.var_cardinality(*var)))
.fold((0, 1), |(sum, cs), (val, c2)| (sum + val * cs, c2 * cs));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment