public class IntLinCombFactory extends Object
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.
Modifier and Type | Method and 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 product
|
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)
|
static Constraint |
selectScalar(IntVar[] VARS,
int[] COEFFS,
Operator OPERATOR,
int RESULT)
Select the most relevant ScalarProduct constraint to return
|
static Constraint |
selectSum(IntVar[] VARS,
int[] COEFFS,
Operator OPERATOR,
int RESULT,
int nbools)
Select the most relevant Sum constraint to return
|
public static Constraint reduce(IntVar[] VARS, Operator OPERATOR, IntVar SUM, int minCardForDecomposition)
VARS
- array of integer variablesOPERATOR
- an operator among "=", "!=", ">", "<", ">=",>" and "<="SUM
- the resulting variablepublic static Constraint reduce(IntVar[] VARS, int[] COEFFS, Operator OPERATOR, IntVar SCALAR, int minCardForDecomposition)
VARS
- array of integer variablesCOEFFS
- array of integersOPERATOR
- an operator among "=", "!=", ">", "<", ">=",>" and "<="SCALAR
- the resulting variablepublic static Constraint selectSum(IntVar[] VARS, int[] COEFFS, Operator OPERATOR, int RESULT, int nbools)
VARS
- array of integer variablesCOEFFS
- array of integersOPERATOR
- on operatorRESULT
- an integernbools
- number of boolean variablespublic static Constraint selectScalar(IntVar[] VARS, int[] COEFFS, Operator OPERATOR, int RESULT)
VARS
- array of integer variablesCOEFFS
- array of integersOPERATOR
- on operatorRESULT
- an integerCopyright © 2018. All rights reserved.