Class LSModel
- java.lang.Object
-
- localsolver.LSModel
-
public class LSModel extends java.lang.Object
Mathematical optimization model. A model is composed of expressions (some of which are decisions), organized as a tree. Then, some expressions of the model can be constrained or optimized. Once your optimization model is created and closed, the solver can be launched to resolve it. Note that you cannot modify a model which has been closed: you must reopen it (withopen()
) or instantiate another LocalSolver environment to optimize another model.- See Also:
LSExpression
,LSOperator
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LSExpression
abs(LSExpression a)
Creates an absolute value expression.void
addConstraint(LSExpression expr)
Adds the given expression to the list of constraints.void
addObjective(LSExpression expr, LSObjectiveDirection direction)
Adds the given expression to the list of objectives to optimize.LSExpression
and()
Creates an AND expression.LSExpression
and(java.lang.Iterable<LSExpression> operands)
Creates an AND expression.LSExpression
and(LSExpression a)
Creates an AND expression.LSExpression
and(LSExpression... operands)
Creates an AND expression.LSExpression
and(LSExpression a, LSExpression b)
Creates an AND expression.LSExpression
array()
Creates an array expression.LSExpression
array(double... operands)
Creates an array expression.LSExpression
array(float... operands)
Creates an array expression.LSExpression
array(int... operands)
Creates an array expression.LSExpression
array(long... operands)
Creates an array expression.LSExpression
array(java.lang.Object operands)
Creates an N-dimensional array expression.LSExpression
array(LSExpression... operands)
Creates an array expression.LSExpression
array(LSExpression range, LSExpression lambda, double defaultvalue)
Creates an array expression.LSExpression
array(LSExpression range, LSExpression lambda, long defaultvalue)
Creates an array expression.LSExpression
at(LSExpression array, long index)
Creates a "at" expression.LSExpression
at(LSExpression array, LSExpression... indices)
Creates a "at" expression for N-dimensional array.LSExpression
boolVar()
Creates a boolean decision.LSExpression
call()
Creates a call expression.LSExpression
call(java.lang.Iterable<LSExpression> operands)
Creates a call expression.LSExpression
call(LSExpression a)
Creates a call expression.LSExpression
call(LSExpression... operands)
Creates a call expression.LSExpression
call(LSExpression a, LSExpression b)
Creates a call expression.LSExpression
call(LSExpression a, LSExpression b, LSExpression c)
Creates a call expression.LSExpression
ceil(LSExpression a)
Creates a ceil expression.void
close()
Closes the model.void
constraint(LSExpression expr)
Shortcut for addConstraint(expr).LSExpression
contains(LSExpression a, long b)
Creates a contains expression.LSExpression
contains(LSExpression a, LSExpression b)
Creates a contains expression.LSExpression
cos(LSExpression a)
Creates a cosine expression.LSExpression
count(LSExpression a)
Creates a count expression.LSExpression
cover()
Creates a cover expression.LSExpression
cover(java.lang.Iterable<LSExpression> operands)
Creates a cover expression.LSExpression
cover(LSExpression array)
Creates a cover expression.LSExpression
cover(LSExpression... operands)
Creates a cover expression.LSExpression
createConstant(double value)
Creates a constant expression representing the given value.LSExpression
createConstant(long value)
Creates a constant expression representing the given value.LSExpression
createDoubleArrayExternalFunction(LSDoubleArrayExternalFunction func)
Creates a double array external function.LSExpression
createDoubleExternalFunction(LSDoubleExternalFunction func)
Creates a double external function.LSExpression
createExpression(LSOperator op)
Creates an expression of the given type.LSExpression
createExpression(LSOperator op, double expr0)
Creates an expression of the given type, with the given operand.LSExpression
createExpression(LSOperator op, double[] operands)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, double expr0, double expr1)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, double expr0, double expr1, double expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, double expr0, double expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, double expr0, LSExpression expr1)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, double expr0, LSExpression expr1, double expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, double expr0, LSExpression expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, float[] operands)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, int[] operands)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, long expr0)
Creates an expression of the given type, with the given operand.LSExpression
createExpression(LSOperator op, long[] operands)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, long expr0, long expr1)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, long expr0, long expr1, long expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, long expr0, long expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, long expr0, LSExpression expr1)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, long expr0, LSExpression expr1, long expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, long expr0, LSExpression expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, java.lang.Iterable<LSExpression> operands)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, LSExpression expr0)
Creates an expression of the given type, with the given operand.LSExpression
createExpression(LSOperator op, LSExpression... operands)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, LSExpression expr0, double expr1)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, LSExpression expr0, double expr1, double expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, LSExpression expr0, double expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, LSExpression expr0, long expr1)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, LSExpression expr0, long expr1, long expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, LSExpression expr0, long expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, LSExpression expr0, LSExpression expr1)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, LSExpression expr0, LSExpression expr1, double expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, LSExpression expr0, LSExpression expr1, long expr2)
Creates an expression of the given type, with the given operands.LSExpression
createExpression(LSOperator op, LSExpression expr0, LSExpression expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands.LSExpression
createIntArrayExternalFunction(LSIntArrayExternalFunction func)
Creates an integer array external function.LSExpression
createIntExternalFunction(LSIntExternalFunction func)
Creates an integer external function.LSExpression
createLambdaFunction(int nbArgs, LSLambdaFunction functor)
Creates a lambda function with arguments.LSExpression
createLambdaFunction(LSLambdaFunction0 functor)
Creates a lambda function without arguments.LSExpression
createLambdaFunction(LSLambdaFunction1 functor)
Creates a lambda function with one arguments.LSExpression
createLambdaFunction(LSLambdaFunction2 functor)
Creates a lambda function with two arguments.LSExpression
createLambdaFunction(LSLambdaFunction3 functor)
Creates a lambda function with three arguments.LSExpression
disjoint()
Creates a disjoint expression.LSExpression
disjoint(java.lang.Iterable<LSExpression> operands)
Creates a disjoint expression.LSExpression
disjoint(LSExpression array)
Creates a disjoint expression.LSExpression
disjoint(LSExpression... operands)
Creates a disjoint expression.LSExpression
dist(double a, LSExpression b)
Creates a distance expression.LSExpression
dist(long a, LSExpression b)
Creates a distance expression.LSExpression
dist(LSExpression a, double b)
Creates a distance expression.LSExpression
dist(LSExpression a, long b)
Creates a distance expression.LSExpression
dist(LSExpression a, LSExpression b)
Creates a distance expression.LSExpression
distinct(LSExpression a)
Creates an distinct expression.LSExpression
distinct(LSExpression a, LSExpression b)
Creates an distinct expression.LSExpression
div(double a, LSExpression b)
Creates a division expression.LSExpression
div(long a, LSExpression b)
Creates a division expression.LSExpression
div(LSExpression a, double b)
Creates a division expression.LSExpression
div(LSExpression a, long b)
Creates a division expression.LSExpression
div(LSExpression a, LSExpression b)
Creates a division expression.LSExpression
doubleArrayExternalFunction(LSDoubleArrayExternalFunction func)
Creates an external function expression.LSExpression
doubleExternalFunction(LSDoubleExternalFunction func)
Creates an external function expression.LSExpression
end(LSExpression a)
Creates an end expression.LSExpression
eq(double a, LSExpression b)
Creates an equality expression.LSExpression
eq(long a, LSExpression b)
Creates an equality expression.LSExpression
eq(LSExpression a, double b)
Creates an equality expression.LSExpression
eq(LSExpression a, long b)
Creates an equality expression.LSExpression
eq(LSExpression a, LSExpression b)
Creates an equality expression.boolean
equals(java.lang.Object obj)
LSExpression
exp(LSExpression a)
Creates an exponential expression.LSExpression
find(LSExpression a, long b)
Creates a find expression.LSExpression
find(LSExpression a, LSExpression b)
Creates a find expression.LSExpression
floatVar(double lb, double ub)
Creates a float decision.LSExpression
floor(LSExpression a)
Creates a floor expression.LSExpression
geq(double a, LSExpression b)
Creates an inequality expression greater than or equal to.LSExpression
geq(long a, LSExpression b)
Creates an inequality expression greater than or equal to.LSExpression
geq(LSExpression a, double b)
Creates an inequality expression greater than or equal to.LSExpression
geq(LSExpression a, long b)
Creates an inequality expression greater than or equal to.LSExpression
geq(LSExpression a, LSExpression b)
Creates an inequality expression greater than or equal to.LSExpression
getConstraint(int constraintIndex)
Gets the constraint with the given index.LSExpression
getDecision(int decisionIndex)
Gets the decision with the given index.LSExpression
getExpression(int exprIndex)
Gets the expression with the given index in this model.LSExpression
getExpression(java.lang.String name)
Gets the expression with the given index in this model.LocalSolver
getLocalSolver()
Returns the LocalSolver object associated to this model.int
getNbConstraints()
Gets the number of constraints added to this model.int
getNbDecisions()
Gets the number of decisions in the model.int
getNbExpressions()
Gets the number of expressions added to this model.int
getNbObjectives()
Gets the number of objectives added to this model.int
getNbOperands()
Gets the number of operands in the model.LSExpression
getObjective(int objectiveIndex)
Gets the objective with the given index.LSObjectiveDirection
getObjectiveDirection(int objectiveIndex)
Gets the direction of the objective with the given index.LSExpression
gt(double a, LSExpression b)
Creates an inequality expression greater than.LSExpression
gt(long a, LSExpression b)
Creates an inequality expression greater than.LSExpression
gt(LSExpression a, double b)
Creates an inequality expression greater than.LSExpression
gt(LSExpression a, long b)
Creates an inequality expression greater than.LSExpression
gt(LSExpression a, LSExpression b)
Creates an inequality expression greater than.int
hashCode()
LSExpression
hull()
Creates a hull expression.LSExpression
hull(LSExpression array)
Creates a hull expression.LSExpression
hull(LSExpression... operands)
Creates a hull expression.LSExpression
iif(LSExpression a, double b, double c)
Creates a ternary conditional expression.LSExpression
iif(LSExpression a, double b, LSExpression c)
Creates a ternary conditional expression.LSExpression
iif(LSExpression a, long b, long c)
Creates a ternary conditional expression.LSExpression
iif(LSExpression a, long b, LSExpression c)
Creates a ternary conditional expression.LSExpression
iif(LSExpression a, LSExpression b, double c)
Creates a ternary conditional expression.LSExpression
iif(LSExpression a, LSExpression b, long c)
Creates a ternary conditional expression.LSExpression
iif(LSExpression a, LSExpression b, LSExpression c)
Creates a ternary conditional expression.LSExpression
indexOf(LSExpression a, long b)
Creates an indexOf expression.LSExpression
indexOf(LSExpression a, LSExpression b)
Creates an indexOf expression.LSExpression
intArrayExternalFunction(LSIntArrayExternalFunction func)
Creates an external function expression.LSExpression
intersection(LSExpression a, LSExpression b)
Creates an intersection expression.LSExpression
intervalVar(long minStart, long maxEnd)
Creates an interval decision included in [minStart, maxEnd).LSExpression
intExternalFunction(LSIntExternalFunction func)
Creates an external function expression.LSExpression
intVar(long lb, long ub)
Creates an integer decision.boolean
isClosed()
Returns true if the model is closed, false otherwise.LSExpression
lambdaFunction(int nbArgs, LSLambdaFunction functor)
Creates a lambda function expression.LSExpression
lambdaFunction(LSLambdaFunction0 functor)
Creates a lambda function expression.LSExpression
lambdaFunction(LSLambdaFunction1 functor)
Creates a lambda function expression.LSExpression
lambdaFunction(LSLambdaFunction2 functor)
Creates a lambda function expression.LSExpression
lambdaFunction(LSLambdaFunction3 functor)
Creates a lambda function expression.LSExpression
length(LSExpression a)
Creates a length expression.LSExpression
leq(double a, LSExpression b)
Creates an inequality expression less than or equal to.LSExpression
leq(long a, LSExpression b)
Creates an inequality expression less than or equal to.LSExpression
leq(LSExpression a, double b)
Creates an inequality expression less than or equal to.LSExpression
leq(LSExpression a, long b)
Creates an inequality expression less than or equal to.LSExpression
leq(LSExpression a, LSExpression b)
Creates an inequality expression less than or equal to.LSExpression
listVar(long n)
Creates a list decision with the given length.LSExpression
log(LSExpression a)
Creates a log expression.LSExpression
lt(double a, LSExpression b)
Creates an inequality expression less than.LSExpression
lt(long a, LSExpression b)
Creates an inequality expression less than.LSExpression
lt(LSExpression a, double b)
Creates an inequality expression less than.LSExpression
lt(LSExpression a, long b)
Creates an inequality expression less than.LSExpression
lt(LSExpression a, LSExpression b)
Creates an inequality expression less than.LSExpression
max()
Creates a maximum expression.LSExpression
max(double a)
Creates a maximum expression.LSExpression
max(double a, LSExpression b)
Creates a maximum expression.LSExpression
max(long a)
Creates a maximum expression.LSExpression
max(long a, LSExpression b)
Creates a maximum expression.LSExpression
max(java.lang.Iterable<LSExpression> operands)
Creates a maximum expression.LSExpression
max(LSExpression a)
Creates a maximum expression.LSExpression
max(LSExpression... operands)
Creates a maximum expression.LSExpression
max(LSExpression a, double b)
Creates a maximum expression.LSExpression
max(LSExpression a, long b)
Creates a maximum expression.LSExpression
max(LSExpression a, LSExpression b)
Creates a maximum expression.void
maximize(LSExpression expr)
Shortcut for addObjective(expr, OD_Maximize).LSExpression
min()
Creates a minimum expression.LSExpression
min(double a)
Creates a minimum expression.LSExpression
min(double a, LSExpression b)
Creates a minimum expression.LSExpression
min(long a)
Creates a minimum expression.LSExpression
min(long a, LSExpression b)
Creates a minimum expression.LSExpression
min(java.lang.Iterable<LSExpression> operands)
Creates a minimum expression.LSExpression
min(LSExpression a)
Creates a minimum expression.LSExpression
min(LSExpression... operands)
Creates a minimum expression.LSExpression
min(LSExpression a, double b)
Creates a minimum expression.LSExpression
min(LSExpression a, long b)
Creates a minimum expression.LSExpression
min(LSExpression a, LSExpression b)
Creates a minimum expression.void
minimize(LSExpression expr)
Shortcut for addObjective(expr, OD_Minimize).LSExpression
mod(long a, LSExpression b)
Creates a modulo expression.LSExpression
mod(LSExpression a, long b)
Creates a modulo expression.LSExpression
mod(LSExpression a, LSExpression b)
Creates a modulo expression.LSExpression
neq(double a, LSExpression b)
Creates a disequality expression.LSExpression
neq(long a, LSExpression b)
Creates a disequality expression.LSExpression
neq(LSExpression a, double b)
Creates a disequality expression.LSExpression
neq(LSExpression a, long b)
Creates a disequality expression.LSExpression
neq(LSExpression a, LSExpression b)
Creates a disequality expression.LSExpression
not(LSExpression a)
Creates a NOT expression.void
open()
Reopens the model.LSExpression
or()
Creates a OR expression.LSExpression
or(java.lang.Iterable<LSExpression> operands)
Creates a OR expression.LSExpression
or(LSExpression a)
Creates a OR expression.LSExpression
or(LSExpression... operands)
Creates a OR expression.LSExpression
or(LSExpression a, LSExpression b)
Creates a OR expression.LSExpression
partition()
Creates a partition expression.LSExpression
partition(java.lang.Iterable<LSExpression> operands)
Creates a partition expression.LSExpression
partition(LSExpression array)
Creates a partition expression.LSExpression
partition(LSExpression... operands)
Creates a partition expression.LSExpression
piecewise(LSExpression abscissae, LSExpression ordinates, LSExpression x)
Creates a piecewise linear expression.LSExpression
pow(double a, LSExpression b)
Creates a power expression.LSExpression
pow(long a, LSExpression b)
Creates a power expression.LSExpression
pow(LSExpression a, double b)
Creates a power expression.LSExpression
pow(LSExpression a, long b)
Creates a power expression.LSExpression
pow(LSExpression a, LSExpression b)
Creates a power expression.LSExpression
prod()
Creates a product expression.LSExpression
prod(double a)
Creates a product expression.LSExpression
prod(double a, LSExpression b)
Creates a product expression.LSExpression
prod(long a)
Creates a product expression.LSExpression
prod(long a, LSExpression b)
Creates a product expression.LSExpression
prod(java.lang.Iterable<LSExpression> operands)
Creates a product expression.LSExpression
prod(LSExpression a)
Creates a product expression.LSExpression
prod(LSExpression... operands)
Creates a product expression.LSExpression
prod(LSExpression a, double b)
Creates a product expression.LSExpression
prod(LSExpression a, long b)
Creates a product expression.LSExpression
prod(LSExpression a, LSExpression b)
Creates a product expression.LSExpression
range(long a, long b)
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive).LSExpression
range(long a, LSExpression b)
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive).LSExpression
range(LSExpression a, long b)
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive).LSExpression
range(LSExpression a, LSExpression b)
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive).void
removeConstraint(int constraintIndex)
Removes the constraint at the given position in the list of constraints.void
removeConstraint(LSExpression expr)
Removes the given expression from the list of constraints.void
removeObjective(int objectiveIndex)
Removes the objective at the given position in the list of objectives.LSExpression
round(LSExpression a)
Creates a rounding expression.LSExpression
scalar(LSExpression a, LSExpression b)
Creates an expression for the scalar product between two arrays.LSExpression
setVar(long n)
Creates a set decision with the given length.LSExpression
sin(LSExpression a)
Creates a sine expression.LSExpression
sort(LSExpression array)
Creates a sorted array, containing the same values as the array given as unique parameter, sorted in ascending order.LSExpression
sort(LSExpression array, LSExpression lambda)
Creates a sorted array, containing the same values as the array given as first parameter, sorted in ascending order based on the values returned by the the lambda function given as second parameter.LSExpression
sqrt(LSExpression a)
Creates a square root expression.LSExpression
start(LSExpression a)
Creates a start expression.LSExpression
sub(double a, LSExpression b)
Creates a substraction expression.LSExpression
sub(long a, LSExpression b)
Creates a substraction expression.LSExpression
sub(LSExpression a, double b)
Creates a substraction expression.LSExpression
sub(LSExpression a, long b)
Creates a substraction expression.LSExpression
sub(LSExpression a, LSExpression b)
Creates a substraction expression.LSExpression
sum()
Creates a sum expression.LSExpression
sum(double a)
Creates a sum expression.LSExpression
sum(double a, LSExpression b)
Creates a sum expression.LSExpression
sum(long a)
Creates a sum expression.LSExpression
sum(long a, LSExpression b)
Creates a sum expression.LSExpression
sum(java.lang.Iterable<LSExpression> operands)
Creates a sum expression.LSExpression
sum(LSExpression a)
Creates a sum expression.LSExpression
sum(LSExpression... operands)
Creates a sum expression.LSExpression
sum(LSExpression a, double b)
Creates a sum expression.LSExpression
sum(LSExpression a, long b)
Creates a sum expression.LSExpression
sum(LSExpression a, LSExpression b)
Creates a sum expression.LSExpression
tan(LSExpression a)
Creates a tangent expression.java.lang.String
toString()
Returns a String representation of this model.LSExpression
xor()
Creates a XOR expression.LSExpression
xor(java.lang.Iterable<LSExpression> operands)
Creates a XOR expression.LSExpression
xor(LSExpression a)
Creates a XOR expression.LSExpression
xor(LSExpression... operands)
Creates a XOR expression.LSExpression
xor(LSExpression a, LSExpression b)
Creates a XOR expression.
-
-
-
Method Detail
-
getLocalSolver
public LocalSolver getLocalSolver()
Returns the LocalSolver object associated to this model.- Returns:
- LocalSolver object.
-
createConstant
public LSExpression createConstant(long value)
Creates a constant expression representing the given value. Only allowed in stateLSState.Modeling
. Note that if a constant has been already created with the same value, this method can return the same expression, but it is not guaranteed. The exact behavior is implementation defined.- Parameters:
value
- Value of the constant.- Returns:
- Created constant expression.
-
createConstant
public LSExpression createConstant(double value)
Creates a constant expression representing the given value. Only allowed in stateLSState.Modeling
. Note that if a constant has been already created with the same value, this method can return the same expression, but it is not guaranteed. The exact behavior is implementation defined.- Parameters:
value
- Value of the constant.- Returns:
- Created constant expression.
-
createExpression
public LSExpression createExpression(LSOperator op)
Creates an expression of the given type. The expression is created without operand. Only allowed in stateLSState.Modeling
. This method cannot be used to create constants: usecreateConstant(long)
orcreateConstant(double)
instead.- Parameters:
op
- Type of expression to create.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression expr0)
Creates an expression of the given type, with the given operand. Only allowed in stateLSState.Modeling
. Useful for creating unary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, long expr0)
Creates an expression of the given type, with the given operand. Only allowed in stateLSState.Modeling
. Useful for creating unary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, double expr0)
Creates an expression of the given type, with the given operand. Only allowed in stateLSState.Modeling
. Useful for creating unary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression expr0, LSExpression expr1)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating binary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, long expr0, long expr1)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating binary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, long expr0, LSExpression expr1)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating binary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression expr0, long expr1)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating binary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, double expr0, double expr1)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating binary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, double expr0, LSExpression expr1)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating binary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression expr0, double expr1)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating binary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression expr0, LSExpression expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, long expr0, long expr1, long expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, long expr0, long expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, long expr0, LSExpression expr1, long expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, long expr0, LSExpression expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression expr0, long expr1, long expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression expr0, long expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression expr0, LSExpression expr1, long expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, double expr0, double expr1, double expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, double expr0, double expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, double expr0, LSExpression expr1, double expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, double expr0, LSExpression expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression expr0, double expr1, double expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression expr0, double expr1, LSExpression expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression expr0, LSExpression expr1, double expr2)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating ternary expressions.- Parameters:
op
- Type of expression to create.expr0
- Operand 0.expr1
- Operand 1.expr2
- Operand 2.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, java.lang.Iterable<LSExpression> operands)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating n-ary expressions.- Parameters:
op
- Type of expression to create.operands
- Operands to add.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, LSExpression... operands)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating n-ary expressions.- Parameters:
op
- Type of expression to create.operands
- Operands to add.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, int[] operands)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating n-ary expressions.- Parameters:
op
- Type of expression to create.operands
- Operands to add.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, long[] operands)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating n-ary expressions.- Parameters:
op
- Type of expression to create.operands
- Operands to add.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, float[] operands)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating n-ary expressions.- Parameters:
op
- Type of expression to create.operands
- Operands to add.- Returns:
- Created expression.
-
createExpression
public LSExpression createExpression(LSOperator op, double[] operands)
Creates an expression of the given type, with the given operands. Only allowed in stateLSState.Modeling
. Useful for creating n-ary expressions.- Parameters:
op
- Type of expression to create.operands
- Operands to add.- Returns:
- Created expression.
-
createIntExternalFunction
public LSExpression createIntExternalFunction(LSIntExternalFunction func)
Creates an integer external function. The argument must implement
LSIntExternalFunction
. When the external function is called, the argument values will be made accessible to your function through theLSExternalArgumentValues
.Once you have instantiated it, you have to use
call(LSExpression... operands)
to call it in your model.Note 1: Most of the time your external function will be called when the solver is in state
LSState.Running
. Do not attempt to call any method of the solver (to retrieve statistics, values of LSExpressions or whatever) in that state or an exception will be thrown. The only accessible function isLocalSolver.stop()
.Note 2: Your functions must be thread-safe. According to the "nbThreads" parameter, LocalSolver can be multi-threaded. In that case, your external functions must be thread safe. If you cannot guarantee the thread-safety of your code, we strongly recommend you to limit the search of LocalSolver to one thread with
LSParam.setNbThreads(int)
.Note 3: You can provide additional data for your function (such as lower and upper bounds) with the help of the
LSExternalContext
associated with your function (seeLSExpression.getExternalContext()
.- Parameters:
func
- External function to call.- Returns:
- The expression associated with the function.
- Since:
- 9.5
- See Also:
LSOperator.ExternalFunction
-
createDoubleExternalFunction
public LSExpression createDoubleExternalFunction(LSDoubleExternalFunction func)
Creates a double external function. The argument must implement
LSDoubleExternalFunction
. When the external function is called, the argument values will be made accessible to your function through theLSExternalArgumentValues
.Once you have instantiated it, you have to use
call(LSExpression... operands)
to call it in your model.Note 1: Most of the time your external function will be called when the solver is in state
LSState.Running
. Do not attempt to call any method of the solver (to retrieve statistics, values of LSExpressions or whatever) in that state or an exception will be thrown. The only accessible function isLocalSolver.stop()
.Note 2: Your functions must be thread-safe. According to the "nbThreads" parameter, LocalSolver can be multi-threaded. In that case, your external functions must be thread safe. If you cannot guarantee the thread-safety of your code, we strongly recommend you to limit the search of LocalSolver to one thread with
LSParam.setNbThreads(int)
.Note 3: You can provide additional data for your function (such as lower and upper bounds) with the help of the
LSExternalContext
associated with your function (seeLSExpression.getExternalContext()
.- Parameters:
func
- External function to call.- Returns:
- The expression associated with the function.
- Since:
- 9.5
- See Also:
LSOperator.ExternalFunction
-
createIntArrayExternalFunction
public LSExpression createIntArrayExternalFunction(LSIntArrayExternalFunction func)
Creates an integer array external function. The argument must implement
LSIntArrayExternalFunction
. When the external function is called, the argument values will be made accessible to your function through theLSExternalArgumentValues
.Once you have instantiated it, you have to use
call(LSExpression... operands)
to call it in your model.Note: You can provide additional data and parameters for your function (such as the maximum number of evaluations) with the help of the
LSExternalContext
associated with your function (seeLSExpression.getExternalContext()
).- Parameters:
func
- External function to call.- Returns:
- The expression associated with the function.
- Since:
- 11.0
- See Also:
LSOperator.ExternalFunction
-
createDoubleArrayExternalFunction
public LSExpression createDoubleArrayExternalFunction(LSDoubleArrayExternalFunction func)
Creates a double array external function. The argument must implement
LSDoubleArrayExternalFunction
. When the external function is called, the argument values will be made accessible to your function through theLSExternalArgumentValues
.Once you have instantiated it, you have to use
call(LSExpression... operands)
to call it in your model.Note: You can provide additional data and parameters for your function (such as the maximum number of evaluations) with the help of the
LSExternalContext
associated with your function (seeLSExpression.getExternalContext()
).- Parameters:
func
- External function to call.- Returns:
- The expression associated with the function.
- Since:
- 11.0
- See Also:
LSOperator.ExternalFunction
-
createLambdaFunction
public LSExpression createLambdaFunction(LSLambdaFunction0 functor)
Creates a lambda function without arguments. A lambda function is a particular expression composed of two parts:- The arguments of the function (which are also LSExpressions of type
LSOperator.Argument
. - The body of the function. The body is an LSExpression that will be used to evaluate the result of the function. The body can be any LSExpression composed of any operands and operators supported by LocalSolver. Thus, the body expression can use the arguments of the function but can also capture and refer to expressions declared outside of the function.
- Parameters:
functor
- A function (LSLambdaFunction0) that returns anLSExpression
that will be used as the body of the new LocalSolver function you want to create.- Returns:
- Expression of type
LSOperator.LambdaFunction
. - Since:
- 9.5
- The arguments of the function (which are also LSExpressions of type
-
createLambdaFunction
public LSExpression createLambdaFunction(LSLambdaFunction1 functor)
Creates a lambda function with one arguments. A lambda function is a particular expression composed of two parts:- The arguments of the function (which are also LSExpressions of type
LSOperator.Argument
. - The body of the function. The body is an LSExpression that will be used to evaluate the result of the function. The body can be any LSExpression composed of any operands and operators supported by LocalSolver. Thus, the body expression can use the arguments of the function but can also capture and refer to expressions declared outside of the function.
LSOperator.Argument
. At the end of the evaluation of your function, the returned LSExpression will be used as the body of the LocalSolver function.- Parameters:
functor
- A function (LSLambdaFunction1) that accepts oneLSExpression
as argument and returns anLSExpression
that will be used as the body of the new LocalSolver function you want to create.- Returns:
- Expression of type
LSOperator.LambdaFunction
. - Since:
- 9.5
- The arguments of the function (which are also LSExpressions of type
-
createLambdaFunction
public LSExpression createLambdaFunction(LSLambdaFunction2 functor)
Creates a lambda function with two arguments. A lambda function is a particular expression composed of two parts:- The arguments of the function (which are also LSExpressions of type
LSOperator.Argument
. - The body of the function. The body is an LSExpression that will be used to evaluate the result of the function. The body can be any LSExpression composed of any operands and operators supported by LocalSolver. Thus, the body expression can use the arguments of the function but can also capture and refer to expressions declared outside of the function.
LSOperator.Argument
that corresponds to the number of arguments your function expects. At the end of the evaluation of your function, the returned LSExpression will be used as the body of the LocalSolver function.- Parameters:
functor
- A function (LSLambdaFunction2) that accepts twoLSExpression
as arguments and returns anLSExpression
that will be used as the body of the new LocalSolver function you want to create.- Returns:
- Expression of type
LSOperator.LambdaFunction
. - Since:
- 9.5
- The arguments of the function (which are also LSExpressions of type
-
createLambdaFunction
public LSExpression createLambdaFunction(LSLambdaFunction3 functor)
Creates a lambda function with three arguments. A lambda function is a particular expression composed of two parts:- The arguments of the function (which are also LSExpressions of type
LSOperator.Argument
. - The body of the function. The body is an LSExpression that will be used to evaluate the result of the function. The body can be any LSExpression composed of any operands and operators supported by LocalSolver. Thus, the body expression can use the arguments of the function but can also capture and refer to expressions declared outside of the function.
LSOperator.Argument
that corresponds to the number of arguments your function expects. At the end of the evaluation of your function, the returned LSExpression will be used as the body of the LocalSolver function.- Parameters:
functor
- A function (LSLambdaFunction3) that accepts threeLSExpression
as arguments and returns anLSExpression
that will be used as the body of the new LocalSolver function you want to create.- Returns:
- Expression of type
LSOperator.LambdaFunction
. - Since:
- 9.5
- The arguments of the function (which are also LSExpressions of type
-
createLambdaFunction
public LSExpression createLambdaFunction(int nbArgs, LSLambdaFunction functor)
Creates a lambda function with arguments. A lambda function is a particular expression composed of two parts:- The arguments of the function (which are also LSExpressions of type
LSOperator.Argument
. - The body of the function. The body is an LSExpression that will be used to evaluate the result of the function. The body can be any LSExpression composed of any operands and operators supported by LocalSolver. Thus, the body expression can use the arguments of the function but can also capture and refer to expressions declared outside of the function.
LSOperator.Argument
that corresponds to the number of arguments you want and your function expects. At the end of the evaluation of your function, the returned LSExpression will be used as the body of the LocalSolver function.- Parameters:
nbArgs
- Number of arguments you want for your function.functor
- A function (LSLambdaFunction) that acceptsLSExpression
as arguments and returns anLSExpression
that will be used as the body of the new LocalSolver function you want to create.- Returns:
- Expression of type
LSOperator.LambdaFunction
. - Since:
- 9.5
- The arguments of the function (which are also LSExpressions of type
-
boolVar
public LSExpression boolVar()
Creates a boolean decision. Binary decision variable with domain { 0, 1 }. This method is a shortcut forcreateExpression(
.LSOperator.Bool
)- Since:
- 5.5
- See Also:
LSOperator.Bool
,createExpression(LSOperator)
-
floatVar
public LSExpression floatVar(double lb, double ub)
Creates a float decision. Decision variable with domain [lb, ub]. This method is a shortcut forcreateExpression(LSOperator.Float, lb, ub)
.- Parameters:
lb
- Lower bound of the decision variable.ub
- Upper bound of the decision variable.- Since:
- 5.5
- See Also:
LSOperator.Float
,createExpression(LSOperator, double, double)
-
intVar
public LSExpression intVar(long lb, long ub)
Creates an integer decision. Decision variable with domain [lb, ub]. This method is a shortcut forcreateExpression(LSOperator.Int, lb, ub)
.- Parameters:
lb
- Lower bound of the decision variable.ub
- Upper bound of the decision variable.- Since:
- 5.5
- See Also:
LSOperator.Int
,createExpression(LSOperator, long, long)
-
intervalVar
public LSExpression intervalVar(long minStart, long maxEnd)
Creates an interval decision included in [minStart, maxEnd). Start is inclusive and end is exclusive. This method is a shortcut forcreateExpression(LSOperator.Interval, minStart, maxEnd)
.- Parameters:
minStart
- Min start of the decision variable.maxEnd
- Max end of the decision variable.- Since:
- 12.0
- See Also:
LSOperator.Interval
,createExpression(LSOperator, long, long)
-
start
public LSExpression start(LSExpression a)
Creates a start expression. This method is a shortcut forcreateExpression(LSOperator.Start, a)
.- Since:
- 12.0
- See Also:
LSOperator.Start
,createExpression(LSOperator, LSExpression)
-
end
public LSExpression end(LSExpression a)
Creates an end expression. This method is a shortcut forcreateExpression(LSOperator.End, a)
.- Since:
- 12.0
- See Also:
LSOperator.End
,createExpression(LSOperator, LSExpression)
-
length
public LSExpression length(LSExpression a)
Creates a length expression. This method is a shortcut forcreateExpression(LSOperator.Length, a)
.- Since:
- 12.0
- See Also:
LSOperator.Length
,createExpression(LSOperator, LSExpression)
-
sum
public LSExpression sum()
Creates a sum expression. This method is a shortcut forcreateExpression(LSOperator.Sum)
.- Since:
- 5.5
- See Also:
LSOperator.Sum
,createExpression(LSOperator)
-
sum
public LSExpression sum(long a)
Creates a sum expression. This method is a shortcut forcreateExpression(LSOperator.Sum, a)
.- Since:
- 5.5
- See Also:
LSOperator.Sum
,createExpression(LSOperator, long)
-
sum
public LSExpression sum(LSExpression a)
Creates a sum expression. This method is a shortcut forcreateExpression(LSOperator.Sum, a)
.- Since:
- 12.5
- See Also:
LSOperator.Sum
,createExpression(LSOperator, LSExpression)
-
sum
public LSExpression sum(double a)
Creates a sum expression. This method is a shortcut forcreateExpression(LSOperator.Sum, a)
.- Since:
- 5.5
- See Also:
LSOperator.Sum
,createExpression(LSOperator, double)
-
sum
public LSExpression sum(LSExpression a, LSExpression b)
Creates a sum expression. This method is a shortcut forcreateExpression(LSOperator.Sum, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Sum
,createExpression(LSOperator, LSExpression, LSExpression)
-
sum
public LSExpression sum(java.lang.Iterable<LSExpression> operands)
Creates a sum expression. This method is a shortcut forcreateExpression(LSOperator.Sum, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Sum
,createExpression(LSOperator, Iterable)
-
sum
public LSExpression sum(LSExpression... operands)
Creates a sum expression. This method is a shortcut forcreateExpression(LSOperator.Sum, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Sum
,createExpression(LSOperator, LSExpression...)
-
sum
public LSExpression sum(long a, LSExpression b)
Creates a sum expression. This method is a shortcut forcreateExpression(LSOperator.Sum, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Sum
,createExpression(LSOperator, long, LSExpression)
-
sum
public LSExpression sum(LSExpression a, long b)
Creates a sum expression. This method is a shortcut forcreateExpression(LSOperator.Sum, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Sum
,createExpression(LSOperator, LSExpression, long)
-
sum
public LSExpression sum(double a, LSExpression b)
Creates a sum expression. This method is a shortcut forcreateExpression(LSOperator.Sum, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Sum
,createExpression(LSOperator, double, LSExpression)
-
sum
public LSExpression sum(LSExpression a, double b)
Creates a sum expression. This method is a shortcut forcreateExpression(LSOperator.Sum, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Sum
,createExpression(LSOperator, LSExpression, double)
-
sub
public LSExpression sub(LSExpression a, LSExpression b)
Creates a substraction expression. This method is a shortcut forcreateExpression(LSOperator.Sub, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Sub
,createExpression(LSOperator, LSExpression, LSExpression)
-
sub
public LSExpression sub(long a, LSExpression b)
Creates a substraction expression. This method is a shortcut forcreateExpression(LSOperator.Sub, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Sub
,createExpression(LSOperator, long, LSExpression)
-
sub
public LSExpression sub(LSExpression a, long b)
Creates a substraction expression. This method is a shortcut forcreateExpression(LSOperator.Sub, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Sub
,createExpression(LSOperator, LSExpression, long)
-
sub
public LSExpression sub(double a, LSExpression b)
Creates a substraction expression. This method is a shortcut forcreateExpression(LSOperator.Sub, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Sub
,createExpression(LSOperator, double, LSExpression)
-
sub
public LSExpression sub(LSExpression a, double b)
Creates a substraction expression. This method is a shortcut forcreateExpression(LSOperator.Sub, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Sub
,createExpression(LSOperator, LSExpression, double)
-
prod
public LSExpression prod()
Creates a product expression. This method is a shortcut forcreateExpression(LSOperator.Prod)
.- Since:
- 5.5
- See Also:
LSOperator.Prod
,createExpression(LSOperator)
-
prod
public LSExpression prod(long a)
Creates a product expression. This method is a shortcut forcreateExpression(LSOperator.Prod, a)
.- Since:
- 5.5
- See Also:
LSOperator.Prod
,createExpression(LSOperator, long)
-
prod
public LSExpression prod(double a)
Creates a product expression. This method is a shortcut forcreateExpression(LSOperator.Prod, a)
.- Since:
- 5.5
- See Also:
LSOperator.Prod
,createExpression(LSOperator, double)
-
prod
public LSExpression prod(LSExpression a)
Creates a product expression. This method is a shortcut forcreateExpression(LSOperator.Prod, a)
.- Since:
- 12.5
- See Also:
LSOperator.Prod
,createExpression(LSOperator, LSExpression)
-
prod
public LSExpression prod(LSExpression a, LSExpression b)
Creates a product expression. This method is a shortcut forcreateExpression(LSOperator.Prod, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Prod
,createExpression(LSOperator, LSExpression, LSExpression)
-
prod
public LSExpression prod(LSExpression... operands)
Creates a product expression. This method is a shortcut forcreateExpression(LSOperator.Prod, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Prod
,createExpression(LSOperator, LSExpression...)
-
prod
public LSExpression prod(java.lang.Iterable<LSExpression> operands)
Creates a product expression. This method is a shortcut forcreateExpression(LSOperator.Prod, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Prod
,createExpression(LSOperator, Iterable)
-
prod
public LSExpression prod(LSExpression a, long b)
Creates a product expression. This method is a shortcut forcreateExpression(LSOperator.Prod, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Prod
,createExpression(LSOperator, LSExpression, long)
-
prod
public LSExpression prod(long a, LSExpression b)
Creates a product expression. This method is a shortcut forcreateExpression(LSOperator.Prod, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Prod
,createExpression(LSOperator, long, LSExpression)
-
prod
public LSExpression prod(LSExpression a, double b)
Creates a product expression. This method is a shortcut forcreateExpression(LSOperator.Prod, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Prod
,createExpression(LSOperator, LSExpression, double)
-
prod
public LSExpression prod(double a, LSExpression b)
Creates a product expression. This method is a shortcut forcreateExpression(LSOperator.Prod, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Prod
,createExpression(LSOperator, double, LSExpression)
-
max
public LSExpression max()
Creates a maximum expression. This method is a shortcut forcreateExpression(LSOperator.Max)
.- Since:
- 5.5
- See Also:
LSOperator.Max
,createExpression(LSOperator)
-
max
public LSExpression max(long a)
Creates a maximum expression. This method is a shortcut forcreateExpression(LSOperator.Max, a)
.- Since:
- 5.5
- See Also:
LSOperator.Max
,createExpression(LSOperator, long)
-
max
public LSExpression max(double a)
Creates a maximum expression. This method is a shortcut forcreateExpression(LSOperator.Max, a)
.- Since:
- 5.5
- See Also:
LSOperator.Max
,createExpression(LSOperator, double)
-
max
public LSExpression max(LSExpression a)
Creates a maximum expression. This method is a shortcut forcreateExpression(LSOperator.Max, a)
.- Since:
- 12.5
- See Also:
LSOperator.Max
,createExpression(LSOperator, LSExpression)
-
max
public LSExpression max(LSExpression a, LSExpression b)
Creates a maximum expression. This method is a shortcut forcreateExpression(LSOperator.Max, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Max
,createExpression(LSOperator, LSExpression, LSExpression)
-
max
public LSExpression max(java.lang.Iterable<LSExpression> operands)
Creates a maximum expression. This method is a shortcut forcreateExpression(LSOperator.Max, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Max
,createExpression(LSOperator, Iterable)
-
max
public LSExpression max(LSExpression... operands)
Creates a maximum expression. This method is a shortcut forcreateExpression(LSOperator.Max, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Max
,createExpression(LSOperator, LSExpression... operands)
-
max
public LSExpression max(LSExpression a, long b)
Creates a maximum expression. This method is a shortcut forcreateExpression(LSOperator.Max, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Max
,createExpression(LSOperator, LSExpression, long)
-
max
public LSExpression max(long a, LSExpression b)
Creates a maximum expression. This method is a shortcut forcreateExpression(LSOperator.Max, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Max
,createExpression(LSOperator, long, LSExpression)
-
max
public LSExpression max(LSExpression a, double b)
Creates a maximum expression. This method is a shortcut forcreateExpression(LSOperator.Max, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Max
,createExpression(LSOperator, LSExpression, double)
-
max
public LSExpression max(double a, LSExpression b)
Creates a maximum expression. This method is a shortcut forcreateExpression(LSOperator.Max, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Max
,createExpression(LSOperator, double, LSExpression)
-
min
public LSExpression min()
Creates a minimum expression. This method is a shortcut forcreateExpression(LSOperator.Min)
.- Since:
- 5.5
- See Also:
LSOperator.Min
,createExpression(LSOperator)
-
min
public LSExpression min(long a)
Creates a minimum expression. This method is a shortcut forcreateExpression(LSOperator.Min, a)
.- Since:
- 5.5
- See Also:
LSOperator.Min
,createExpression(LSOperator, long)
-
min
public LSExpression min(double a)
Creates a minimum expression. This method is a shortcut forcreateExpression(LSOperator.Min, a)
.- Since:
- 5.5
- See Also:
LSOperator.Min
,createExpression(LSOperator, double)
-
min
public LSExpression min(LSExpression a)
Creates a minimum expression. This method is a shortcut forcreateExpression(LSOperator.Min, a)
.- Since:
- 12.5
- See Also:
LSOperator.Min
,createExpression(LSOperator, LSExpression)
-
min
public LSExpression min(LSExpression a, LSExpression b)
Creates a minimum expression. This method is a shortcut forcreateExpression(LSOperator.Min, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Min
,createExpression(LSOperator, LSExpression, LSExpression)
-
min
public LSExpression min(LSExpression... operands)
Creates a minimum expression. This method is a shortcut forcreateExpression(LSOperator.Min, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Min
,createExpression(LSOperator, LSExpression...)
-
min
public LSExpression min(java.lang.Iterable<LSExpression> operands)
Creates a minimum expression. This method is a shortcut forcreateExpression(LSOperator.Min, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Min
,createExpression(LSOperator, Iterable)
-
min
public LSExpression min(LSExpression a, long b)
Creates a minimum expression. This method is a shortcut forcreateExpression(LSOperator.Min, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Min
,createExpression(LSOperator, LSExpression, long)
-
min
public LSExpression min(long a, LSExpression b)
Creates a minimum expression. This method is a shortcut forcreateExpression(LSOperator.Min, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Min
,createExpression(LSOperator, long, LSExpression)
-
min
public LSExpression min(LSExpression a, double b)
Creates a minimum expression.- Since:
- 5.5
- See Also:
LSOperator.Min
-
min
public LSExpression min(double a, LSExpression b)
Creates a minimum expression. This method is a shortcut forcreateExpression(LSOperator.Min, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Min
,createExpression(LSOperator, double, LSExpression)
-
eq
public LSExpression eq(LSExpression a, LSExpression b)
Creates an equality expression. This method is a shortcut forcreateExpression(LSOperator.Eq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Eq
,createExpression(LSOperator, LSExpression, LSExpression)
-
eq
public LSExpression eq(LSExpression a, long b)
Creates an equality expression. This method is a shortcut forcreateExpression(LSOperator.Eq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Eq
,createExpression(LSOperator, LSExpression, long)
-
eq
public LSExpression eq(long a, LSExpression b)
Creates an equality expression. This method is a shortcut forcreateExpression(LSOperator.Eq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Eq
,createExpression(LSOperator, long, LSExpression)
-
eq
public LSExpression eq(LSExpression a, double b)
Creates an equality expression. This method is a shortcut forcreateExpression(LSOperator.Eq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Eq
,createExpression(LSOperator, LSExpression, double)
-
eq
public LSExpression eq(double a, LSExpression b)
Creates an equality expression. This method is a shortcut forcreateExpression(LSOperator.Eq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Eq
,createExpression(LSOperator, double, LSExpression)
-
neq
public LSExpression neq(LSExpression a, LSExpression b)
Creates a disequality expression. This method is a shortcut forcreateExpression(LSOperator.Neq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Neq
,createExpression(LSOperator, LSExpression, LSExpression)
-
neq
public LSExpression neq(LSExpression a, long b)
Creates a disequality expression. This method is a shortcut forcreateExpression(LSOperator.Neq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Neq
,createExpression(LSOperator, LSExpression, long)
-
neq
public LSExpression neq(long a, LSExpression b)
Creates a disequality expression. This method is a shortcut forcreateExpression(LSOperator.Neq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Neq
,createExpression(LSOperator, long, LSExpression)
-
neq
public LSExpression neq(LSExpression a, double b)
Creates a disequality expression. This method is a shortcut forcreateExpression(LSOperator.Neq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Neq
,createExpression(LSOperator, LSExpression, double)
-
neq
public LSExpression neq(double a, LSExpression b)
Creates a disequality expression. This method is a shortcut forcreateExpression(LSOperator.Neq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Neq
,createExpression(LSOperator, double, LSExpression)
-
geq
public LSExpression geq(LSExpression a, LSExpression b)
Creates an inequality expression greater than or equal to. This method is a shortcut forcreateExpression(LSOperator.Geq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Geq
,createExpression(LSOperator, LSExpression, LSExpression)
-
geq
public LSExpression geq(LSExpression a, long b)
Creates an inequality expression greater than or equal to. This method is a shortcut forcreateExpression(LSOperator.Geq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Geq
,createExpression(LSOperator, LSExpression, long)
-
geq
public LSExpression geq(long a, LSExpression b)
Creates an inequality expression greater than or equal to. This method is a shortcut forcreateExpression(LSOperator.Geq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Geq
,createExpression(LSOperator, long, LSExpression)
-
geq
public LSExpression geq(LSExpression a, double b)
Creates an inequality expression greater than or equal to. This method is a shortcut forcreateExpression(LSOperator.Geq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Geq
,createExpression(LSOperator, LSExpression, double)
-
geq
public LSExpression geq(double a, LSExpression b)
Creates an inequality expression greater than or equal to. This method is a shortcut forcreateExpression(LSOperator.Geq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Geq
,createExpression(LSOperator, double, LSExpression)
-
leq
public LSExpression leq(LSExpression a, LSExpression b)
Creates an inequality expression less than or equal to. This method is a shortcut forcreateExpression(LSOperator.Leq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Leq
,createExpression(LSOperator, LSExpression, LSExpression)
-
leq
public LSExpression leq(LSExpression a, long b)
Creates an inequality expression less than or equal to. This method is a shortcut forcreateExpression(LSOperator.Leq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Leq
,createExpression(LSOperator, LSExpression, long)
-
leq
public LSExpression leq(long a, LSExpression b)
Creates an inequality expression less than or equal to. This method is a shortcut forcreateExpression(LSOperator.Leq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Leq
,createExpression(LSOperator, long, LSExpression)
-
leq
public LSExpression leq(LSExpression a, double b)
Creates an inequality expression less than or equal to. This method is a shortcut forcreateExpression(LSOperator.Leq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Leq
,createExpression(LSOperator, LSExpression, double)
-
leq
public LSExpression leq(double a, LSExpression b)
Creates an inequality expression less than or equal to. This method is a shortcut forcreateExpression(LSOperator.Leq, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Leq
,createExpression(LSOperator, double, LSExpression)
-
gt
public LSExpression gt(LSExpression a, LSExpression b)
Creates an inequality expression greater than. This method is a shortcut forcreateExpression(LSOperator.Gt, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Gt
,createExpression(LSOperator, LSExpression, LSExpression)
-
gt
public LSExpression gt(LSExpression a, long b)
Creates an inequality expression greater than. This method is a shortcut forcreateExpression(LSOperator.Gt, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Gt
,createExpression(LSOperator, LSExpression, long)
-
gt
public LSExpression gt(long a, LSExpression b)
Creates an inequality expression greater than. This method is a shortcut forcreateExpression(LSOperator.Gt, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Gt
,createExpression(LSOperator, long, LSExpression)
-
gt
public LSExpression gt(LSExpression a, double b)
Creates an inequality expression greater than. This method is a shortcut forcreateExpression(LSOperator.Gt, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Gt
,createExpression(LSOperator, LSExpression, double)
-
gt
public LSExpression gt(double a, LSExpression b)
Creates an inequality expression greater than. This method is a shortcut forcreateExpression(LSOperator.Gt, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Gt
,createExpression(LSOperator, double, LSExpression)
-
lt
public LSExpression lt(LSExpression a, LSExpression b)
Creates an inequality expression less than. This method is a shortcut forcreateExpression(LSOperator.Lt, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Lt
,createExpression(LSOperator, LSExpression, LSExpression)
-
lt
public LSExpression lt(LSExpression a, long b)
Creates an inequality expression less than. This method is a shortcut forcreateExpression(LSOperator.Lt, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Lt
,createExpression(LSOperator, LSExpression, long)
-
lt
public LSExpression lt(long a, LSExpression b)
Creates an inequality expression less than. This method is a shortcut forcreateExpression(LSOperator.Lt, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Lt
,createExpression(LSOperator, long, LSExpression)
-
lt
public LSExpression lt(LSExpression a, double b)
Creates an inequality expression less than. This method is a shortcut forcreateExpression(LSOperator.Lt, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Lt
,createExpression(LSOperator, LSExpression, double)
-
lt
public LSExpression lt(double a, LSExpression b)
Creates an inequality expression less than. This method is a shortcut forcreateExpression(LSOperator.Lt, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Lt
,createExpression(LSOperator, double, LSExpression)
-
iif
public LSExpression iif(LSExpression a, LSExpression b, LSExpression c)
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(LSOperator.If, a, b, c)
.- Since:
- 5.5
- See Also:
LSOperator.If
,createExpression(LSOperator, LSExpression, LSExpression, LSExpression)
-
iif
public LSExpression iif(LSExpression a, LSExpression b, long c)
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(LSOperator.If, a, b, c)
.- Since:
- 5.5
- See Also:
LSOperator.If
,createExpression(LSOperator, LSExpression, LSExpression, long)
-
iif
public LSExpression iif(LSExpression a, long b, LSExpression c)
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(LSOperator.If, a, b, c)
.- Since:
- 5.5
- See Also:
LSOperator.If
,createExpression(LSOperator, LSExpression, long, LSExpression)
-
iif
public LSExpression iif(LSExpression a, long b, long c)
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(LSOperator.If, a, b, c)
.- Since:
- 5.5
- See Also:
LSOperator.If
,createExpression(LSOperator, LSExpression, long, long)
-
iif
public LSExpression iif(LSExpression a, LSExpression b, double c)
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(LSOperator.If, a, b, c)
.- Since:
- 5.5
- See Also:
LSOperator.If
,createExpression(LSOperator, LSExpression, LSExpression, double)
-
iif
public LSExpression iif(LSExpression a, double b, LSExpression c)
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(LSOperator.If, a, b, c)
.- Since:
- 5.5
- See Also:
createExpression(LSOperator, LSExpression, double, LSExpression)
,LSOperator.If
-
iif
public LSExpression iif(LSExpression a, double b, double c)
Creates a ternary conditional expression. This method is a shortcut forcreateExpression(LSOperator.If, a, b, c)
.- Since:
- 5.5
- See Also:
LSOperator.If
,createExpression(LSOperator, LSExpression, double, double)
-
not
public LSExpression not(LSExpression a)
Creates a NOT expression. This method is a shortcut forcreateExpression(LSOperator.Not, a)
.- Since:
- 5.5
- See Also:
LSOperator.Not
,createExpression(LSOperator, LSExpression)
-
and
public LSExpression and()
Creates an AND expression. This method is a shortcut forcreateExpression(LSOperator.And)
.- Since:
- 5.5
- See Also:
LSOperator.And
,createExpression(LSOperator)
-
and
public LSExpression and(LSExpression a)
Creates an AND expression. This method is a shortcut forcreateExpression(LSOperator.And, a)
.- Since:
- 12.5
- See Also:
LSOperator.And
,createExpression(LSOperator, LSExpression)
-
and
public LSExpression and(LSExpression a, LSExpression b)
Creates an AND expression. This method is a shortcut forcreateExpression(LSOperator.And, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.And
,createExpression(LSOperator, LSExpression, LSExpression)
-
and
public LSExpression and(java.lang.Iterable<LSExpression> operands)
Creates an AND expression. This method is a shortcut forcreateExpression(LSOperator.And, operands)
.- Since:
- 5.5
- See Also:
LSOperator.And
,createExpression(LSOperator, Iterable)
-
and
public LSExpression and(LSExpression... operands)
Creates an AND expression. This method is a shortcut forcreateExpression(LSOperator.And, operands)
.- Since:
- 5.5
- See Also:
LSOperator.And
,createExpression(LSOperator, LSExpression...)
-
or
public LSExpression or()
Creates a OR expression. This method is a shortcut forcreateExpression(LSOperator.Or)
.- Since:
- 5.5
- See Also:
LSOperator.Or
,createExpression(LSOperator)
-
or
public LSExpression or(LSExpression a)
Creates a OR expression. This method is a shortcut forcreateExpression(LSOperator.Or, a)
.- Since:
- 12.5
- See Also:
LSOperator.Or
,createExpression(LSOperator, LSExpression)
-
or
public LSExpression or(LSExpression a, LSExpression b)
Creates a OR expression. This method is a shortcut forcreateExpression(LSOperator.Or, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Or
,createExpression(LSOperator, LSExpression, LSExpression)
-
or
public LSExpression or(java.lang.Iterable<LSExpression> operands)
Creates a OR expression. This method is a shortcut forcreateExpression(LSOperator.Or, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Or
,createExpression(LSOperator, Iterable)
-
or
public LSExpression or(LSExpression... operands)
Creates a OR expression. This method is a shortcut forcreateExpression(LSOperator.Or, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Or
,createExpression(LSOperator, LSExpression...)
-
xor
public LSExpression xor()
Creates a XOR expression. This method is a shortcut forcreateExpression(LSOperator.Xor)
.- Since:
- 5.5
- See Also:
LSOperator.Xor
,createExpression(LSOperator)
-
xor
public LSExpression xor(LSExpression a)
Creates a XOR expression. This method is a shortcut forcreateExpression(LSOperator.Xor, a)
.- Since:
- 12.5
- See Also:
LSOperator.Xor
,createExpression(LSOperator, LSExpression)
-
xor
public LSExpression xor(LSExpression... operands)
Creates a XOR expression. This method is a shortcut forcreateExpression(LSOperator.Xor, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Xor
,createExpression(LSOperator, LSExpression...)
-
xor
public LSExpression xor(LSExpression a, LSExpression b)
Creates a XOR expression. This method is a shortcut forcreateExpression(LSOperator.Xor, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Xor
,createExpression(LSOperator, LSExpression, LSExpression)
-
xor
public LSExpression xor(java.lang.Iterable<LSExpression> operands)
Creates a XOR expression. This method is a shortcut forcreateExpression(LSOperator.Xor, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Xor
,createExpression(LSOperator, Iterable)
-
abs
public LSExpression abs(LSExpression a)
Creates an absolute value expression. This method is a shortcut forcreateExpression(LSOperator.Abs, a)
.- Since:
- 5.5
- See Also:
LSOperator.Abs
,createExpression(LSOperator, LSExpression)
-
dist
public LSExpression dist(LSExpression a, LSExpression b)
Creates a distance expression. This method is a shortcut forcreateExpression(LSOperator.Dist, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Dist
,createExpression(LSOperator, LSExpression, LSExpression)
-
dist
public LSExpression dist(LSExpression a, long b)
Creates a distance expression. This method is a shortcut forcreateExpression(LSOperator.Dist, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Dist
,createExpression(LSOperator, LSExpression, long)
-
dist
public LSExpression dist(long a, LSExpression b)
Creates a distance expression. This method is a shortcut forcreateExpression(LSOperator.Dist, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Dist
,createExpression(LSOperator, long, LSExpression)
-
dist
public LSExpression dist(LSExpression a, double b)
Creates a distance expression. This method is a shortcut forcreateExpression(LSOperator.Dist, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Dist
,createExpression(LSOperator, LSExpression, double)
-
dist
public LSExpression dist(double a, LSExpression b)
Creates a distance expression. This method is a shortcut forcreateExpression(LSOperator.Dist, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Dist
,createExpression(LSOperator, double, LSExpression)
-
div
public LSExpression div(LSExpression a, LSExpression b)
Creates a division expression. This method is a shortcut forcreateExpression(LSOperator.Div, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Div
,createExpression(LSOperator, LSExpression, LSExpression)
-
div
public LSExpression div(LSExpression a, long b)
Creates a division expression. This method is a shortcut forcreateExpression(LSOperator.Div, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Div
,createExpression(LSOperator, LSExpression, long)
-
div
public LSExpression div(long a, LSExpression b)
Creates a division expression. This method is a shortcut forcreateExpression(LSOperator.Div, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Div
,createExpression(LSOperator, long, LSExpression)
-
div
public LSExpression div(LSExpression a, double b)
Creates a division expression. This method is a shortcut forcreateExpression(LSOperator.Div, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Div
,createExpression(LSOperator, LSExpression, double)
-
div
public LSExpression div(double a, LSExpression b)
Creates a division expression. This method is a shortcut forcreateExpression(LSOperator.Div, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Div
,createExpression(LSOperator, double, LSExpression)
-
mod
public LSExpression mod(LSExpression a, LSExpression b)
Creates a modulo expression. This method is a shortcut forcreateExpression(LSOperator.Mod, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Mod
,createExpression(LSOperator, LSExpression, LSExpression)
-
mod
public LSExpression mod(LSExpression a, long b)
Creates a modulo expression. This method is a shortcut forcreateExpression(LSOperator.Mod, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Mod
,createExpression(LSOperator, LSExpression, long)
-
mod
public LSExpression mod(long a, LSExpression b)
Creates a modulo expression. This method is a shortcut forcreateExpression(LSOperator.Mod, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Mod
,createExpression(LSOperator, long, LSExpression)
-
array
public LSExpression array()
Creates an array expression. This method is a shortcut forcreateExpression(LSOperator.Array)
.- Since:
- 5.5
- See Also:
LSOperator.Array
,createExpression(LSOperator)
-
array
public LSExpression array(java.lang.Object operands)
Creates an N-dimensional array expression. This method attempts to create array in a recursive way: if an operand is iterable, it will be turned into an array too, and so on.- Since:
- 5.5
- See Also:
LSOperator.Array
-
array
public LSExpression array(int... operands)
Creates an array expression. This method is a shortcut forcreateExpression(LSOperator.Array, operands)
.- Since:
- 7.0
- See Also:
LSOperator.Array
,createExpression(LSOperator, int[])
-
array
public LSExpression array(long... operands)
Creates an array expression. This method is a shortcut forcreateExpression(LSOperator.Array, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Array
,createExpression(LSOperator, long[])
-
array
public LSExpression array(float... operands)
Creates an array expression. This method is a shortcut forcreateExpression(LSOperator.Array, operands)
.- Since:
- 7.0
- See Also:
LSOperator.Array
,createExpression(LSOperator, float[])
-
array
public LSExpression array(double... operands)
Creates an array expression. This method is a shortcut forcreateExpression(LSOperator.Array, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Array
,createExpression(LSOperator, double[])
-
array
public LSExpression array(LSExpression... operands)
Creates an array expression. This method is a shortcut forcreateExpression(LSOperator.Array, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Array
,createExpression(LSOperator, LSExpression... operands)
-
array
public LSExpression array(LSExpression range, LSExpression lambda, long defaultvalue)
Creates an array expression. This method is a shortcut forcreateExpression(LSOperator.Array, operands)
.- Since:
- 12.0
- See Also:
LSOperator.Array
,createExpression(LSOperator, LSExpression, LSExpression, long)
-
array
public LSExpression array(LSExpression range, LSExpression lambda, double defaultvalue)
Creates an array expression. This method is a shortcut forcreateExpression(LSOperator.Array, operands)
.- Since:
- 12.0
- See Also:
LSOperator.Array
,createExpression(LSOperator, LSExpression, LSExpression, double)
-
sort
public LSExpression sort(LSExpression array)
Creates a sorted array, containing the same values as the array given as unique parameter, sorted in ascending order. This method is a shortcut forcreateExpression(LSOperator.Sort, array)
.- Since:
- 11.0
- See Also:
LSOperator.Sort
-
sort
public LSExpression sort(LSExpression array, LSExpression lambda)
Creates a sorted array, containing the same values as the array given as first parameter, sorted in ascending order based on the values returned by the the lambda function given as second parameter. The sort operator guarantees that the order of elements having the same key is preserved. This method is a shortcut forcreateExpression(LSOperator.Sort, array, lambda)
.- Since:
- 12.5
- See Also:
LSOperator.Sort
-
at
public LSExpression at(LSExpression array, LSExpression... indices)
Creates a "at" expression for N-dimensional array. This method is a shortcut forcreateExpression(LSOperator.At, array, indices)
.- Since:
- 5.5
- See Also:
LSOperator.At
,createExpression(LSOperator, LSExpression...)
-
at
public LSExpression at(LSExpression array, long index)
Creates a "at" expression. This method is a shortcut forcreateExpression(LSOperator.At, array, index)
.- Since:
- 5.5
- See Also:
LSOperator.At
,createExpression(LSOperator, LSExpression, long)
-
scalar
public LSExpression scalar(LSExpression a, LSExpression b)
Creates an expression for the scalar product between two arrays. This method is a shortcut forcreateExpression(LSOperator.Scalar, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Scalar
,createExpression(LSOperator, LSExpression, LSExpression)
-
ceil
public LSExpression ceil(LSExpression a)
Creates a ceil expression. This method is a shortcut forcreateExpression(LSOperator.Ceil, a)
.- Since:
- 5.5
- See Also:
LSOperator.Ceil
,createExpression(LSOperator, LSExpression)
-
floor
public LSExpression floor(LSExpression a)
Creates a floor expression. This method is a shortcut forcreateExpression(LSOperator.Floor, a)
.- Since:
- 5.5
- See Also:
LSOperator.Floor
,createExpression(LSOperator, LSExpression)
-
round
public LSExpression round(LSExpression a)
Creates a rounding expression. This method is a shortcut forcreateExpression(LSOperator.Round, a)
.- Since:
- 5.5
- See Also:
LSOperator.Round
,createExpression(LSOperator, LSExpression)
-
sqrt
public LSExpression sqrt(LSExpression a)
Creates a square root expression. This method is a shortcut forcreateExpression(LSOperator.Sqrt, a)
.- Since:
- 5.5
- See Also:
LSOperator.Sqrt
,createExpression(LSOperator, LSExpression)
-
log
public LSExpression log(LSExpression a)
Creates a log expression. This method is a shortcut forcreateExpression(LSOperator.Log, a)
.- Since:
- 5.5
- See Also:
LSOperator.Log
,createExpression(LSOperator, LSExpression)
-
exp
public LSExpression exp(LSExpression a)
Creates an exponential expression. This method is a shortcut forcreateExpression(LSOperator.Exp, a)
.- Since:
- 5.5
- See Also:
LSOperator.Exp
,createExpression(LSOperator, LSExpression)
-
pow
public LSExpression pow(LSExpression a, LSExpression b)
Creates a power expression. This method is a shortcut forcreateExpression(LSOperator.Pow, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Pow
,createExpression(LSOperator, LSExpression, LSExpression)
-
pow
public LSExpression pow(LSExpression a, long b)
Creates a power expression. This method is a shortcut forcreateExpression(LSOperator.Pow, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Pow
,createExpression(LSOperator, LSExpression, long)
-
pow
public LSExpression pow(long a, LSExpression b)
Creates a power expression. This method is a shortcut forcreateExpression(LSOperator.Pow, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Pow
,createExpression(LSOperator, long, LSExpression)
-
pow
public LSExpression pow(LSExpression a, double b)
Creates a power expression. This method is a shortcut forcreateExpression(LSOperator.Pow, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Pow
,createExpression(LSOperator, LSExpression, double)
-
pow
public LSExpression pow(double a, LSExpression b)
Creates a power expression. This method is a shortcut forcreateExpression(LSOperator.Pow, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.Pow
,createExpression(LSOperator, double, LSExpression)
-
cos
public LSExpression cos(LSExpression a)
Creates a cosine expression. This method is a shortcut forcreateExpression(LSOperator.Cos, a)
.- Since:
- 5.5
- See Also:
LSOperator.Cos
,createExpression(LSOperator, LSExpression)
-
sin
public LSExpression sin(LSExpression a)
Creates a sine expression. This method is a shortcut forcreateExpression(LSOperator.Sin, a)
.- Since:
- 5.5
- See Also:
LSOperator.Sin
,createExpression(LSOperator, LSExpression)
-
tan
public LSExpression tan(LSExpression a)
Creates a tangent expression. This method is a shortcut forcreateExpression(LSOperator.Tan, a)
.- Since:
- 5.5
- See Also:
LSOperator.Tan
,createExpression(LSOperator, LSExpression)
-
piecewise
public LSExpression piecewise(LSExpression abscissae, LSExpression ordinates, LSExpression x)
Creates a piecewise linear expression. This method is a shortcut forcreateExpression(LSOperator.Piecewise, abscissae, ordinates, x)
.- Since:
- 5.5
- See Also:
LSOperator.Piecewise
,createExpression(LSOperator, LSExpression, LSExpression, LSExpression)
-
listVar
public LSExpression listVar(long n)
Creates a list decision with the given length. A list is an ordered collection of integers within a range [0, n-1]. This method is a shortcut forcreateExpression(LSOperator.List, n)
.- Parameters:
n
- Collection size.- Since:
- 5.5
- See Also:
LSOperator.List
,createExpression(LSOperator, long)
-
setVar
public LSExpression setVar(long n)
Creates a set decision with the given length. A set is an unordered collection of integers within a domain [0, n-1]. This method is a shortcut forcreateExpression(LSOperator.Set, n)
.- Parameters:
n
- Collection size.- Since:
- 8.0
- See Also:
LSOperator.Set
,createExpression(LSOperator, long)
-
count
public LSExpression count(LSExpression a)
Creates a count expression. This method is a shortcut forcreateExpression(LSOperator.Count, a)
.- Since:
- 5.5
- See Also:
LSOperator.Count
,createExpression(LSOperator, LSExpression)
-
indexOf
public LSExpression indexOf(LSExpression a, long b)
Creates an indexOf expression. This method is a shortcut forcreateExpression(LSOperator.IndexOf, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.IndexOf
,createExpression(LSOperator, LSExpression, long)
-
indexOf
public LSExpression indexOf(LSExpression a, LSExpression b)
Creates an indexOf expression. This method is a shortcut forcreateExpression(LSOperator.IndexOf, a, b)
.- Since:
- 5.5
- See Also:
LSOperator.IndexOf
,createExpression(LSOperator, LSExpression, LSExpression)
-
distinct
public LSExpression distinct(LSExpression a)
Creates an distinct expression. This method is a shortcut forcreateExpression(LSOperator.Distinct, a)
.- Since:
- 12.5
- See Also:
LSOperator.Distinct
,createExpression(LSOperator, LSExpression)
-
distinct
public LSExpression distinct(LSExpression a, LSExpression b)
Creates an distinct expression. This method is a shortcut forcreateExpression(LSOperator.Distinct, a, b)
.- Since:
- 12.5
- See Also:
LSOperator.Distinct
,createExpression(LSOperator, LSExpression, LSExpression)
-
intersection
public LSExpression intersection(LSExpression a, LSExpression b)
Creates an intersection expression. This method is a shortcut forcreateExpression(LSOperator.Intersection, a, b)
.- Since:
- 12.5
- See Also:
LSOperator.Intersection
,createExpression(LSOperator, LSExpression, LSExpression)
-
hull
public LSExpression hull(LSExpression... operands)
Creates a hull expression. This method is a shortcut forcreateExpression(LSOperator.hull, operands)
.- Since:
- 13.0
- See Also:
LSOperator.Hull
,createExpression(LSOperator, LSExpression...)
-
hull
public LSExpression hull(LSExpression array)
Creates a hull expression. This method is a shortcut forcreateExpression(LSOperator.hull, array)
.- Since:
- 13.0
- See Also:
LSOperator.Hull
,createExpression(LSOperator, LSExpression)
-
hull
public LSExpression hull()
Creates a hull expression. This method is a shortcut forcreateExpression(LSOperator.hull)
.- Since:
- 13.0
- See Also:
LSOperator.Hull
,createExpression(LSOperator)
-
contains
public LSExpression contains(LSExpression a, long b)
Creates a contains expression. This method is a shortcut forcreateExpression(LSOperator.Contains, a, b)
.- Since:
- 7.5
- See Also:
LSOperator.Contains
,createExpression(LSOperator, LSExpression, long)
-
contains
public LSExpression contains(LSExpression a, LSExpression b)
Creates a contains expression. This method is a shortcut forcreateExpression(LSOperator.Contains, a, b)
.- Since:
- 7.5
- See Also:
LSOperator.Contains
,createExpression(LSOperator, LSExpression, LSExpression)
-
partition
public LSExpression partition()
Creates a partition expression. This method is a shortcut forcreateExpression(LSOperator.Partition)
.- Since:
- 5.5
- See Also:
LSOperator.Partition
,createExpression(LSOperator)
-
partition
public LSExpression partition(LSExpression... operands)
Creates a partition expression. This method is a shortcut forcreateExpression(LSOperator.Partition, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Partition
,createExpression(LSOperator, LSExpression...)
-
partition
public LSExpression partition(java.lang.Iterable<LSExpression> operands)
Creates a partition expression. This method is a shortcut forcreateExpression(LSOperator.Partition, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Partition
,createExpression(LSOperator, Iterable)
-
partition
public LSExpression partition(LSExpression array)
Creates a partition expression. This method is a shortcut forcreateExpression(LSOperator.Partition, array)
.- Since:
- 10.5
- See Also:
LSOperator.Partition
,createExpression(LSOperator, LSExpression)
-
disjoint
public LSExpression disjoint()
Creates a disjoint expression. This method is a shortcut forcreateExpression(LSOperator.Disjoint)
.- Since:
- 5.5
- See Also:
LSOperator.Disjoint
,createExpression(LSOperator)
-
disjoint
public LSExpression disjoint(LSExpression... operands)
Creates a disjoint expression. This method is a shortcut forcreateExpression(LSOperator.Disjoint, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Disjoint
,createExpression(LSOperator, LSExpression... operands)
-
disjoint
public LSExpression disjoint(java.lang.Iterable<LSExpression> operands)
Creates a disjoint expression. This method is a shortcut forcreateExpression(LSOperator.Disjoint, operands)
.- Since:
- 5.5
- See Also:
LSOperator.Disjoint
,createExpression(LSOperator, Iterable)
-
disjoint
public LSExpression disjoint(LSExpression array)
Creates a disjoint expression. This method is a shortcut forcreateExpression(LSOperator.Disjoint, array)
.- Since:
- 10.5
- See Also:
LSOperator.Disjoint
,createExpression(LSOperator, LSExpression)
-
cover
public LSExpression cover()
Creates a cover expression. This method is a shortcut forcreateExpression(LSOperator.Cover)
.- Since:
- 10.5
- See Also:
LSOperator.Cover
,createExpression(LSOperator)
-
cover
public LSExpression cover(LSExpression... operands)
Creates a cover expression. This method is a shortcut forcreateExpression(LSOperator.Cover, operands)
.- Since:
- 10.5
- See Also:
LSOperator.Cover
,createExpression(LSOperator, LSExpression...)
-
cover
public LSExpression cover(java.lang.Iterable<LSExpression> operands)
Creates a cover expression. This method is a shortcut forcreateExpression(LSOperator.Cover, operands)
.- Since:
- 10.5
- See Also:
LSOperator.Cover
,createExpression(LSOperator, Iterable)
-
cover
public LSExpression cover(LSExpression array)
Creates a cover expression. This method is a shortcut forcreateExpression(LSOperator.Cover, array)
.- Since:
- 10.5
- See Also:
LSOperator.Cover
,createExpression(LSOperator, LSExpression)
-
find
public LSExpression find(LSExpression a, long b)
Creates a find expression. This method is a shortcut forcreateExpression(LSOperator.Find, a, b)
.- Since:
- 10.5
- See Also:
LSOperator.Find
,createExpression(LSOperator, LSExpression, long)
-
find
public LSExpression find(LSExpression a, LSExpression b)
Creates a find expression. This method is a shortcut forcreateExpression(LSOperator.Find, a, b)
.- Since:
- 10.5
- See Also:
LSOperator.Find
,createExpression(LSOperator, LSExpression, LSExpression)
-
intExternalFunction
public LSExpression intExternalFunction(LSIntExternalFunction func)
Creates an external function expression. This method is a shortcut forcreateIntExternalFunction(func)
.- Since:
- 6.0
- See Also:
LSOperator.ExternalFunction
,createIntExternalFunction(localsolver.LSIntExternalFunction)
-
doubleExternalFunction
public LSExpression doubleExternalFunction(LSDoubleExternalFunction func)
Creates an external function expression. This method is a shortcut forcreateDoubleExternalFunction(func)
.
-
intArrayExternalFunction
public LSExpression intArrayExternalFunction(LSIntArrayExternalFunction func)
Creates an external function expression. This method is a shortcut forcreateIntArrayExternalFunction(func)
-
doubleArrayExternalFunction
public LSExpression doubleArrayExternalFunction(LSDoubleArrayExternalFunction func)
Creates an external function expression. This method is a shortcut forcreateDoubleArrayExternalFunction(func)
-
lambdaFunction
public LSExpression lambdaFunction(int nbArgs, LSLambdaFunction functor)
Creates a lambda function expression. This method is a shortcut forcreateLambdaFunction(nbArgs, functor)
.- Since:
- 9.5
- See Also:
LSOperator.LambdaFunction
,createLambdaFunction(int, LSLambdaFunction)
-
lambdaFunction
public LSExpression lambdaFunction(LSLambdaFunction0 functor)
Creates a lambda function expression. This method is a shortcut forcreateLambdaFunction(functor)
.- Since:
- 9.5
- See Also:
LSOperator.LambdaFunction
,createLambdaFunction(LSLambdaFunction0)
-
lambdaFunction
public LSExpression lambdaFunction(LSLambdaFunction1 functor)
Creates a lambda function expression. This method is a shortcut forcreateLambdaFunction(functor)
.- Since:
- 9.5
- See Also:
LSOperator.LambdaFunction
,createLambdaFunction(LSLambdaFunction1)
-
lambdaFunction
public LSExpression lambdaFunction(LSLambdaFunction2 functor)
Creates a lambda function expression. This method is a shortcut forcreateLambdaFunction(functor)
.- Since:
- 9.5
- See Also:
LSOperator.LambdaFunction
,createLambdaFunction(LSLambdaFunction2)
-
lambdaFunction
public LSExpression lambdaFunction(LSLambdaFunction3 functor)
Creates a lambda function expression. This method is a shortcut forcreateLambdaFunction(functor)
.- Since:
- 9.5
- See Also:
LSOperator.LambdaFunction
,createLambdaFunction(LSLambdaFunction3)
-
call
public LSExpression call()
Creates a call expression. The first operand must be a function of typeLSOperator.LambdaFunction
orLSOperator.ExternalFunction
. The other operands may be LSExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(LSOperator.Call)
.- Since:
- 6.0
- See Also:
LSOperator.Call
,createExpression(LSOperator)
-
call
public LSExpression call(LSExpression a)
Creates a call expression. The first operand must be a function of typeLSOperator.LambdaFunction
orLSOperator.ExternalFunction
. The other operands may be LSExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(LSOperator.Call)
.- Since:
- 6.0
- See Also:
LSOperator.Call
,createExpression(LSOperator, LSExpression)
-
call
public LSExpression call(LSExpression a, LSExpression b)
Creates a call expression. The first operand must be a function of typeLSOperator.LambdaFunction
orLSOperator.ExternalFunction
. The other operands may be LSExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(LSOperator.Call)
.- Since:
- 6.0
- See Also:
LSOperator.Call
,createExpression(LSOperator, LSExpression, LSExpression)
-
call
public LSExpression call(LSExpression a, LSExpression b, LSExpression c)
Creates a call expression. The first operand must be a function of typeLSOperator.LambdaFunction
orLSOperator.ExternalFunction
. The other operands may be LSExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(LSOperator.Call)
.- Since:
- 6.0
- See Also:
LSOperator.Call
,createExpression(LSOperator, LSExpression, LSExpression, LSExpression)
-
call
public LSExpression call(LSExpression... operands)
Creates a call expression. The first operand must be a function of typeLSOperator.LambdaFunction
orLSOperator.ExternalFunction
. The other operands may be LSExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(LSOperator.Call)
.- Since:
- 6.0
- See Also:
LSOperator.Call
,createExpression(LSOperator, LSExpression...)
-
call
public LSExpression call(java.lang.Iterable<LSExpression> operands)
Creates a call expression. The first operand must be a function of typeLSOperator.LambdaFunction
orLSOperator.ExternalFunction
. The other operands may be LSExpressions, booleans, integers, and doubles. They are passed to the function as arguments. This method is a shortcut forcreateExpression(LSOperator.Call)
.- Since:
- 6.0
- See Also:
LSOperator.Call
,createExpression(LSOperator, Iterable)
-
range
public LSExpression range(LSExpression a, LSExpression b)
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive). This method is a shortcut forcreateExpression(LSOperator.Range, a, b)
.- Since:
- 7.0
- See Also:
LSOperator.Range
,createExpression(LSOperator, LSExpression, LSExpression)
-
range
public LSExpression range(LSExpression a, long b)
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive). This method is a shortcut forcreateExpression(LSOperator.Range, a, b)
.- Since:
- 7.0
- See Also:
LSOperator.Range
,createExpression(LSOperator, LSExpression, long)
-
range
public LSExpression range(long a, LSExpression b)
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive). This method is a shortcut forcreateExpression(LSOperator.Range, a, b)
.- Since:
- 7.0
- See Also:
LSOperator.Range
,createExpression(LSOperator, long, LSExpression)
-
range
public LSExpression range(long a, long b)
Creates a range expression, where a is the lower bound (inclusive) and b is the upper bound (exclusive). This method is a shortcut forcreateExpression(LSOperator.Range, a, b)
.- Since:
- 7.0
- See Also:
LSOperator.Range
,createExpression(LSOperator, long, long)
-
getNbExpressions
public int getNbExpressions()
Gets the number of expressions added to this model.- Returns:
- Number of expressions.
-
getExpression
public LSExpression getExpression(int exprIndex)
Gets the expression with the given index in this model.- Parameters:
exprIndex
- Index of the expression.- Returns:
- Expression with the given index.
-
getExpression
public LSExpression getExpression(java.lang.String name)
Gets the expression with the given index in this model.- Parameters:
name
- Name of the expression.- Returns:
- Expression with the given index.
-
getNbDecisions
public int getNbDecisions()
Gets the number of decisions in the model. This corresponds to the number of decision variables declared in the model.- Returns:
- Number of decisions.
-
getDecision
public LSExpression getDecision(int decisionIndex)
Gets the decision with the given index.- Parameters:
decisionIndex
- Index of the decision.- Returns:
- Decision with the given index.
-
addConstraint
public void addConstraint(LSExpression expr)
Adds the given expression to the list of constraints. It means that the value of this expression must be constrained to be equal to 1 in any solution found by the solver. Hence, only boolean expressions (that is, expressions whose value is boolean) can be constrained. Only allowed in stateLSState.Modeling
. If the expression is already a constraint, this method does nothing and returns immediately.- Parameters:
expr
- Expression.
-
constraint
public void constraint(LSExpression expr)
Shortcut for addConstraint(expr).- Parameters:
expr
- Expression.- Since:
- 5.5
- See Also:
addConstraint(localsolver.LSExpression)
-
removeConstraint
public void removeConstraint(LSExpression expr)
Removes the given expression from the list of constraints. If the expression was not constrained, this method does nothing and returns immediately. Only allowed in stateLSState.Modeling
.- Parameters:
expr
- Expression.- Since:
- 5.0
-
removeConstraint
public void removeConstraint(int constraintIndex)
Removes the constraint at the given position in the list of constraints. Only allowed in stateLSState.Modeling
.- Parameters:
constraintIndex
- position of the constraint to remove.- Since:
- 5.0
-
getNbConstraints
public int getNbConstraints()
Gets the number of constraints added to this model.- Returns:
- Number of constraints.
-
getConstraint
public LSExpression getConstraint(int constraintIndex)
Gets the constraint with the given index.- Parameters:
constraintIndex
- Index of the constraint.- Returns:
- Constraint with the given index.
-
addObjective
public void addObjective(LSExpression expr, LSObjectiveDirection direction)
Adds the given expression to the list of objectives to optimize. A same expression can be added more than once. Only allowed in stateLSState.Modeling
. Note that the objectives will be optimized in the order in which they have been added to the model. It is useful for lexicographic multiobjective optimization, and more particularly for goal programming.- Parameters:
expr
- Expression.direction
- Optimization direction of this objective.
-
minimize
public void minimize(LSExpression expr)
Shortcut for addObjective(expr, OD_Minimize).- Parameters:
expr
- Expression.- Since:
- 5.5
- See Also:
addObjective(localsolver.LSExpression, localsolver.LSObjectiveDirection)
-
maximize
public void maximize(LSExpression expr)
Shortcut for addObjective(expr, OD_Maximize).- Parameters:
expr
- Expression.- Since:
- 5.5
- See Also:
addObjective(localsolver.LSExpression, localsolver.LSObjectiveDirection)
-
removeObjective
public void removeObjective(int objectiveIndex)
Removes the objective at the given position in the list of objectives. Note that the objectives created after the removed one have their index decreased by 1. Phases are not modified when an objective is removed. It is the user's responsibility to change the objective index of each phase to keep it coherent (withLSPhase.setOptimizedObjective(int)
), or to disable it (withLSPhase.setEnabled(boolean)
). Only allowed in stateLSState.Modeling
.- Parameters:
objectiveIndex
- position of the objective to remove.- Since:
- 5.0
-
getNbObjectives
public int getNbObjectives()
Gets the number of objectives added to this model.- Returns:
- Number of objectives.
-
getObjective
public LSExpression getObjective(int objectiveIndex)
Gets the objective with the given index.- Parameters:
objectiveIndex
- Index of the objective.- Returns:
- Objective with the given index.
-
getObjectiveDirection
public LSObjectiveDirection getObjectiveDirection(int objectiveIndex)
Gets the direction of the objective with the given index.- Parameters:
objectiveIndex
- Index of the objective.- Returns:
- Objective direction.
-
getNbOperands
public int getNbOperands()
Gets the number of operands in the model. This corresponds to the number of operands for all expressions declared in the model. It is an analog of the number of non zeros in matrix model encountered in mathematical programming: it gives an hint about the size and the density of your model.- Returns:
- Number of operands.
-
close
public void close()
Closes the model. Only allowed in stateLSState.Modeling
. When this method is called, the solver is placed in stateLSState.Stopped
. Once the model is closed, no expressions, constraints or objectives can be added or removed unless the model is reopened. The model must be closed before starting its resolution.
-
open
public void open()
Reopens the model. Only allowed in stateLSState.Stopped
. When this method is called, the solver is placed in stateLSState.Modeling
. In this state, the model can be modified: it is possible to add new expressions, constraints or objectives, modify expression operands, and remove existing constraints and objectives. However, existing expressions cannot be deleted. Note that the solution will be reset when the model is closed again.
-
isClosed
public boolean isClosed()
Returns true if the model is closed, false otherwise.- Returns:
- True if the model is closed.
-
toString
public java.lang.String toString()
Returns a String representation of this model. This representation provides:- The number of expressions, decisions, constraints, and objectives.
- The density of the model.
- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-