Generated on Mon Aug 25 11:35:33 2008 for Gecode by doxygen 1.5.6

bddmanager.cc

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Patrick Pekczynski <pekczynski@ps.uni-sb.de>
00004  *     Guido Tack <tack@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Patrick Pekczynski, 2006
00008  *     Guido Tack, 2007
00009  *
00010  *  Last modified:
00011  *     $Date: 2007-09-18 13:44:40 +0200 (Tue, 18 Sep 2007) $ by $Author: schulte $
00012  *     $Revision: 5043 $
00013  *
00014  *  This file is part of Gecode, the generic constraint
00015  *  development environment:
00016  *     http://www.gecode.org
00017  *
00018  *  Permission is hereby granted, free of charge, to any person obtaining
00019  *  a copy of this software and associated documentation files (the
00020  *  "Software"), to deal in the Software without restriction, including
00021  *  without limitation the rights to use, copy, modify, merge, publish,
00022  *  distribute, sublicense, and/or sell copies of the Software, and to
00023  *  permit persons to whom the Software is furnished to do so, subject to
00024  *  the following conditions:
00025  *
00026  *  The above copyright notice and this permission notice shall be
00027  *  included in all copies or substantial portions of the Software.
00028  *
00029  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00030  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00031  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00032  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00033  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00034  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00035  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00036  *
00037  */
00038 
00039 #include "gecode/cpltset.hh"
00040 
00041 namespace Gecode { namespace CpltSet {
00042   
00043   unsigned int
00044   BddMgr::numberOfPaths(bdd& b){
00045     if (leaf(b)) { return 1; }
00046     bdd t = iftrue(b);
00047     bdd f = iffalse(b);
00048     return numberOfPaths(t) + numberOfPaths(f);
00049   }
00050 
00051   BddMgr::~BddMgr(void) {
00052     dispose();
00053   }
00054 
00055   BddMgr manager;
00056   
00057 }}
00058 
00059 // STATISTICS: cpltset-var