Re: [ojAlgo-user] addLinearExpression java.lang.IllegalArgumentException: Must be a row vector!
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2011-06-26 08:23:41
|
That looks like a bug. I'll have to think about which is the correct fix. Until I release a fixed version, creating an empty linear expression should work: Expression tmpLinExpr = addEmptyLinearExpression("LinearExpression"); tmpLinExpr.setLinearFactor(0, ...); tmpLinExpr.setLinearFactor(1, ...); tmpLinExpr.setLinearFactor(2, ...); tmpLinExpr.setLinearFactor(3, ...); /Anders On 24 jun 2011, at 13.56, Luke Lindsay wrote: > What is the correct way to create a row vector for > ExpressionsBasedModel.addLinearExpression? The code below throws an > excecption: > > LinearExpressionsModel model = new LinearExpressionsModel(vars); > Access1D a1d = Array1D.makePrimitive(2); > model.addLinearExpression("LinearExpression", a1d); > > Must be a row vector! > java.lang.IllegalArgumentException: Must be a row vector! > at org.ojalgo.function.multiary.LinearFunction.<init>(LinearFunction.java:91) > at org.ojalgo.function.multiary.LinearFunction.makeBig(LinearFunction.java:39) > at org.ojalgo.optimisation.Expression.makeLinear(Expression.java:70) > at org.ojalgo.optimisation.ExpressionsBasedModel.addLinearExpression(ExpressionsBasedModel.java:160) > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense.. > http://p.sf.net/sfu/splunk-d2d-c1 > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > |