bi-link.hpp /usr/include/gecode/int/view-val-graph.hh Gecode Gecode::Int Gecode::Int::ViewValGraph /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> * *Copyright: *ChristianSchulte,2003 * *Lastmodified: *$Date:2011-08-1721:42:11+0200(Wed,17Aug2011)$by$Author:schulte$ *$Revision:12306$ * *ThisfileispartofGecode,thegenericconstraint *developmentenvironment: *http://www.gecode.org * *Permissionisherebygranted,freeofcharge,toanypersonobtaining *acopyofthissoftwareandassociateddocumentationfiles(the *"Software"),todealintheSoftwarewithoutrestriction,including *withoutlimitationtherightstouse,copy,modify,merge,publish, *distribute,sublicense,and/orsellcopiesoftheSoftware,andto *permitpersonstowhomtheSoftwareisfurnishedtodoso,subjectto *thefollowingconditions: * *Theabovecopyrightnoticeandthispermissionnoticeshallbe *includedinallcopiesorsubstantialportionsoftheSoftware. * *THESOFTWAREISPROVIDED"ASIS",WITHOUTWARRANTYOFANYKIND, *EXPRESSORIMPLIED,INCLUDINGBUTNOTLIMITEDTOTHEWARRANTIESOF *MERCHANTABILITY,FITNESSFORAPARTICULARPURPOSEAND *NONINFRINGEMENT.INNOEVENTSHALLTHEAUTHORSORCOPYRIGHTHOLDERSBE *LIABLEFORANYCLAIM,DAMAGESOROTHERLIABILITY,WHETHERINANACTION *OFCONTRACT,TORTOROTHERWISE,ARISINGFROM,OUTOFORINCONNECTION *WITHTHESOFTWAREORTHEUSEOROTHERDEALINGSINTHESOFTWARE. * */ namespaceGecode{namespaceInt{namespaceViewValGraph{ forceinline BiLink::BiLink(void){ _prev=this;_next=this; } forceinlineBiLink* BiLink::prev(void)const{ return_prev; } forceinlineBiLink* BiLink::next(void)const{ return_next; } forceinlinevoid BiLink::prev(BiLink*l){ _prev=l; } forceinlinevoid BiLink::next(BiLink*l){ _next=l; } forceinlinevoid BiLink::add(BiLink*l){ l->_prev=this;l->_next=_next; _next->_prev=l;_next=l; } forceinlinevoid BiLink::unlink(void){ BiLink*p=_prev;BiLink*n=_next; p->_next=n;n->_prev=p; } forceinlinevoid BiLink::mark(void){ _next=NULL; } forceinlinebool BiLink::marked(void)const{ return_next==NULL; } forceinlinebool BiLink::empty(void)const{ return_prev==this; } }}} //STATISTICS:int-prop