[ library(ic) | Reference Manual | Alphabetic Index ]

squash(+Vars, ++Precision, ++LinLog)

Refine the intervals of Vars by the squashing algorithm.
Vars
Collection (a la collection_to_list/2) of variables
Precision
Minimum required precision (float)
LinLog
Domain splitting method (lin or log)

Description

Use the squash algorithm on Vars. This is a deterministic reduction of the intervals of variables, done by searching for domain restrictions which cause failure, and then reducing the domain to the complement of that which caused the failure. This algorithm is appropriate when the problem has continuous solution intervals (where locate would return many adjacent solutions).

Precision is the minimum required precision, i.e. the maximum size of the resulting intervals (in either absolute or relative terms). Note that the arc-propagation threshold (set by set_threshold/1,2), needs to be one or several orders of magnitude smaller than Precision, otherwise the solver may not be able to achieve the required precision.

The LinLog parameter guides the way domains are split. If it is set to lin then the split is linear (i.e. the arithmetic mean of the bounds is used). If it is set to log, the split is logarithmic (i.e. the geometric mean of the bounds is used). Note that if log is used, there will be roughly the same number of representable floating point numbers on either side of the split, due to the logarithmic distribution of these numbers.

If the intervals of variables at the start of the squashing algorithm are known not to span several orders of magnitude, the somewhat cheaper linear splitting may be used. In general, log splitting is recommended.

See Also

locate / 2, locate / 3, locate / 4, set_threshold / 1, get_threshold / 1, eclipse_6 : collection_to_list / 2, lists : collection_to_list / 2