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 21:35:13
|
I have now released v30.1 that should fix that problem. /Anders On 26 jun 2011, at 10.23, Anders Peterson wrote: > 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 >> >> > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > |