1 /* This file is part of libDAI - http://www.libdai.org/

2 *

3 * libDAI is licensed under the terms of the GNU General Public License version

4 * 2, or (at your option) any later version. libDAI is distributed without any

5 * warranty. See the file COPYING for more details.

6 *

7 * Copyright (C) 2008-2009 Joris Mooij [joris dot mooij at libdai dot org]

8 */

11 #include <dai/varset.h>

12 #include <dai/index.h>

13 #include <iostream>

22 // Define set X = {x0, x1}

26 cout << "X = " << X << endl << endl; // Note that the elements of X are ordered according to their labels

28 // Output some information about x0, x1 and X

31 cout << "VarSet " << X << " has " << X.nrStates() << " states (joint assignments of its variables)." << endl << endl;

37 // store s0 and s1 in a map "states"

42 // output states of x0, x1 and corresponding state of X

45 // calcState() is the inverse of calcLinearState()

47 }

52 // calculate states of x0 and x1 corresponding to state S of X

55 // output state of X and corresponding states of x0, x1

58 // calcLinearState() is the inverse of calcState()

60 }

65 // output state of X and corresponding states of x0, x1

67 }

70 }