view.hpp iostream gecode/int/view/iter.hpp gecode/int/var/int.hpp gecode/int/var/bool.hpp gecode/int/view/int.hpp gecode/int/view/constint.hpp gecode/int/view/zero.hpp gecode/int/view/minus.hpp gecode/int/view/offset.hpp gecode/int/view/scale.hpp gecode/int/view/cached.hpp gecode/int/view/bool.hpp gecode/int/view/neg-bool.hpp gecode/int/view/print.hpp gecode/int/var/print.hpp gecode/int/view/rel-test.hpp gecode/int/view/bool-test.hpp /usr/include/gecode/int.hh Gecode::Int::ViewRanges Gecode::Int::ViewValues Gecode::Int::IntView Gecode::Int::MinusView Gecode::Int::OffsetView Gecode::Int::NoOffset Gecode::Int::Offset Gecode::Int::ScaleView Gecode::Int::ConstIntView Gecode::Int::ZeroIntView Gecode::Int::ViewDiffRanges Gecode::Int::CachedView Gecode::Int::ViewDiffRanges Gecode::Int::BoolView Gecode::Int::NegBoolView Gecode Gecode::Int /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> * *Copyright: *ChristianSchulte,2005 * *Lastmodified: *$Date:2013-02-1417:04:32+0100(Thu,14Feb2013)$by$Author:schulte$ *$Revision:13297$ * *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. * */ #include<iostream> namespaceGecode{namespaceInt{ template<classView> classViewRanges{ public: ViewRanges(void); ViewRanges(constView&x); voidinit(constView&x); booloperator ()(void)const; voidoperator ++(void); intmin(void)const; intmax(void)const; unsignedintwidth(void)const; }; template<classView> classViewValues:publicIter::Ranges::ToValues<ViewRanges<View>>{ public: ViewValues(void); ViewValues(constView&x); voidinit(constView&x); }; }} #include<gecode/int/view/iter.hpp> namespaceGecode{namespaceInt{ classIntView:publicVarImpView<IntVar>{ protected: usingVarImpView<IntVar>::x; public: IntView(void); IntView(constIntVar&y); IntView(IntVarImp*y); intmin(void)const; intmax(void)const; intmed(void)const; intval(void)const; unsignedintsize(void)const; unsignedintwidth(void)const; unsignedintregret_min(void)const; unsignedintregret_max(void)const; boolrange(void)const; boolin(intn)const; boolin(longlongintn)const; ModEventlq(Space&home,intn); ModEventlq(Space&home,longlongintn); ModEventle(Space&home,intn); ModEventle(Space&home,longlongintn); ModEventgq(Space&home,intn); ModEventgq(Space&home,longlongintn); ModEventgr(Space&home,intn); ModEventgr(Space&home,longlongintn); ModEventnq(Space&home,intn); ModEventnq(Space&home,longlongintn); ModEventeq(Space&home,intn); ModEventeq(Space&home,longlongintn); template<classI> ModEventnarrow_r(Space&home,I&i,booldepends=true); template<classI> ModEventinter_r(Space&home,I&i,booldepends=true); template<classI> ModEventminus_r(Space&home,I&i,booldepends=true); template<classI> ModEventnarrow_v(Space&home,I&i,booldepends=true); template<classI> ModEventinter_v(Space&home,I&i,booldepends=true); template<classI> ModEventminus_v(Space&home,I&i,booldepends=true); intmin(constDelta&d)const; intmax(constDelta&d)const; boolany(constDelta&d)const; staticModEventDeltamed(ModEventme); }; template<classChar,classTraits> std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>&os,constIntView&x); classMinusView:publicDerivedView<IntView>{ protected: usingDerivedView<IntView>::x; public: MinusView(void); explicitMinusView(constIntView&y); intmin(void)const; intmax(void)const; intmed(void)const; intval(void)const; unsignedintsize(void)const; unsignedintwidth(void)const; unsignedintregret_min(void)const; unsignedintregret_max(void)const; boolrange(void)const; boolin(intn)const; boolin(longlongintn)const; ModEventlq(Space&home,intn); ModEventlq(Space&home,longlongintn); ModEventle(Space&home,intn); ModEventle(Space&home,longlongintn); ModEventgq(Space&home,intn); ModEventgq(Space&home,longlongintn); ModEventgr(Space&home,intn); ModEventgr(Space&home,longlongintn); ModEventnq(Space&home,intn); ModEventnq(Space&home,longlongintn); ModEventeq(Space&home,intn); ModEventeq(Space&home,longlongintn); template<classI> ModEventnarrow_r(Space&home,I&i,booldepends=true); template<classI> ModEventinter_r(Space&home,I&i,booldepends=true); template<classI> ModEventminus_r(Space&home,I&i,booldepends=true); template<classI> ModEventnarrow_v(Space&home,I&i,booldepends=true); template<classI> ModEventinter_v(Space&home,I&i,booldepends=true); template<classI> ModEventminus_v(Space&home,I&i,booldepends=true); staticModEventDeltamed(ModEventme); intmin(constDelta&d)const; intmax(constDelta&d)const; boolany(constDelta&d)const; }; template<classChar,classTraits> std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>&os,constMinusView&x); classOffsetView:publicDerivedView<IntView>{ protected: intc; usingDerivedView<IntView>::x; public: OffsetView(void); OffsetView(constIntView&y,intc); intoffset(void)const; voidoffset(intn); intmin(void)const; intmax(void)const; intmed(void)const; intval(void)const; unsignedintsize(void)const; unsignedintwidth(void)const; unsignedintregret_min(void)const; unsignedintregret_max(void)const; boolrange(void)const; boolin(intn)const; boolin(longlongintn)const; ModEventlq(Space&home,intn); ModEventlq(Space&home,longlongintn); ModEventle(Space&home,intn); ModEventle(Space&home,longlongintn); ModEventgq(Space&home,intn); ModEventgq(Space&home,longlongintn); ModEventgr(Space&home,intn); ModEventgr(Space&home,longlongintn); ModEventnq(Space&home,intn); ModEventnq(Space&home,longlongintn); ModEventeq(Space&home,intn); ModEventeq(Space&home,longlongintn); template<classI> ModEventnarrow_r(Space&home,I&i,booldepends=true); template<classI> ModEventinter_r(Space&home,I&i,booldepends=true); template<classI> ModEventminus_r(Space&home,I&i,booldepends=true); template<classI> ModEventnarrow_v(Space&home,I&i,booldepends=true); template<classI> ModEventinter_v(Space&home,I&i,booldepends=true); template<classI> ModEventminus_v(Space&home,I&i,booldepends=true); staticModEventDeltamed(ModEventme); intmin(constDelta&d)const; intmax(constDelta&d)const; boolany(constDelta&d)const; voidupdate(Space&home,boolshare,OffsetView&y); }; template<classChar,classTraits> std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>&os,constOffsetView&x); boolsame(constOffsetView&x,constOffsetView&y); boolbefore(constOffsetView&x,constOffsetView&y); template<classView> classNoOffset{ public: typedefViewViewType; View&operator ()(View&x); voidupdate(constNoOffset&); intoffset(void)const; }; template<classView> forceinlineView& NoOffset<View>::operator ()(View&x){ returnx; } template<classView> forceinlinevoid NoOffset<View>::update(constNoOffset&){} template<classView> forceinlineint NoOffset<View>::offset(void)const{ return0; } classOffset{ public: typedefOffsetViewViewType; intc; Offset(intoff=0); OffsetViewoperator()(IntView&x); voidupdate(constOffset&o); intoffset(void)const; }; forceinline Offset::Offset(intoff):c(off){} forceinlinevoid Offset::update(constOffset&o){c=o.c;} forceinlineint Offset::offset(void)const{returnc;} forceinlineOffsetView Offset::operator ()(IntView&x){ returnOffsetView(x,c); } template<classVal,classUnsVal> classScaleView:publicDerivedView<IntView>{ protected: usingDerivedView<IntView>::x; inta; public: ScaleView(void); ScaleView(intb,constIntView&y); intscale(void)const; Valmin(void)const; Valmax(void)const; Valmed(void)const; Valval(void)const; UnsValsize(void)const; UnsValwidth(void)const; UnsValregret_min(void)const; UnsValregret_max(void)const; boolrange(void)const; boolin(Valn)const; ModEventlq(Space&home,Valn); ModEventle(Space&home,Valn); ModEventgq(Space&home,Valn); ModEventgr(Space&home,Valn); ModEventnq(Space&home,Valn); ModEventeq(Space&home,Valn); staticModEventDeltamed(ModEventme); Valmin(constDelta&d)const; Valmax(constDelta&d)const; boolany(constDelta&d)const; voidupdate(Space&home,boolshare,ScaleView<Val,UnsVal>&y); }; typedefScaleView<int,unsigned int>IntScaleView; typedefScaleView<long long int,unsigned long long int>LLongScaleView; template<classChar,classTraits> std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>&os,constIntScaleView&x); template<classChar,classTraits> std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>&os,constLLongScaleView&x); template<classVal,classUnsVal> boolsame(constScaleView<Val,UnsVal>&x,constScaleView<Val,UnsVal>&y); template<classVal,classUnsVal> boolbefore(constScaleView<Val,UnsVal>&x,constScaleView<Val,UnsVal>&y); classConstIntView:publicConstView<IntView>{ protected: intx; public: ConstIntView(void); ConstIntView(intn); intmin(void)const; intmax(void)const; intmed(void)const; intval(void)const; unsignedintsize(void)const; unsignedintwidth(void)const; unsignedintregret_min(void)const; unsignedintregret_max(void)const; boolrange(void)const; boolin(intn)const; boolin(longlongintn)const; ModEventlq(Space&home,intn); ModEventlq(Space&home,longlongintn); ModEventle(Space&home,intn); ModEventle(Space&home,longlongintn); ModEventgq(Space&home,intn); ModEventgq(Space&home,longlongintn); ModEventgr(Space&home,intn); ModEventgr(Space&home,longlongintn); ModEventnq(Space&home,intn); ModEventnq(Space&home,longlongintn); ModEventeq(Space&home,intn); ModEventeq(Space&home,longlongintn); template<classI> ModEventnarrow_r(Space&home,I&i,booldepends=true); template<classI> ModEventinter_r(Space&home,I&i,booldepends=true); template<classI> ModEventminus_r(Space&home,I&i,booldepends=true); template<classI> ModEventnarrow_v(Space&home,I&i,booldepends=true); template<classI> ModEventinter_v(Space&home,I&i,booldepends=true); template<classI> ModEventminus_v(Space&home,I&i,booldepends=true); intmin(constDelta&d)const; intmax(constDelta&d)const; boolany(constDelta&d)const; voidupdate(Space&home,boolshare,ConstIntView&y); }; template<classChar,classTraits> std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>&os,constConstIntView&x); boolsame(constConstIntView&x,constConstIntView&y); boolbefore(constConstIntView&x,constConstIntView&y); classZeroIntView:publicConstView<IntView>{ public: ZeroIntView(void); intmin(void)const; intmax(void)const; intmed(void)const; intval(void)const; unsignedintsize(void)const; unsignedintwidth(void)const; unsignedintregret_min(void)const; unsignedintregret_max(void)const; boolrange(void)const; boolin(intn)const; boolin(longlongintn)const; ModEventlq(Space&home,intn); ModEventlq(Space&home,longlongintn); ModEventle(Space&home,intn); ModEventle(Space&home,longlongintn); ModEventgq(Space&home,intn); ModEventgq(Space&home,longlongintn); ModEventgr(Space&home,intn); ModEventgr(Space&home,longlongintn); ModEventnq(Space&home,intn); ModEventnq(Space&home,longlongintn); ModEventeq(Space&home,intn); ModEventeq(Space&home,longlongintn); template<classI> ModEventnarrow_r(Space&home,I&i,booldepends=true); template<classI> ModEventinter_r(Space&home,I&i,booldepends=true); template<classI> ModEventminus_r(Space&home,I&i,booldepends=true); template<classI> ModEventnarrow_v(Space&home,I&i,booldepends=true); template<classI> ModEventinter_v(Space&home,I&i,booldepends=true); template<classI> ModEventminus_v(Space&home,I&i,booldepends=true); intmin(constDelta&d)const; intmax(constDelta&d)const; boolany(constDelta&d)const; }; template<classChar,classTraits> std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>&os,constZeroIntView&x); boolsame(constZeroIntView&x,constZeroIntView&y); template<classView>classViewDiffRanges; template<classView> classCachedView:publicDerivedView<View>{ friendclassViewDiffRanges<View>; protected: usingDerivedView<View>::x; RangeList*_firstRange; RangeList*_lastRange; unsignedint_size; public: CachedView(void); explicitCachedView(constView&y); intmin(void)const; intmax(void)const; intmed(void)const; intval(void)const; unsignedintsize(void)const; unsignedintwidth(void)const; unsignedintregret_min(void)const; unsignedintregret_max(void)const; boolrange(void)const; boolin(intn)const; boolin(longlongintn)const; ModEventlq(Space&home,intn); ModEventlq(Space&home,longlongintn); ModEventle(Space&home,intn); ModEventle(Space&home,longlongintn); ModEventgq(Space&home,intn); ModEventgq(Space&home,longlongintn); ModEventgr(Space&home,intn); ModEventgr(Space&home,longlongintn); ModEventnq(Space&home,intn); ModEventnq(Space&home,longlongintn); ModEventeq(Space&home,intn); ModEventeq(Space&home,longlongintn); template<classI> ModEventnarrow_r(Space&home,I&i,booldepends=true); template<classI> ModEventinter_r(Space&home,I&i,booldepends=true); template<classI> ModEventminus_r(Space&home,I&i,booldepends=true); template<classI> ModEventnarrow_v(Space&home,I&i,booldepends=true); template<classI> ModEventinter_v(Space&home,I&i,booldepends=true); template<classI> ModEventminus_v(Space&home,I&i,booldepends=true); staticModEventDeltamed(ModEventme); intmin(constDelta&d)const; intmax(constDelta&d)const; boolany(constDelta&d)const; voidinitCache(Space&home,constIntSet&s); voidcache(Space&home); boolmodified(void)const; voidupdate(Space&home,boolshare,CachedView<View>&y); }; template<classChar,classTraits,classView> std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>&os,constCachedView<View>&x); template<classView> boolsame(constCachedView<View>&x,constCachedView<View>&y); template<classView> boolbefore(constCachedView<View>&x,constCachedView<View>&y); template<classView> classViewDiffRanges :publicIter::Ranges::Diff<Iter::Ranges::RangeList,ViewRanges<View>>{ typedefIter::Ranges::Diff<Iter::Ranges::RangeList,ViewRanges<View>> Super; protected: Iter::Ranges::RangeListcr; ViewRanges<View>dr; public: ViewDiffRanges(void); ViewDiffRanges(constCachedView<View>&x); voidinit(constCachedView<View>&x); }; classBoolView:publicVarImpView<BoolVar>{ protected: usingVarImpView<BoolVar>::x; public: BoolView(void); BoolView(constBoolVar&y); BoolView(BoolVarImp*y); staticconstintBITS=BoolVarImp::BITS; staticconstBoolStatusZERO=BoolVarImp::ZERO; staticconstBoolStatusONE=BoolVarImp::ONE; staticconstBoolStatusNONE=BoolVarImp::NONE; BoolStatusstatus(void)const; intmin(void)const; intmax(void)const; intmed(void)const; intval(void)const; unsignedintsize(void)const; unsignedintwidth(void)const; unsignedintregret_min(void)const; unsignedintregret_max(void)const; boolrange(void)const; boolin(intn)const; boolin(longlongintn)const; boolzero(void)const; boolone(void)const; boolnone(void)const; ModEventone(Space&home); ModEventzero(Space&home); ModEventone_none(Space&home); ModEventzero_none(Space&home); ModEventlq(Space&home,intn); ModEventlq(Space&home,longlongintn); ModEventle(Space&home,intn); ModEventle(Space&home,longlongintn); ModEventgq(Space&home,intn); ModEventgq(Space&home,longlongintn); ModEventgr(Space&home,intn); ModEventgr(Space&home,longlongintn); ModEventnq(Space&home,intn); ModEventnq(Space&home,longlongintn); ModEventeq(Space&home,intn); ModEventeq(Space&home,longlongintn); template<classI> ModEventnarrow_r(Space&home,I&i,booldepends=true); template<classI> ModEventinter_r(Space&home,I&i,booldepends=true); template<classI> ModEventminus_r(Space&home,I&i,booldepends=true); template<classI> ModEventnarrow_v(Space&home,I&i,booldepends=true); template<classI> ModEventinter_v(Space&home,I&i,booldepends=true); template<classI> ModEventminus_v(Space&home,I&i,booldepends=true); intmin(constDelta&d)const; intmax(constDelta&d)const; boolany(constDelta&d)const; staticboolzero(constDelta&d); staticboolone(constDelta&d); staticModEventDeltamed(ModEventme); }; template<classChar,classTraits> std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>&os,constBoolView&x); classNegBoolView:publicDerivedView<BoolView>{ protected: usingDerivedView<BoolView>::x; public: NegBoolView(void); explicitNegBoolView(constBoolView&y); staticconstintBITS=BoolView::BITS; staticconstBoolStatusZERO=BoolView::ONE; staticconstBoolStatusONE=BoolView::ZERO; staticconstBoolStatusNONE=BoolView::NONE; BoolStatusstatus(void)const; boolzero(void)const; boolone(void)const; boolnone(void)const; ModEventone(Space&home); ModEventzero(Space&home); ModEventone_none(Space&home); ModEventzero_none(Space&home); intmin(void)const; intmax(void)const; intval(void)const; intmin(constDelta&d)const; intmax(constDelta&d)const; boolany(constDelta&d)const; staticboolzero(constDelta&d); staticboolone(constDelta&d); }; template<classChar,classTraits> std::basic_ostream<Char,Traits>& operator<<(std::basic_ostream<Char,Traits>&os,constNegBoolView&x); }} #include<gecode/int/var/int.hpp> #include<gecode/int/var/bool.hpp> #include<gecode/int/view/int.hpp> #include<gecode/int/view/constint.hpp> #include<gecode/int/view/zero.hpp> #include<gecode/int/view/minus.hpp> #include<gecode/int/view/offset.hpp> #include<gecode/int/view/scale.hpp> #include<gecode/int/view/cached.hpp> #include<gecode/int/view/bool.hpp> #include<gecode/int/view/neg-bool.hpp> #include<gecode/int/view/print.hpp> #include<gecode/int/var/print.hpp> namespaceGecode{namespaceInt{ enumRelTest{ RT_FALSE=0, RT_MAYBE=1, RT_TRUE=2 }; template<classView>RelTestrtest_eq_bnd(Viewx,Viewy); template<classView>RelTestrtest_eq_dom(Viewx,Viewy); template<classView>RelTestrtest_eq_bnd(Viewx,intn); template<classView>RelTestrtest_eq_dom(Viewx,intn); template<classView>RelTestrtest_nq_bnd(Viewx,Viewy); template<classView>RelTestrtest_nq_dom(Viewx,Viewy); template<classView>RelTestrtest_nq_bnd(Viewx,intn); template<classView>RelTestrtest_nq_dom(Viewx,intn); template<classView>RelTestrtest_lq(Viewx,Viewy); template<classView>RelTestrtest_lq(Viewx,intn); template<classView>RelTestrtest_le(Viewx,Viewy); template<classView>RelTestrtest_le(Viewx,intn); template<classView>RelTestrtest_gq(Viewx,Viewy); template<classView>RelTestrtest_gq(Viewx,intn); template<classView>RelTestrtest_gr(Viewx,Viewy); template<classView>RelTestrtest_gr(Viewx,intn); enumBoolTest{ BT_NONE, BT_SAME, BT_COMP }; BoolTestbool_test(constBoolView&b0,constBoolView&b1); BoolTestbool_test(constBoolView&b0,constNegBoolView&b1); BoolTestbool_test(constNegBoolView&b0,constBoolView&b1); BoolTestbool_test(constNegBoolView&b0,constNegBoolView&b1); }} #include<gecode/int/view/rel-test.hpp> #include<gecode/int/view/bool-test.hpp> //STATISTICS:int-var