[ojAlgo-user] How do I use OJALGO to solve an ExpressionBasedModel with absolute constraints on var
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anthony E. <ant...@al...> - 2015-02-17 13:33:32
|
Hi I am doing a simple expression based model but wish to add a constraint to the model such that the sum of absolute values of the variables must equal a fixed value. I can see that I can do like this ... final Expression tmpBalanceExpression = model.addExpression("balance"); for (int i = 0; i < vars.length; i++) { tmpBalanceExpression.setLinearFactor(i, ONE); } ... to set the total value of all the variables to 1, but how can I set the sum of the absolute values of those variables to a value? Any ideas? Thanks Tony |