5.286. scalar_product
| DESCRIPTION | LINKS |
- Origin
Arithmetic constraint.
- Constraint
- Synonyms
, , , .
- Arguments
- Restrictions
- Purpose
Constraint a linear term defined as the sum of products of coefficients and variables. More precisely, let denote the sum of the product between a coefficient and its variable of the different items of the collection. Enforce the following constraint to hold: .
- Example
-
The constraint holds since the condition is satisfied.
- Symmetries
Items of are permutable.
Attributes of are permutable w.r.t. permutation (permutation not necessarily applied to all items).
- Remark
The constraint is called in Gecode (http://www.gecode.org/). It is called in JaCoP (http://www.jacop.eu/). In the 2008 CSP solver competition the constraint was called and required to be fixed.
- Algorithm
Most filtering algorithms first merge multiple occurrences of identical variables in order to potentially make more deductions. When corresponds to the less than or equal to constraint, a filtering algorithm achieving bound-consistency for the constraint with large numbers of variables is described inΒ [HarveySchimpf02].
- Systems
equation in Choco, sumweight in JaCoP, scalar_product in SICStus.
- See also
specialisation: Β (arithmetic constraint where all coefficients are equal to 1).
- Keywords
characteristic of a constraint: sum.
constraint type: predefined constraint, arithmetic constraint.