Back to index

solutions.cpp File Reference
#include "tmfs.hpp"

Go to the source code of this file.


collection as_collection (solutions sols, string key)
collection as_collection (solutions sols, property p)
solutions combine (solutions sols1, solutions sols2)

Function Documentation

Definition at line 19 of file solutions.cpp.

  collection c;
  for (int i=0; i<N(sols); i++)
    if (sols[i]->contains (key))
      c (sols[i][key])= 1;
  return c;

Here is the call graph for this function:

Definition at line 28 of file solutions.cpp.

  int i, n= N(p);
  for (i=0; i<n; i++)
    if (is_unknown (p[i])) return as_collection (sols, p[i]);
  return collection ();

Here is the call graph for this function:

solutions combine ( solutions  sols1,
solutions  sols2 

Definition at line 40 of file solutions.cpp.

  solutions sols;
  int i1, i2, n1= N(sols1), n2= N(sols2);
  for (i1=0; i1<n1; i1++)
    for (i2=0; i2<n2; i2++) {
      bool ok= true;
      solution sol= copy (sols1[i1]);
      iterator<string> it= iterate (sols2[i2]);
      while (it->busy ()) {
       string s= it->next ();
       if (sol->contains (s)) {
         ok= (sol[s] == sols2[i2][s]);
         if (!ok) break;
       else sol(s)= sols2[i2][s];
      if (ok) sols << sol;
  return sols;

Here is the call graph for this function:

Here is the caller graph for this function: