Re: mindomain

From: Warwick Harvey <wh_at_icparc.ic.ac.uk>
Date: Tue 15 Oct 2002 05:51:21 PM GMT
Message-ID: <20021015185120.E9607@tempest.icparc.ic.ac.uk>
[Apologies to Karen for receiving multiple copies of this; I accidentally
replied directly to her rather than to the whole list.]

Hi Karen,

On Fri, Oct 11, 2002 at 06:13:24PM +0100, Karen E Petrie wrote:
> Dear all,
>
> The mindomain(Var, Min) predicate in the fd library, sets a variable Min
> to the minimum value in the domain of Var. Is there an equivalent for the
> ic library, as I can't find one in the documentation.
>
> I have tried using get_ic_bounds(Var, Lo, Hi), but it returns a number in
> floating point format, whereas I need an integer!

So convert it to an integer!  :)  You might find fix/2 useful for this.
 
In the current unreleased version of ECLiPSe (5.5), get_ic_bounds/3 returns
integral bounds if Var is integral (unless the bounds are infinite, in which
case it returns the relevant float infinity) so you would not have this
problem.

5.5 also defines get_ic_min/2 and get_ic_max/2 (convenience predicates
defined in terms of get_ic_bounds/3 if you just want one of the bounds) as
well as get_ic_float_bounds/3 (always returns float bounds, like the old
get_ic_bounds/3 in 5.4).  But these predicates are in something of a state
of flux; we are considering dropping the "ic" from their names, and changing
some aspects of their semantics (e.g. failing if the variable is not an IC
variable, rather than making it an IC variable) so you may wish to avoid
them for now.

Cheers,
Warwick
Received on Tue Oct 15 18:53:23 2002

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:17 PM GMT GMT