Generated on Wed Nov 1 15:04:33 2006 for Gecode by doxygen 1.4.5

bilink.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: 2006-08-04 16:03:26 +0200 (Fri, 04 Aug 2006) $ by $Author: schulte $
00010  *     $Revision: 3512 $
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 Int { namespace Distinct {
00023 
00024   forceinline
00025   BiLink::BiLink(void) {
00026     _prev = this; _next = this;
00027   }
00028 
00029   forceinline BiLink*
00030   BiLink::prev(void) const {
00031     return _prev;
00032   }
00033   forceinline BiLink*
00034   BiLink::next(void) const {
00035     return _next;
00036   }
00037   forceinline void
00038   BiLink::prev(BiLink* l) {
00039     _prev = l;
00040   }
00041   forceinline void
00042   BiLink::next(BiLink* l) {
00043     _next = l;
00044   }
00045 
00046   forceinline void
00047   BiLink::add(BiLink* l) {
00048     l->_prev = this; l->_next = _next;
00049     _next->_prev = l; _next = l;
00050   }
00051   forceinline void
00052   BiLink::unlink(void) {
00053     BiLink* p = _prev; BiLink* n = _next;
00054     p->_next = n; n->_prev = p;
00055   }
00056 
00057   forceinline void
00058   BiLink::mark(void) {
00059     _next = NULL;
00060   }
00061   forceinline bool
00062   BiLink::marked(void) const {
00063     return _next == NULL;
00064   }
00065   forceinline bool
00066   BiLink::empty(void) const {
00067     return _prev == this;
00068   }
00069 
00070 }}}
00071 
00072 // STATISTICS: int-prop
00073