Generated on Wed Jan 4 17:49:09 2006 for Gecode by doxygen 1.4.6

node.icc

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Christian Schulte <schulte@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Christian Schulte, 2003
00007  *
00008  *  Last modified:
00009  *     $Date: 2005-07-28 22:52:19 +0200 (Thu, 28 Jul 2005) $ by $Author: schulte $
00010  *     $Revision: 2072 $
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  See the file "LICENSE" for information on usage and
00017  *  redistribution of this file, and for a
00018  *     DISCLAIMER OF ALL WARRANTIES.
00019  *
00020  */
00021 
00022 namespace Gecode { namespace Search {
00023 
00024   /*
00025    * Node information
00026    *
00027    */
00028 
00029   forceinline
00030   CopyNode::CopyNode(Space*, Space* c, unsigned int alt)
00031     : _space(c), _alt(0), _last(alt-1) {}
00032 
00033   forceinline
00034   CopyNode::CopyNode(Space* s, unsigned int alt)
00035     : _space(s->clone()), _alt(1), _last(alt-1) {}
00036 
00037   forceinline Space*
00038   CopyNode::space(void) const {
00039     return _space;
00040   }
00041   forceinline void
00042   CopyNode::space(Space* s) {
00043     _space = s;
00044   }
00045 
00046   forceinline unsigned int
00047   CopyNode::alt(void) const {
00048     return _alt;
00049   }
00050   forceinline void
00051   CopyNode::alt(unsigned int a) {
00052     _alt = a;
00053   }
00054 
00055   forceinline bool
00056   CopyNode::rightmost(void) const {
00057     return _alt == _last;
00058   }
00059   forceinline void
00060   CopyNode::next(void) {
00061     _alt++;
00062   }
00063 
00064   forceinline void
00065   CopyNode::dispose(void) {
00066     delete space();
00067   }
00068 
00069 
00070   forceinline
00071   ReCoNode::ReCoNode(Space* s, Space* c, unsigned int alt)
00072     : CopyNode(s,c,alt), _desc(s->description()) {}
00073 
00074   forceinline BranchingDesc*
00075   ReCoNode::desc(void) const {
00076     return _desc;
00077   }
00078   forceinline void
00079   ReCoNode::desc(BranchingDesc* d) {
00080     _desc = d;
00081   }
00082 
00083   forceinline void
00084   ReCoNode::dispose(void) {
00085     delete space();
00086     delete desc();
00087   }
00088 
00089   forceinline unsigned int
00090   CopyNode::share(void) {
00091     unsigned int t = _last;
00092     _last--;
00093     return t;
00094   }
00095 
00096 }}
00097 
00098 // STATISTICS: search-any