Re: [ojAlgo-user] Bug in ConvexSolver with inequality constraints but no equality constraints
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2015-09-23 06:52:07
|
There is no need to report issues both here and at GitHub. https://github.com/optimatika/ojAlgo/issues/10 > On 22 sep 2015, at 20:46, Anders Peterson <an...@op...> wrote: > > Do you think this was the same problem? > > https://sourceforge.net/p/ojalgo/mailman/message/34442573/ > > > >> On 22 sep 2015, at 18:09, Harsha Veeramachaneni <hv...@gm...> wrote: >> >> Hi, >> >> I recently upgraded to v38.2 of Ojalgo for solving some quadratic programs. It seems that somewhere in the code there is an assumption that whenever there are inequality constraints there must be at least one equality constraint. My problem has a bunch of inequality constraints but no equality constraints and running it gives a "divide by zero" error. Again, this only seems to manifest itself when there are inequality constraints but no equality constraints. >> >> I have reproduced it below with a simple example. >> >> scala> val P = Array(Array(1.0, 0), Array(0, 1.0)) >> >> val c = Array(0.0, 0.0) >> >> val Q = PrimitiveDenseStore.FACTORY.rows(P:_*).builder().build() >> >> val C = PrimitiveDenseStore.FACTORY.columns(c).builder().build() >> >> val myBuilderI = new ConvexSolver.Builder(Q, C) >> >> val ai = Array(Array(1.0, 1.0)) >> >> val rhs = Array(1.0) >> >> myBuilderI.inequalities(PrimitiveDenseStore.FACTORY.rows(ai:_*).builder().build(), PrimitiveDenseStore.FACTORY.columns(rhs).builder().build()) >> >> val prob = myBuilderI.build() >> >> val solved = prob.solve() >> >> scala> java.lang.ArithmeticException: / by zero >> >> at org.ojalgo.matrix.store.PrimitiveDenseStore.fillByMultiplying(PrimitiveDenseStore.java:1199) >> >> at org.ojalgo.matrix.store.MatrixStore.multiply(MatrixStore.java:438) >> >> at org.ojalgo.matrix.store.MatrixStore.multiply(MatrixStore.java:432) >> >> at org.ojalgo.optimisation.convex.ActiveSetSolver.performIteration(ActiveSetSolver.java:412) >> >> at org.ojalgo.optimisation.convex.ConvexSolver.solve(ConvexSolver.java:310) >> >> at org.ojalgo.optimisation.Optimisation$Solver.solve(Optimisation.java:383) >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> ojAlgo-user mailing list >> ojA...@li... >> https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > |