@@ -224,25 +224,23 @@ namespace Gecode {
224224 virtual void post (Home home, IntRelType irt, int c,
225225 BoolVar b, const IntPropLevels& ipls) const = 0;
226226 // / Destructor
227- virtual ~NonLinIntExpr (void ) {}
228- // / Return fresh variable if \a x is NULL, \a x otherwise
229- static IntVar result (Home home, IntVar* x) {
230- if (x==NULL )
231- return IntVar (home,Int::Limits::min,Int::Limits::max);
232- return *x;
233- }
234- // / Constrain \a x to be equal to \a y if \a x is not NULL
235- static IntVar result (Home home, IntVar* x, IntVar y) {
236- if (x!=NULL )
237- rel (home,*x,IRT_EQ,y);
238- return y;
239- }
227+ virtual ~NonLinIntExpr (void );
228+ // / Return fresh variable if \a x is null, \a x otherwise
229+ static IntVar result (Home home, IntVar* x);
230+ // / Constrain \a x to be equal to \a y if \a x is not null
231+ static IntVar result (Home home, IntVar* x, IntVar y);
240232 // / Memory management
241- void * operator new (size_t size) { return heap. ralloc (size); }
233+ void * operator new (size_t s);
242234 // / Memory management
243- void operator delete (void * p, size_t ) { heap. rfree (p); }
235+ void operator delete (void * p, size_t s);
244236 };
245237
238+ }
239+
240+ #include < gecode/minimodel/int-expr.hpp>
241+
242+ namespace Gecode {
243+
246244 // / Linear expressions over integer variables
247245 class LinIntExpr {
248246 friend class LinIntRel ;
@@ -323,7 +321,7 @@ namespace Gecode {
323321 // / Post propagator and return variable for value
324322 GECODE_MINIMODEL_EXPORT
325323 IntVar post (Home home, const IntPropLevels& ipls) const ;
326- // / Return non-linear expression inside, or NULL if not non-linear
324+ // / Return non-linear expression inside, or null if not non-linear
327325 GECODE_MINIMODEL_EXPORT
328326 NonLinIntExpr* nle (void ) const ;
329327 // / Destructor
@@ -791,6 +789,7 @@ namespace Gecode {
791789 // @}
792790
793791#ifdef GECODE_HAS_FLOAT_VARS
792+
794793 // / Base class for non-linear float expressions
795794 class NonLinFloatExpr {
796795 public:
@@ -802,25 +801,23 @@ namespace Gecode {
802801 virtual void post (Home home, FloatRelType frt, FloatVal c,
803802 BoolVar b) const = 0;
804803 // / Destructor
805- virtual ~NonLinFloatExpr (void ) {}
806- // / Return fresh variable if \a x is NULL, \a x otherwise
807- static FloatVar result (Home home, FloatVar* x) {
808- if (x == NULL )
809- return FloatVar (home,Float::Limits::min,Float::Limits::max);
810- return *x;
811- }
812- // / Constrain \a x to be equal to \a y if \a x is not NULL
813- static FloatVar result (Home home, FloatVar* x, FloatVar y) {
814- if (x!=NULL )
815- rel (home,*x,FRT_EQ,y);
816- return y;
817- }
804+ virtual ~NonLinFloatExpr (void );
805+ // / Return fresh variable if \a x is null, \a x otherwise
806+ static FloatVar result (Home home, FloatVar* x);
807+ // / Constrain \a x to be equal to \a y if \a x is not null
808+ static FloatVar result (Home home, FloatVar* x, FloatVar y);
818809 // / Memory management
819- void * operator new (size_t size) { return heap. ralloc (size); }
810+ void * operator new (size_t s);
820811 // / Memory management
821- void operator delete (void * p, size_t ) { heap. rfree (p); }
812+ void operator delete (void * p, size_t s);
822813 };
823814
815+ }
816+
817+ #include < gecode/minimodel/float-expr.hpp>
818+
819+ namespace Gecode {
820+
824821 // / %Float expressions
825822 class LinFloatExpr {
826823 friend class LinFloatRel ;
@@ -885,7 +882,7 @@ namespace Gecode {
885882 // / Post propagator and return variable for value
886883 GECODE_MINIMODEL_EXPORT
887884 FloatVar post (Home home) const ;
888- // / Return non-linear expression inside, or NULL if not non-linear
885+ // / Return non-linear expression inside, or null if not non-linear
889886 GECODE_MINIMODEL_EXPORT
890887 NonLinFloatExpr* nlfe (void ) const ;
891888 // / Destructor
0 commit comments