arithmetic.hh gecode/int.hh gecode/float.hh gecode/float/rel.hh gecode/float/arithmetic/sqr-sqrt-abs.hpp gecode/float/arithmetic/pow-nroot.hpp gecode/float/arithmetic/mult.hpp gecode/float/arithmetic/div.hpp gecode/float/arithmetic/min-max-channel.hpp Gecode::Float::Arithmetic::SqrPlus Gecode::Float::Arithmetic::Sqr Gecode::Float::Arithmetic::Sqrt Gecode::Float::Arithmetic::Abs Gecode::Float::Arithmetic::Pow Gecode::Float::Arithmetic::NthRoot Gecode::Float::Arithmetic::MultZeroOne Gecode::Float::Arithmetic::MultPlus Gecode::Float::Arithmetic::Mult Gecode::Float::Arithmetic::Div Gecode::Float::Arithmetic::Min Gecode::Float::Arithmetic::Max Gecode::Float::Arithmetic::NaryMax Gecode::Float::Arithmetic::Channel Gecode::Float::Arithmetic Gecode Gecode::Float /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> *GuidoTack<tack@gecode.org> *VincentBarichard<Vincent.Barichard@univ-angers.fr> * *Copyright: *ChristianSchulte,2002 *GuidoTack,2004 *VincentBarichard,2012 * *Lastmodified: *$Date:2013-02-1416:29:11+0100(Thu,14Feb2013)$by$Author:schulte$ *$Revision:13292$ * *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. * */ #ifndef__GECODE_FLOAT_ARITHMETIC_HH__ #define__GECODE_FLOAT_ARITHMETIC_HH__ #include<gecode/int.hh> #include<gecode/float.hh> #include<gecode/float/rel.hh> namespaceGecode{namespaceFloat{namespaceArithmetic{ template<classVA,classVB> classSqrPlus:publicMixBinaryPropagator<VA,PC_FLOAT_BND,VB,PC_FLOAT_BND>{ protected: usingMixBinaryPropagator<VA,PC_FLOAT_BND,VB,PC_FLOAT_BND>::x0; usingMixBinaryPropagator<VA,PC_FLOAT_BND,VB,PC_FLOAT_BND>::x1; SqrPlus(Homehome,VAx0,VBx1); SqrPlus(Space&home,boolshare,SqrPlus<VA,VB>&p); public: staticExecStatuspost(Homehome,VAx0,VBx1); virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); }; template<classView> classSqr:publicBinaryPropagator<View,PC_FLOAT_BND>{ protected: usingBinaryPropagator<View,PC_FLOAT_BND>::x0; usingBinaryPropagator<View,PC_FLOAT_BND>::x1; Sqr(Space&home,boolshare,Sqr&p); Sqr(Homehome,Viewx0,Viewx1); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,Viewx0,Viewx1); }; template<classA,classB> classSqrt:publicMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>{ protected: usingMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0; usingMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1; Sqrt(Space&home,boolshare,Sqrt&p); Sqrt(Homehome,Ax0,Bx1); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,Ax0,Bx1); }; template<classA,classB> classAbs:publicMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>{ protected: usingMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0; usingMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1; Abs(Space&home,boolshare,Abs&p); Abs(Homehome,Ax0,Bx1); public: Abs(Space&home,boolshare,Propagator&p,Ax0,Bx1); virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,Ax0,Bx1); }; template<classA,classB> classPow:publicMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>{ protected: usingMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0; usingMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1; intm_n; Pow(Space&home,boolshare,Pow&p); Pow(Homehome,Ax0,Bx1,intn); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,Ax0,Bx1,intn); }; template<classA,classB> classNthRoot:publicMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>{ protected: usingMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x0; usingMixBinaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND>::x1; intm_n; NthRoot(Space&home,boolshare,NthRoot&p); NthRoot(Homehome,Ax0,Bx1,intn); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,Ax0,Bx1,intn); }; template<classView> classMultZeroOne:publicBinaryPropagator<View,PC_FLOAT_BND>{ protected: usingBinaryPropagator<View,PC_FLOAT_BND>::x0; usingBinaryPropagator<View,PC_FLOAT_BND>::x1; MultZeroOne(Space&home,boolshare,MultZeroOne<View>&p); MultZeroOne(Homehome,Viewx0,Viewx1); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,Viewx0,Viewx1); }; template<classVA,classVB,classVC> classMultPlus: publicMixTernaryPropagator<VA,PC_FLOAT_BND,VB,PC_FLOAT_BND,VC,PC_FLOAT_BND>{ protected: usingMixTernaryPropagator<VA,PC_FLOAT_BND,VB,PC_FLOAT_BND,VC,PC_FLOAT_BND>::x0; usingMixTernaryPropagator<VA,PC_FLOAT_BND,VB,PC_FLOAT_BND,VC,PC_FLOAT_BND>::x1; usingMixTernaryPropagator<VA,PC_FLOAT_BND,VB,PC_FLOAT_BND,VC,PC_FLOAT_BND>::x2; public: MultPlus(Homehome,VAx0,VBx1,VCx2); MultPlus(Space&home,boolshare,MultPlus<VA,VB,VC>&p); staticExecStatuspost(Homehome,VAx0,VBx1,VCx2); virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); }; template<classView> classMult:publicTernaryPropagator<View,PC_FLOAT_BND>{ protected: usingTernaryPropagator<View,PC_FLOAT_BND>::x0; usingTernaryPropagator<View,PC_FLOAT_BND>::x1; usingTernaryPropagator<View,PC_FLOAT_BND>::x2; Mult(Space&home,boolshare,Mult<View>&p); public: Mult(Homehome,Viewx0,Viewx1,Viewx2); staticExecStatuspost(Homehome,Viewx0,Viewx1,Viewx2); virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); }; /* template<classA,classB,classC> classMult:publicMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>{ protected: usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x0; usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x1; usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x2; Mult(Space&home,boolshare,Mult&p); Mult(Homehome,Ax0,Bx1,Cx2); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,Ax0,Bx1,Cx2); }; */ template<classA,classB,classC> classDiv:publicMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>{ protected: usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x0; usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x1; usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x2; Div(Space&home,boolshare,Div&p); Div(Homehome,Ax0,Bx1,Cx2); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,Ax0,Bx1,Cx2); }; template<classA,classB,classC> classMin:publicMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>{ protected: usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x0; usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x1; usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x2; Min(Space&home,boolshare,Min&p); Min(Homehome,Ax0,Bx1,Cx2); public: Min(Space&home,boolshare,Propagator&p,Ax0,Bx1,Cx2); virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,Ax0,Bx1,Cx2); }; template<classA,classB,classC> classMax:publicMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>{ protected: usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x0; usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x1; usingMixTernaryPropagator<A,PC_FLOAT_BND,B,PC_FLOAT_BND,C,PC_FLOAT_BND>::x2; Max(Space&home,boolshare,Max&p); Max(Homehome,Ax0,Bx1,Cx2); public: Max(Space&home,boolshare,Propagator&p,Ax0,Bx1,Cx2); virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,Ax0,Bx1,Cx2); }; template<classView> classNaryMax:publicNaryOnePropagator<View,PC_FLOAT_BND>{ protected: usingNaryOnePropagator<View,PC_FLOAT_BND>::x; usingNaryOnePropagator<View,PC_FLOAT_BND>::y; NaryMax(Space&home,boolshare,NaryMax&p); NaryMax(Homehome,ViewArray<View>&x,Viewy); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,ViewArray<View>&x,Viewy); }; template<classA,classB> classChannel: publicMixBinaryPropagator<A,PC_FLOAT_BND,B,Gecode::Int::PC_INT_BND>{ protected: usingMixBinaryPropagator<A,PC_FLOAT_BND,B,Gecode::Int::PC_INT_BND>::x0; usingMixBinaryPropagator<A,PC_FLOAT_BND,B,Gecode::Int::PC_INT_BND>::x1; Channel(Space&home,boolshare,Channel&p); Channel(Homehome,Ax0,Bx1); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,Ax0,Bx1); }; }}} #include<gecode/float/arithmetic/sqr-sqrt-abs.hpp> #include<gecode/float/arithmetic/pow-nroot.hpp> #include<gecode/float/arithmetic/mult.hpp> #include<gecode/float/arithmetic/div.hpp> #include<gecode/float/arithmetic/min-max-channel.hpp> #endif //STATISTICS:float-prop