Class IntLinCombFactory
- java.lang.Object
-
- org.chocosolver.solver.constraints.nary.sum.IntLinCombFactory
-
public class IntLinCombFactory extends Object
A factory to reduce and detect specific cases related to integer linear combinations.It aims at first reducing the input (merge coefficients) and then select the right implementation (for performance concerns).
2015.09.24 (cprudhom)
dealing with tuples is only relevant for scalar in some very specific cases (eg. mzn 2014, elitserien+handball+handball14.fzn)
Created by cprudhom on 13/11/14. Project: choco.
- Author:
- Charles Prud'homme
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Constraint
reduce(IntVar[] VARS, int[] COEFFS, Operator OPERATOR, IntVar SCALAR, int minCardForDecomposition)
Reduce coefficients, and variables if required, when dealing with a scalar productstatic Constraint
reduce(IntVar[] VARS, Operator OPERATOR, IntVar SUM, int minCardForDecomposition)
Reduce coefficients, and variables if required, when dealing with a sum (all coefficients are implicitly equal to 1)static Constraint
selectScalar(IntVar[] VARS, int[] COEFFS, Operator OPERATOR, int RESULT)
Select the most relevant ScalarProduct constraint to returnstatic Constraint
selectSum(IntVar[] VARS, int[] COEFFS, Operator OPERATOR, int RESULT, int nbools)
Select the most relevant Sum constraint to return
-
-
-
Method Detail
-
reduce
public static Constraint reduce(IntVar[] VARS, Operator OPERATOR, IntVar SUM, int minCardForDecomposition)
Reduce coefficients, and variables if required, when dealing with a sum (all coefficients are implicitly equal to 1)- Parameters:
VARS
- array of integer variablesOPERATOR
- an operator among "=", "!=", ">", "<", ">=",>" and "<="SUM
- the resulting variable- Returns:
- a constraint to post or reify
-
reduce
public static Constraint reduce(IntVar[] VARS, int[] COEFFS, Operator OPERATOR, IntVar SCALAR, int minCardForDecomposition)
Reduce coefficients, and variables if required, when dealing with a scalar product- Parameters:
VARS
- array of integer variablesCOEFFS
- array of integersOPERATOR
- an operator among "=", "!=", ">", "<", ">=",>" and "<="SCALAR
- the resulting variable- Returns:
- a constraint to post or reify
-
selectSum
public static Constraint selectSum(IntVar[] VARS, int[] COEFFS, Operator OPERATOR, int RESULT, int nbools)
Select the most relevant Sum constraint to return- Parameters:
VARS
- array of integer variablesCOEFFS
- array of integersOPERATOR
- on operatorRESULT
- an integernbools
- number of boolean variables- Returns:
- a constraint
-
selectScalar
public static Constraint selectScalar(IntVar[] VARS, int[] COEFFS, Operator OPERATOR, int RESULT)
Select the most relevant ScalarProduct constraint to return- Parameters:
VARS
- array of integer variablesCOEFFS
- array of integersOPERATOR
- on operatorRESULT
- an integer- Returns:
- a constraint
-
-