Re: [ojAlgo-user] Auto-discard notification
Mathematics, linear algebra and optimisation
Brought to you by:
apete
From: Anders P. <an...@op...> - 2008-11-20 09:29:36
|
Could you please check which e-mail address your using? It seems you're not using one that is a member of this list. There are two aspects of this problem: 1) ojAlgo has numerical difficulties when solving this problem (actually with several of your problems). ojAlgo doesn't produce solutions as good as Matlab's. With poor intermediate (sub-problem) solutions it is difficult to conclude if the main algorithm should stop iterating or not... By tweaking the stop-criteria I can get the algorithm to exit normally and produce a solution - just not a very good one - and this without breaking any other existing unit tests. Guess this is ok... 2) v25.0 had a bug that gave you an ArrayIndexOutOfBoundsException instead of just exiting with state "FAILED". This is fixed now. On 19 nov 2008, at 18.15, oja...@li... wrote: > Matlab comes up with: > > x = > > 0.00000000000000 > 0.01750000000000 > -0.01750000000000 > 1.46389524463679 > 5.00000000000000 > 4.87681260745493 > 4.45803387299108 > -6.77235264210831 > 0.22574508859158 ojAlgo can only produce something like this: x = {{5.340576172E-5}, {0.01749420166016}, {-0.0174560546875}, {1.4642539024353}, {4.99999952316284}, {4.87466540336609}, {4.46074233874029}, {-6.7764671657036}, {0.2258822393782}} > -----Original Message----- >> From: Anders Peterson [mailto:an...@op...] > Sent: 19. november 2008 16:00 > To: Anders Peterson > Subject: Re: [ojAlgo-user] Auto-discard notification > > What solution do you get from Matlab in this case? /Anders > > On 19 nov 2008, at 13.04, oja...@li... > wrote: > >> The attached message has been automatically discarded. >> Date: onsdag 19 nov 2008 13.03.33 GMT+01:00 >> To: "'oja...@li...'" <ojalgo- >> us...@li...> >> Subject: RE: [ojAlgo-user] ojAlgo v25 >> >> >> >> Hi, I've tested the v25 ActiveSetSolver. >> >> I triggered an ArrayIndexOutOfBoundsException that I did not >> encounter in v24.11: >> >> Exception in thread "main" >> java.lang.ArrayIndexOutOfBoundsException: 2 >> at >> org.ojalgo.optimisation.quadratic.ActiveSetSolver.needsAnotherIterati >> o >> n(ActiveSetSolver.java:230) >> at org.ojalgo.optimisation.quadratic.QuadraticSolver.solve >> (QuadraticSolver..java:144) >> >> Here is an example that will reproduce the exception: >> >> >> import org.ojalgo.matrix.BasicMatrix; >> import org.ojalgo.matrix.PrimitiveMatrix; >> import org.ojalgo.optimisation.OptimisationSolver.Result; >> import org.ojalgo.optimisation.quadratic.ActiveSetSolver; >> >> public class QPTest { >> >> public static void main(String[] args) { >> new QPTest(); >> } >> >> public QPTest() { >> >> BasicMatrix[] system = new BasicMatrix[6]; >> //{[AE], [be], [Q], [c], [AI], [bi]} >> >> double[][] AE = new double[][]{{-10.630019918689772, >> 0.15715259580856766, -24.006889886456438, -3.4914813388431334E-15, >> 0.9987922086746552, 0.9018272287390979, 1.0, 0.0, 0.0}, >> {-3.711451617763614E-14, -3.1946032406211518, 50.10466796063192, >> 1.0, 0.04913373475326318, 0.4320968057099691, 0.0, 1.0, 0.0}, >> {-1.1134354853290842E-12, 94.42372385635744, -1719.2020477970657, >> 30.0, -10.463141920669791, -4.8464591126471905, 0.0, 0.0, 1.0}}; >> >> system[0] = PrimitiveMatrix.FACTORY.copy(AE); // AE >> system[1] = PrimitiveMatrix.FACTORY.copy(new double[][] >> {{14.272908058664967}, {-3.888270819999793}, >> {-0.06992907379067503}}); // be >> system[2] = PrimitiveMatrix.FACTORY.buildEye(9, 9); // Q >> system[2] = system[2].set(3, 3, 10); >> system[2] = system[2].set(4, 4, 10); >> system[2] = system[2].set(5, 5, 10); >> system[2] = system[2].set(6, 6, 1000000000); >> system[2] = system[2].set(7, 7, 1000000000); >> system[2] = system[2].set(8, 8, 1000000000); >> system[3] = PrimitiveMatrix.FACTORY.copy(new double[][]{{0}, {0}, >> {0}, {1}, {1}, {-1}, {0}, {0}, {0}}); // c >> >> double[][] Ain = new double[18][9]; >> >> for(int i = 0; i < 9; i++) { >> Ain[i][i] = 1; >> Ain[i+9][i] = -1; >> } >> >> system[4] = PrimitiveMatrix.FACTORY.copy(Ain); // AI >> >> double[][] bin = new double[][]{{0}, {0.0175}, {0.0175}, {5}, >> {5}, {5}, {100000}, {100000}, {100000}, {0}, {0.0175}, {0.0175}, >> {5}, {5}, {5}, {100000}, {100000}, {100000}}; >> >> system[5] = PrimitiveMatrix.FACTORY.copy(bin); // bi >> >> >> ActiveSetSolver as = new ActiveSetSolver(system); >> Result res = as.solve(); >> System.out.println("state: " + res.getState()); >> print("sol", res.getSolution()); >> >> } >> } >> >> - Oddvar > > > ---------------------------------------------------------------------- > --- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > |