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

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 Int { namespace Distinct {
00023 
00024   /*
00025    * Nodes
00026    *
00027    */
00028 
00029   template <class View>
00030   forceinline
00031   Node<View>::Node(void)
00032     : pre(0), low(0), comp(0) {}
00033   template <class View>
00034   forceinline Edge<View>*
00035   Node<View>::edge_fst(void) const {
00036     return static_cast<Edge<View>*>(BiLink::next());
00037   }
00038   template <class View>
00039   forceinline Edge<View>*
00040   Node<View>::edge_lst(void) const {
00041     return static_cast<Edge<View>*>(static_cast<BiLink*>(const_cast<Node<View>*>(this)));
00042   }
00043   template <class View>
00044   forceinline void*
00045   Node<View>::operator new(size_t, void* p) {
00046     return p;
00047   }
00048 
00049 
00050 
00051   /*
00052    * Value nodes
00053    *
00054    */
00055 
00056 
00057   template <class View>
00058   forceinline
00059   ValNode<View>::ValNode(int v)
00060     : _val(v), _matching(NULL) {}
00061   template <class View>
00062   forceinline int
00063   ValNode<View>::val(void) const {
00064     return _val;
00065   }
00066   template <class View>
00067   forceinline void
00068   ValNode<View>::matching(Edge<View>* e) {
00069     _matching = e;
00070   }
00071   template <class View>
00072   forceinline Edge<View>*
00073   ValNode<View>::matching(void) const {
00074     return _matching;
00075   }
00076 
00077 
00078 
00079   /*
00080    * View nodes
00081    *
00082    */
00083 
00084   template <class View>
00085   forceinline
00086   ViewNode<View>::ViewNode(View x)
00087     : _view(x) {}
00088   template <class View>
00089   forceinline Edge<View>*
00090   ViewNode<View>::val_edges(void) const {
00091     return _val_edges;
00092   }
00093   template <class View>
00094   forceinline Edge<View>**
00095   ViewNode<View>::val_edges_ref(void) {
00096     return &_val_edges;
00097   }
00098   template <class View>
00099   forceinline View
00100   ViewNode<View>::view(void) const {
00101     return _view;
00102   }
00103 
00104 }}}
00105 
00106 // STATISTICS: int-prop
00107