ojalgo-user Mailing List for oj! Algorithms (Page 5)
Mathematics, linear algebra and optimisation
Brought to you by:
apete
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
(1) |
Mar
|
Apr
(14) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2005 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(3) |
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
(5) |
Sep
|
Oct
(3) |
Nov
(4) |
Dec
(2) |
2007 |
Jan
(8) |
Feb
(1) |
Mar
(2) |
Apr
(11) |
May
(6) |
Jun
|
Jul
(10) |
Aug
(2) |
Sep
|
Oct
(4) |
Nov
|
Dec
(11) |
2008 |
Jan
(22) |
Feb
(4) |
Mar
(2) |
Apr
(4) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(6) |
Nov
(17) |
Dec
(5) |
2009 |
Jan
(15) |
Feb
(2) |
Mar
(2) |
Apr
(3) |
May
(4) |
Jun
(5) |
Jul
(9) |
Aug
(2) |
Sep
|
Oct
(5) |
Nov
(14) |
Dec
|
2010 |
Jan
(3) |
Feb
(5) |
Mar
(2) |
Apr
(19) |
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(5) |
Nov
(3) |
Dec
|
2011 |
Jan
|
Feb
(1) |
Mar
(7) |
Apr
(10) |
May
(1) |
Jun
(15) |
Jul
(1) |
Aug
|
Sep
|
Oct
(13) |
Nov
(9) |
Dec
(11) |
2012 |
Jan
|
Feb
(1) |
Mar
(9) |
Apr
(23) |
May
(16) |
Jun
(9) |
Jul
(13) |
Aug
|
Sep
(4) |
Oct
(1) |
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(12) |
Mar
(7) |
Apr
(24) |
May
|
Jun
(7) |
Jul
(4) |
Aug
|
Sep
(3) |
Oct
(16) |
Nov
(7) |
Dec
(3) |
2014 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
(3) |
Jul
(4) |
Aug
(4) |
Sep
(1) |
Oct
(2) |
Nov
(6) |
Dec
(2) |
2015 |
Jan
(11) |
Feb
(10) |
Mar
(1) |
Apr
(9) |
May
|
Jun
|
Jul
(1) |
Aug
(4) |
Sep
(6) |
Oct
(3) |
Nov
(15) |
Dec
(4) |
2016 |
Jan
(6) |
Feb
|
Mar
(18) |
Apr
(5) |
May
(9) |
Jun
(3) |
Jul
(5) |
Aug
(2) |
Sep
(5) |
Oct
(2) |
Nov
|
Dec
(5) |
2017 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
|
May
(12) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(3) |
Oct
(1) |
Nov
|
Dec
(1) |
2018 |
Jan
(5) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(4) |
Aug
(1) |
Sep
(8) |
Oct
|
Nov
|
Dec
(1) |
2019 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Anders P. <an...@op...> - 2016-03-15 22:18:46
|
There is a new snapshot build v39.7 available at sourceforge: https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/ Currently all test cases related to convex optimisation pass. Could you try it? /Anders > On 9 mars 2016, at 10:45, Nico Potyka <Nic...@gm...> wrote: > > Sorry, I forgot to turn validation off. After turning validation off, there is no exception and it often says KKT system unsolvable as you already suspected. > > > Gesendet: Mittwoch, 09. März 2016 um 10:39 Uhr > Von: "Nico Potyka" <Nic...@gm...> > An: oja...@li... > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > Thanks for all the hints. When I activate the debugging mode I actually get an exception: > > Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite! > > However, there is no exception without the debugging mode. I actually check the result for optimality with > > Result result = tmpModel.minimise(); > if(result.getState() == Optimisation.State.OPTIMAL) { > ... > > So it seems that the solver regards the computed solutions indeed as optimal. > > > I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract > a straightforward example that shows this behaviour. You can find the project in the SVN repository > > ssh://svn.code.sf.net/p/kreator-ide/code/ > > in the folder > > Software/Log4KR > > The test case is in the class > > /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java > > The problematic optimization problem is defined in the class > > /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java > > in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example, > I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37 > and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to > find some time to extract a straightforward example. > > Best wishes > Nico > > > > Gesendet: Dienstag, 08. März 2016 um 12:59 Uhr > Von: "Anders Peterson" <an...@op...> > An: oja...@li... > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > When you do > > tmpModel.options.debug(ConvexSolver.class); > > it turns on debugging of that solver AND validation of the model/solver data. > > It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off. > > tmpModel.options.validate = false; > > > With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”? > > Are the solutions you get feasible, but not (always) optimal? > > > I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE. > > > Still interested in getting some test case from you. > > > /Anders > > > > > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote: > > > > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you. > > > > Best regards > > Nico > > > > > > > > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr > > Von: "Anders Peterson" <an...@op...> > > An: oja...@li... > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > A common QP should be ok with v39.0 - I’d very much like to know what problems you have. > > > > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method. > > > > If you can construct a test case using ExpressionsBasedModel, that would be better. > > > > /Anders > > > > > > > > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote: > > > > > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time. > > > > > > Thanks for the hints on debugging. > > > > > > > > > > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr > > > Von: "Anders Peterson" <an...@op...> > > > An: oja...@li... > > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > > Do you have integer variables? > > > > > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.) > > > > > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”. > > > > > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you. > > > > > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that. > > > > > > Are you aware that you can get debug output from the solvers? > > > Do this: > > > > > > model.options.debug(ConvexSolver.class); > > > > > > > > > If you don’t have any other way to construct a test case, you can try this: > > > > > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy. > > > > > > > > > /Anders > > > > > > > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote: > > > > > > > > Hi everybody, > > > > > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm? > > > > > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated. > > > > > > > > Best > > > > Nico > > > > ------------------------------------------------------------------------------ > > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > > Monitor end-to-end web transactions and take corrective actions now > > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > > ojAlgo-user mailing list > > > > ojA...@li... > > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > > > > ------------------------------------------------------------------------------ > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > Monitor end-to-end web transactions and take corrective actions now > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > > > _______________________________________________ > > > ojAlgo-user mailing list > > > ojA...@li... > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > Monitor end-to-end web transactions and take corrective actions now > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > ojAlgo-user mailing list > > > ojA...@li... > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > ------------------------------------------------------------------------------ > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > Monitor end-to-end web transactions and take corrective actions now > > Troubleshoot faster and improve end-user experience. Signup Now! > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > > _______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > ------------------------------------------------------------------------------ > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > Monitor end-to-end web transactions and take corrective actions now > > Troubleshoot faster and improve end-user experience. Signup Now! > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://makebettercode.com/inteldaal-eval > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Nico P. <Nic...@gm...> - 2016-03-09 09:45:36
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Sorry, I forgot to turn validation off. After turning validation off, there is no exception and it often says KKT system unsolvable as you already suspected.</div> <div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Mittwoch, 09. März 2016 um 10:39 Uhr<br/> <b>Von:</b> "Nico Potyka" <Nic...@gm...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div name="quoted-content"> <div style="font-family: Verdana;font-size: 12.0px;"> <div> <div>Thanks for all the hints. When I activate the debugging mode I actually get an exception:</div> <div> </div> <div> Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite!</div> <div> </div> <div>However, there is no exception without the debugging mode. I actually check the result for optimality with</div> <div> </div> <div> Result result = tmpModel.minimise();<br/> if(result.getState() == Optimisation.State.OPTIMAL) {</div> <div> ...</div> <div> </div> <div>So it seems that the solver regards the computed solutions indeed as optimal.</div> <div> </div> <div> </div> <div>I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract</div> <div>a straightforward example that shows this behaviour. You can find the project in the SVN repository</div> <div> </div> <div> ssh://svn.code.sf.net/p/kreator-ide/code/</div> <div> </div> <div>in the folder</div> <div> </div> <div> Software/Log4KR</div> <div> </div> <div>The test case is in the class</div> <div> </div> <div> /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java</div> <div>The problematic optimization problem is defined in the class</div> <div> </div> <div> /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java</div> <div> </div> <div>in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example,</div> <div>I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37</div> <div>and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to</div> <div>find some time to extract a straightforward example.</div> <div> </div> <div>Best wishes</div> <div>Nico</div> <div> </div> <div> </div> <div> <div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);"> <div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Dienstag, 08. März 2016 um 12:59 Uhr<br/> <b>Von:</b> "Anders Peterson" <an...@op...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div>When you do<br/> <br/> tmpModel.options.debug(ConvexSolver.class);<br/> <br/> it turns on debugging of that solver AND validation of the model/solver data.<br/> <br/> It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off.<br/> <br/> tmpModel.options.validate = false;<br/> <br/> <br/> With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”?<br/> <br/> Are the solutions you get feasible, but not (always) optimal?<br/> <br/> <br/> I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE.<br/> <br/> <br/> Still interested in getting some test case from you.<br/> <br/> <br/> /Anders<br/> <br/> <br/> <br/> > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote:<br/> ><br/> > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you.<br/> ><br/> > Best regards<br/> > Nico<br/> ><br/> ><br/> ><br/> > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr<br/> > Von: "Anders Peterson" <an...@op...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > A common QP should be ok with v39.0 - I’d very much like to know what problems you have.<br/> ><br/> > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method.<br/> ><br/> > If you can construct a test case using ExpressionsBasedModel, that would be better.<br/> ><br/> > /Anders<br/> ><br/> ><br/> ><br/> > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote:<br/> > ><br/> > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time.<br/> > ><br/> > > Thanks for the hints on debugging.<br/> > ><br/> > ><br/> > ><br/> > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr<br/> > > Von: "Anders Peterson" <an...@op...><br/> > > An: oja...@li...<br/> > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > Do you have integer variables?<br/> > ><br/> > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.)<br/> > ><br/> > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”.<br/> > ><br/> > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you.<br/> > ><br/> > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that.<br/> > ><br/> > > Are you aware that you can get debug output from the solvers?<br/> > > Do this:<br/> > ><br/> > > model.options.debug(ConvexSolver.class);<br/> > ><br/> > ><br/> > > If you don’t have any other way to construct a test case, you can try this:<br/> > ><br/> > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy.<br/> > ><br/> > ><br/> > > /Anders<br/> > ><br/> > ><br/> > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote:<br/> > > ><br/> > > > Hi everybody,<br/> > > ><br/> > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm?<br/> > > ><br/> > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated.<br/> > > ><br/> > > > Best<br/> > > > Nico<br/> > > > ------------------------------------------------------------------------------<br/> > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ><br/> > ><br/> > > ------------------------------------------------------------------------------<br/> > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > Monitor end-to-end web transactions and take corrective actions now<br/> > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > _______________________________________________<br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ------------------------------------------------------------------------------<br/> > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > Monitor end-to-end web transactions and take corrective actions now<br/> > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> ><br/> ><br/> > ------------------------------------------------------------------------------<br/> > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > Monitor end-to-end web transactions and take corrective actions now<br/> > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > _______________________________________________<br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------<br/> > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > Monitor end-to-end web transactions and take corrective actions now<br/> > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> <br/> <br/> ------------------------------------------------------------------------------<br/> Transform Data into Opportunity.<br/> Accelerate data analysis in your applications with<br/> Intel Data Analytics Acceleration Library.<br/> Click to learn more.<br/> <a href="http://makebettercode.com/inteldaal-eval" target="_blank">http://makebettercode.com/inteldaal-eval</a><br/> _______________________________________________<br/> ojAlgo-user mailing list<br/> ojA...@li...<br/> <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div> </div> ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. <a href="http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140_______________________________________________</a> ojAlgo-user mailing list ojA...@li... <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div></div></body></html> |
From: Nico P. <Nic...@gm...> - 2016-03-09 09:39:50
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Thanks for all the hints. When I activate the debugging mode I actually get an exception:</div> <div> </div> <div> Exception in thread "main" java.lang.IllegalArgumentException: Q must be positive semidefinite!</div> <div> </div> <div>However, there is no exception without the debugging mode. I actually check the result for optimality with</div> <div> </div> <div> Result result = tmpModel.minimise();<br/> if(result.getState() == Optimisation.State.OPTIMAL) {</div> <div> ...</div> <div> </div> <div>So it seems that the solver regards the computed solutions indeed as optimal.</div> <div> </div> <div> </div> <div>I would love to send you a simple test case, but the example is rather complex and I currently don't find time to extract</div> <div>a straightforward example that shows this behaviour. You can find the project in the SVN repository</div> <div> </div> <div> ssh://svn.code.sf.net/p/kreator-ide/code/</div> <div> </div> <div>in the folder</div> <div> </div> <div> Software/Log4KR</div> <div> </div> <div>The test case is in the class</div> <div> </div> <div> /Log4KR/sourceExamples/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityReasoningExamples.java</div> <div>The problematic optimization problem is defined in the class</div> <div> </div> <div> /Log4KR/src/edu/cs/ai/log4KR/structuredLogics/priorityReasoning/PriorityEntailment2Norm.java</div> <div> </div> <div>in the method initialize. The ExpressionBasedModel is initialized in line 87. If you want to try with this example,</div> <div>I can give you more details. Then you might also want to check out revision 3911, which still contained Ojalgo37</div> <div>and worked fine. Of course, I don't expect that you do because the example is rather complex. However, I will try to</div> <div>find some time to extract a straightforward example.</div> <div> </div> <div>Best wishes</div> <div>Nico</div> <div> </div> <div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Dienstag, 08. März 2016 um 12:59 Uhr<br/> <b>Von:</b> "Anders Peterson" <an...@op...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div name="quoted-content">When you do<br/> <br/> tmpModel.options.debug(ConvexSolver.class);<br/> <br/> it turns on debugging of that solver AND validation of the model/solver data.<br/> <br/> It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off.<br/> <br/> tmpModel.options.validate = false;<br/> <br/> <br/> With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”?<br/> <br/> Are the solutions you get feasible, but not (always) optimal?<br/> <br/> <br/> I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE.<br/> <br/> <br/> Still interested in getting some test case from you.<br/> <br/> <br/> /Anders<br/> <br/> <br/> <br/> > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote:<br/> ><br/> > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you.<br/> ><br/> > Best regards<br/> > Nico<br/> ><br/> ><br/> ><br/> > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr<br/> > Von: "Anders Peterson" <an...@op...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > A common QP should be ok with v39.0 - I’d very much like to know what problems you have.<br/> ><br/> > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method.<br/> ><br/> > If you can construct a test case using ExpressionsBasedModel, that would be better.<br/> ><br/> > /Anders<br/> ><br/> ><br/> ><br/> > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote:<br/> > ><br/> > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time.<br/> > ><br/> > > Thanks for the hints on debugging.<br/> > ><br/> > ><br/> > ><br/> > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr<br/> > > Von: "Anders Peterson" <an...@op...><br/> > > An: oja...@li...<br/> > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > > Do you have integer variables?<br/> > ><br/> > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.)<br/> > ><br/> > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”.<br/> > ><br/> > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you.<br/> > ><br/> > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that.<br/> > ><br/> > > Are you aware that you can get debug output from the solvers?<br/> > > Do this:<br/> > ><br/> > > model.options.debug(ConvexSolver.class);<br/> > ><br/> > ><br/> > > If you don’t have any other way to construct a test case, you can try this:<br/> > ><br/> > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy.<br/> > ><br/> > ><br/> > > /Anders<br/> > ><br/> > ><br/> > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote:<br/> > > ><br/> > > > Hi everybody,<br/> > > ><br/> > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm?<br/> > > ><br/> > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated.<br/> > > ><br/> > > > Best<br/> > > > Nico<br/> > > > ------------------------------------------------------------------------------<br/> > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > > Monitor end-to-end web transactions and take corrective actions now<br/> > > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > > ojAlgo-user mailing list<br/> > > > ojA...@li...<br/> > > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ><br/> > ><br/> > > ------------------------------------------------------------------------------<br/> > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > Monitor end-to-end web transactions and take corrective actions now<br/> > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > > _______________________________________________<br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > > ------------------------------------------------------------------------------<br/> > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > Monitor end-to-end web transactions and take corrective actions now<br/> > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> ><br/> ><br/> > ------------------------------------------------------------------------------<br/> > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > Monitor end-to-end web transactions and take corrective actions now<br/> > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > _______________________________________________<br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------<br/> > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > Monitor end-to-end web transactions and take corrective actions now<br/> > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> <br/> <br/> ------------------------------------------------------------------------------<br/> Transform Data into Opportunity.<br/> Accelerate data analysis in your applications with<br/> Intel Data Analytics Acceleration Library.<br/> Click to learn more.<br/> <a href="http://makebettercode.com/inteldaal-eval" target="_blank">http://makebettercode.com/inteldaal-eval</a><br/> _______________________________________________<br/> ojAlgo-user mailing list<br/> ojA...@li...<br/> <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div></div></body></html> |
From: Anders P. <an...@op...> - 2016-03-08 11:59:49
|
When you do tmpModel.options.debug(ConvexSolver.class); it turns on debugging of that solver AND validation of the model/solver data. It’s very common that it actually is possible to solve a model even if validation fails, but then you have to turn validation off. tmpModel.options.validate = false; With debugging ON and validation OFF what do you see in the log? Does it often say “KKT system unsolvable!”? Are the solutions you get feasible, but not (always) optimal? I believe I found a glitch that could be the cause of your problems, and probably some code changes from a couple of versions back is (partly) the cause. This is not purely a bug - it’s a behaviour change that may affect some models. Even if my current guess/analysis is correct I’m not sure how to restore (your) previous behaviour. If nothing else, when this happens, the solver should not mark the returned solution as OPTIMAL but just FEASIBLE. Still interested in getting some test case from you. /Anders > On 3 mars 2016, at 14:04, Nico Potyka <Nic...@gm...> wrote: > > The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you. > > Best regards > Nico > > > > Gesendet: Donnerstag, 03. März 2016 um 11:46 Uhr > Von: "Anders Peterson" <an...@op...> > An: oja...@li... > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > A common QP should be ok with v39.0 - I’d very much like to know what problems you have. > > Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method. > > If you can construct a test case using ExpressionsBasedModel, that would be better. > > /Anders > > > > > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote: > > > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time. > > > > Thanks for the hints on debugging. > > > > > > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr > > Von: "Anders Peterson" <an...@op...> > > An: oja...@li... > > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > > Do you have integer variables? > > > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.) > > > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”. > > > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you. > > > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that. > > > > Are you aware that you can get debug output from the solvers? > > Do this: > > > > model.options.debug(ConvexSolver.class); > > > > > > If you don’t have any other way to construct a test case, you can try this: > > > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy. > > > > > > /Anders > > > > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote: > > > > > > Hi everybody, > > > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm? > > > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated. > > > > > > Best > > > Nico > > > ------------------------------------------------------------------------------ > > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > > Monitor end-to-end web transactions and take corrective actions now > > > Troubleshoot faster and improve end-user experience. Signup Now! > > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > > ojAlgo-user mailing list > > > ojA...@li... > > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > > > > ------------------------------------------------------------------------------ > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > Monitor end-to-end web transactions and take corrective actions now > > Troubleshoot faster and improve end-user experience. Signup Now! > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > > _______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > ------------------------------------------------------------------------------ > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > Monitor end-to-end web transactions and take corrective actions now > > Troubleshoot faster and improve end-user experience. Signup Now! > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Nico P. <Nic...@gm...> - 2016-03-03 13:04:35
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>The problem is that the computed optimum differs significantly from the one computed with version 37. Actually the result computed with version 37 seems to be the correct one. I don't know if the solver's output will be of any help because the final solution is obtained by a sequence of quadratic optimization problems, where the optimum of one problem serves as a bound for the next problem and I am currently not sure at which stage the problem is caused. However, I will try to reconstruct the problem with a simpler example and send it to you.</div> <div> </div> <div>Best regards</div> <div>Nico</div> <div> </div> <div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Donnerstag, 03. März 2016 um 11:46 Uhr<br/> <b>Von:</b> "Anders Peterson" <an...@op...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div name="quoted-content">A common QP should be ok with v39.0 - I’d very much like to know what problems you have.<br/> <br/> Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method.<br/> <br/> If you can construct a test case using ExpressionsBasedModel, that would be better.<br/> <br/> /Anders<br/> <br/> <br/> <br/> > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote:<br/> ><br/> > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time.<br/> ><br/> > Thanks for the hints on debugging.<br/> ><br/> ><br/> ><br/> > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr<br/> > Von: "Anders Peterson" <an...@op...><br/> > An: oja...@li...<br/> > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37<br/> > Do you have integer variables?<br/> ><br/> > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.)<br/> ><br/> > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”.<br/> ><br/> > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you.<br/> ><br/> > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that.<br/> ><br/> > Are you aware that you can get debug output from the solvers?<br/> > Do this:<br/> ><br/> > model.options.debug(ConvexSolver.class);<br/> ><br/> ><br/> > If you don’t have any other way to construct a test case, you can try this:<br/> ><br/> > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy.<br/> ><br/> ><br/> > /Anders<br/> ><br/> ><br/> > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote:<br/> > ><br/> > > Hi everybody,<br/> > ><br/> > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm?<br/> > ><br/> > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated.<br/> > ><br/> > > Best<br/> > > Nico<br/> > > ------------------------------------------------------------------------------<br/> > > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > > Monitor end-to-end web transactions and take corrective actions now<br/> > > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > > ojAlgo-user mailing list<br/> > > ojA...@li...<br/> > > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> ><br/> ><br/> > ------------------------------------------------------------------------------<br/> > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > Monitor end-to-end web transactions and take corrective actions now<br/> > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> > _______________________________________________<br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> > ------------------------------------------------------------------------------<br/> > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > Monitor end-to-end web transactions and take corrective actions now<br/> > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> <br/> <br/> ------------------------------------------------------------------------------<br/> Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> Monitor end-to-end web transactions and take corrective actions now<br/> Troubleshoot faster and improve end-user experience. Signup Now!<br/> <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> _______________________________________________<br/> ojAlgo-user mailing list<br/> ojA...@li...<br/> <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div></div></body></html> |
From: Anders P. <an...@op...> - 2016-03-03 10:46:42
|
A common QP should be ok with v39.0 - I’d very much like to know what problems you have. Just set a breakpoint anywhere where you have a solver instance, and send me the output of the solver’s toString() method. If you can construct a test case using ExpressionsBasedModel, that would be better. /Anders > On 2 mars 2016, at 11:46, Nico Potyka <Nic...@gm...> wrote: > > No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time. > > Thanks for the hints on debugging. > > > > Gesendet: Dienstag, 01. März 2016 um 23:51 Uhr > Von: "Anders Peterson" <an...@op...> > An: oja...@li... > Betreff: Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37 > Do you have integer variables? > > Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.) > > The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”. > > If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you. > > If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that. > > Are you aware that you can get debug output from the solvers? > Do this: > > model.options.debug(ConvexSolver.class); > > > If you don’t have any other way to construct a test case, you can try this: > > Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy. > > > /Anders > > > > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote: > > > > Hi everybody, > > > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm? > > > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated. > > > > Best > > Nico > > ------------------------------------------------------------------------------ > > Site24x7 APM Insight: Get Deep Visibility into Application Performance > > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > > Monitor end-to-end web transactions and take corrective actions now > > Troubleshoot faster and improve end-user experience. Signup Now! > > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > > ojAlgo-user mailing list > > ojA...@li... > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Nico P. <Nic...@gm...> - 2016-03-02 10:46:31
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>No, it's a common constrained quadratic programming problem (quadratic objective function and linear inequalities). I will try to onstruct a simple test case that shows the error, but it will take some time. <div> <div> </div> <div>Thanks for the hints on debugging.</div> <div> </div> <div> </div> <div> </div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Dienstag, 01. März 2016 um 23:51 Uhr<br/> <b>Von:</b> "Anders Peterson" <an...@op...><br/> <b>An:</b> oja...@li...<br/> <b>Betreff:</b> Re: [ojAlgo-user] Behaviour of ExpressionBasedModel since OjAlgo37</div> <div name="quoted-content">Do you have integer variables?<br/> <br/> Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.)<br/> <br/> The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”.<br/> <br/> If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you.<br/> <br/> If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that.<br/> <br/> Are you aware that you can get debug output from the solvers?<br/> Do this:<br/> <br/> model.options.debug(ConvexSolver.class);<br/> <br/> <br/> If you don’t have any other way to construct a test case, you can try this:<br/> <br/> Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy.<br/> <br/> <br/> /Anders<br/> <br/> <br/> > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote:<br/> ><br/> > Hi everybody,<br/> ><br/> > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm?<br/> ><br/> > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated.<br/> ><br/> > Best<br/> > Nico<br/> > ------------------------------------------------------------------------------<br/> > Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> > Monitor end-to-end web transactions and take corrective actions now<br/> > Troubleshoot faster and improve end-user experience. Signup Now!<br/> > <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________</a><br/> > ojAlgo-user mailing list<br/> > ojA...@li...<br/> > <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a><br/> <br/> <br/> ------------------------------------------------------------------------------<br/> Site24x7 APM Insight: Get Deep Visibility into Application Performance<br/> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month<br/> Monitor end-to-end web transactions and take corrective actions now<br/> Troubleshoot faster and improve end-user experience. Signup Now!<br/> <a href="http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140</a><br/> _______________________________________________<br/> ojAlgo-user mailing list<br/> ojA...@li...<br/> <a href="https://lists.sourceforge.net/lists/listinfo/ojalgo-user" target="_blank">https://lists.sourceforge.net/lists/listinfo/ojalgo-user</a></div> </div> </div> </div></div></body></html> |
From: Anders P. <an...@op...> - 2016-03-01 23:09:15
|
Do you have integer variables? Do you use the v39.0 release one of the v39.X snapshots? (Really should be named v40-SNAPSHOT or something like that.) The new algorithm I mentioned earlier on this list is only in the snapshots, and it’s for QP (convex) problems only. v39.0 should be all improvements and no “experiments”. If you are using v39.0 and believe you get incorrect results I would appreciate it if you put together a test case (the smallest possible). Otherwise I don’t know how to help you. If you are running one of the snapshots and want to switch to the “old” algorithm you have to modify the build() method of the ConvexSolver.Builder class. In it you should replace IterativeMixedASS and IterativePureASS with DirectMixedASS and DirectPureASS respectively. Further I just uploaded a snapshot named v39.5, use that. Are you aware that you can get debug output from the solvers? Do this: model.options.debug(ConvexSolver.class); If you don’t have any other way to construct a test case, you can try this: Running in a debugger; set a breakpoint in the solve(…) method of ExpressionsBasdModel right after the solver has been instantiated. If you simply “select” the local variable tmpSolver the debugger will display its toString() output - it will print the matrices used by the solver. I can construct test cases from that relatively easy. /Anders > On 1 mars 2016, at 17:01, Nico Potyka <Nic...@gm...> wrote: > > Hi everybody, > > I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm? > > I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated. > > Best > Nico > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Nico P. <Nic...@gm...> - 2016-03-01 16:01:45
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi everybody,</div> <div> </div> <div>I use OjAlgo's ExpressionBasedModel to solve some quadratic programming problems. It worked really well in version 37, but I noted some strange behaviour after switching to version 38.2. The ExpressionBasedModel behaved highly non-deterministically in the sense that the same problem can sometimes be solved optimally, sometimes only approximately and sometimes cannot be solved at all. In fact, even when the solution is supposed to be optimal, the results can differ significantly (like more than 100% deviation). After realizing that these problems were caused by the change of version, I switched to version 39. Now the ExpressionBasedModel behaves completely deterministically, but I still get some weird results. I suppose that these problems are related to the new algorithm in ojAlgo. Is there a way to use the old algorithm?</div> <div> </div> <div>I could also send the example if it helps for debugging. However, it is part of a bigger project and depends on several other classes, so it might be too complicated.</div> <div> </div> <div>Best</div> <div>Nico</div></div></body></html> |
From: Anders P. <an...@op...> - 2016-01-25 14:10:28
|
The snapshot version v39.3 is now available at SourceForge. > https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/ Compared to the v39.1 snapshot a couple of test cases has been “fixed” and performance has been improved further. Based on what I’ve seen so far this new solver will be included in the next release, one way or another, even if I can’t fix all the test cases. It’s just so much quicker. /Anders > On 12 jan. 2016, at 14:35, Anders Peterson <an...@op...> wrote: > > v39.1 (v40-SNAPSHOT) has just been uploaded to the snapshot folder at SourceForge. > > https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/ > > It contains a modified ConvexSolver that scales much better than the previous version. With larger optimisation models (thousands of variables) it is an order of magnitude faster (and produces significantly less garbage). The downside is that there is now a handfull of test cases that fail. I have not yet fully understood the details of why they fail or what (if anything) can be done to fix it. > > Please try the new ConvexSolver and report how it works for you to this list. > > /Anders |
From: Anders P. <an...@op...> - 2016-01-21 08:01:27
|
If you want to se what goes on then run the code in a debugger. I’m guessing you have very complex structures inside your BasicMatrix instances because you create them “incorrectly” (repeated updates to individual elements). > Y.get(U_i, P_i, C_i).doubleValue(); That line of code indicates that you extract something other than a ‘double’ from the BasicMatrix instances - why? I recommended you before to switch to using PrimitiveDenseStore or maybe even ArrayAnyD<Double> instead of BasicMatrix. Why didn’t you? Did you read? https://github.com/optimatika/ojAlgo/wiki/Getting-Started /Anders > On 20 jan. 2016, at 17:40, Stathis Maroulis <sta...@gm...> wrote: > > Hi, > I am trying to create a Tensor API using Ojalgo as backend. > Actually a 3D Tensor is an Arraylist of BasicMatrix objects. > To get element i,j,k from a tensor, I actually getting the i,j entry from the k-th oject on the arraylist. > If i try to loop through all elements of these BasicMatrix object, the time i need is noticeable more or using Java double[][] arrays. > E.g. accessing all element(using a triple-loop) of a 2000x20000x10 (10 BasicMatrix objects of dimension 2000x20000), i need hours(!!!!) of waiting, while will Java double[][] i need seconds... > (This is the arraylist i got: > ArrayList<BasicMatrix> tensor; > and this is how to get the items: > Y.get(U_i, P_i, C_i).doubleValue(); > ) > > Is this behavior normal? Am I doing something wrong? > Thanks in advance. > Stathis > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Stathis M. <sta...@gm...> - 2016-01-20 16:40:31
|
Hi, I am trying to create a Tensor API using Ojalgo as backend. Actually a 3D Tensor is an Arraylist of BasicMatrix objects. To get element i,j,k from a tensor, I actually getting the i,j entry from the k-th oject on the arraylist. If i try to loop through all elements of these BasicMatrix object, the time i need is noticeable more or using Java double[][] arrays. E.g. accessing all element(using a triple-loop) of a 2000x20000x10 (10 BasicMatrix objects of dimension 2000x20000), i need hours(!!!!) of waiting, while will Java double[][] i need seconds... (This is the arraylist i got: ArrayList<BasicMatrix> tensor; and this is how to get the items: Y.get(U_i, P_i, C_i).doubleValue(); ) Is this behavior normal? Am I doing something wrong? Thanks in advance. Stathis |
From: Anders P. <an...@op...> - 2016-01-18 07:14:57
|
You need Java 8 to build the master branch. Install Java 8 or switch to the Java7 branch. /Anders > On 18 jan. 2016, at 07:17, Xue-Feng Yang <jus...@ya...> wrote: > > Thanks. > > Xuefeng > > [INFO] Compiling 436 source files to C:\Programs\ojAlgo-master\target\classes > [INFO] ------------------------------------------------------------------------ > [INFO] BUILD FAILURE > [INFO] ------------------------------------------------------------------------ > [INFO] Total time: 7.185 s > [INFO] Finished at: 2016-01-18T00:59:38-05:00 > [INFO] Final Memory: 16M/244M > [INFO] ------------------------------------------------------------------------ > [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ojalgo: Fatal error compiling: invalid target release: 1.8 -> [Help 1] > [ERROR] > [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > [ERROR] > [ERROR] For more information about the errors and possible solutions, please read the following articles: > [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Xue-Feng Y. <jus...@ya...> - 2016-01-18 06:20:24
|
Thanks. Xuefeng [INFO] Compiling 436 source files to C:\Programs\ojAlgo-master\target\classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 7.185 s [INFO] Finished at: 2016-01-18T00:59:38-05:00 [INFO] Final Memory: 16M/244M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ojalgo: Fatal error compiling: invalid target release: 1.8 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException |
From: Anders P. <an...@op...> - 2016-01-12 13:35:23
|
v39.1 (v40-SNAPSHOT) has just been uploaded to the snapshot folder at SourceForge. https://sourceforge.net/projects/ojalgo/files/ojAlgo/snapshot/ It contains a modified ConvexSolver that scales much better than the previous version. With larger optimisation models (thousands of variables) it is an order of magnitude faster (and produces significantly less garbage). The downside is that there is now a handfull of test cases that fail. I have not yet fully understood the details of why they fail or what (if anything) can be done to fix it. Please try the new ConvexSolver and report how it works for you to this list. /Anders |
From: Anders P. <an...@op...> - 2015-12-16 15:24:32
|
I reorganized the wiki today and at the same time I added a page about building ojAlgo - explaining about the Ant and Maven scripts. https://github.com/optimatika/ojAlgo/wiki/Building > On 14 dec. 2015, at 22:11, Anders Peterson <an...@op...> wrote: > > The unit tets are not run as part of any build system - Ant or Maven. They’re executed separately during development. I use eclipse and have a junit run configurtion that I use. It would surprise me if other IDE:s don’t have similar functionality. > > The class org.ojalgo.FunctionalityTest has a main method you can use to run the tests. > > Those 2 Ant targets junit_functionality_test, junit_performance_compare are not used. I had forgot they were there. > > > I set up the Maven build solely to be able to upload maven artefacts to the central repository - never was a goal to have “continuous integration”. > > > Have nothing against making the tests part of the maven lifecycle - I suppose they should be - but the tests would have be reworked a bit. There are tests using random input (that sometimes fail) and with the optimisation solvers I’d like to keep test cases that currently cannot be solved. > > > /Anders > > > >> On 14 dec. 2015, at 21:10, Daren Drummond <dar...@ya...> wrote: >> >> I figured out my mvn install problem. Apparently I had some old junky versions of some pom.xml files in my local repo. Deleting and running mvn install fixed the problem. These are the files I deleted: >> >> rm -rf ~/.m2/repository/org/codehaus/plexus/plexus-archiver/2.0.1 >> rm -rf ~/.m2/repository/org/apache/maven/maven-archiver/2.4.2 >> >> I would still like to know the right way to run the unit tests though. It looks like I'm supposed to do that with ant. Running: >> >> ant junit_functionality_test >> >> produces: >> >> ojAlgo/build.xml:75: The <classpath> for <junit> must include junit.jar if not in Ant's own classpath >> >> I don't mind taking a guess as to how to set up the test environment, but it would be nice to just follow a recipe. Finally, is there any reason why the tests don't execute as part of the maven lifecycle? Is there any interest in getting them to run as part of the Maven lifecycle? I wouldn't mind setting that up. >> >> Thanks, >> >> Daren >> >> From: Daren Drummond <dar...@ya...> >> To: "oja...@li..." <oja...@li...> >> Sent: Monday, December 14, 2015 10:55 AM >> Subject: build and test instructions for ojalgo? >> >> Hello! >> >> Can someone point me to some instructions on how to build and run the unit tests? I don't see any build and test instructions in the readme files or on the wiki or mailing list archive. Is see both a maven pom.xml file and an ant build.xml file, however the default maven install and ant target commands fail for me. >> >> I checked out branch v39 and ran: >> >> mvn install >> >> which fails with: >> >> [INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ ojalgo --- >> [WARNING] The POM for org.apache.maven:maven-archiver:jar:2.4.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details >> [WARNING] The POM for org.codehaus.plexus:plexus-archiver:jar:2.0.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details >> Dec 14, 2015 6:43:22 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn >> WARNING: Error injecting: org.apache.maven.plugin..jar.JarMojo >> java.lang.NoClassDefFoundError: Lorg/codehaus/plexus/archiver/jar/JarArchiver; >> at java.lang.Class.getDeclaredFields0(Native Method) >> at java.lang.Class.privateGetDeclaredFields(Class.java:2570) >> at java.lang.Class.getDeclaredFields(Class.java:1903) >> at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:651) >> .....<big stack trace here> ... >> Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.archiver.jar.JarArchiver >> at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) >> at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244) >> at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230) >> ... 57 more >> >> Also running the default ant target fails: >> >> dist: >> [delete] Deleting directory /Users/ddrummond/dev/ojAlgo/target >> [mkdir] Created dir: /Users/ddrummond/dev/ojAlgo/target >> >> BUILD FAILED >> /Users/ddrummond/dev/ojAlgo/build.xml:167: /Users/ddrummond/dev/ojAlgo/bin does not exist. >> >> About my system: >> Maven 3.0.4 >> Apache Ant(TM) version 1.9.6 compiled on June 29 2015 >> Java version: 1.8.0_05, vendor: Oracle Corporation >> Default locale: en_US, platform encoding: UTF-8 >> OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac" >> >> Thanks in advance! >> >> Cheers, >> >> Daren >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> 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 |
From: Anders P. <an...@op...> - 2015-12-14 21:12:04
|
The unit tets are not run as part of any build system - Ant or Maven. They’re executed separately during development. I use eclipse and have a junit run configurtion that I use. It would surprise me if other IDE:s don’t have similar functionality. The class org.ojalgo.FunctionalityTest has a main method you can use to run the tests. Those 2 Ant targets junit_functionality_test, junit_performance_compare are not used. I had forgot they were there. I set up the Maven build solely to be able to upload maven artefacts to the central repository - never was a goal to have “continuous integration”. Have nothing against making the tests part of the maven lifecycle - I suppose they should be - but the tests would have be reworked a bit. There are tests using random input (that sometimes fail) and with the optimisation solvers I’d like to keep test cases that currently cannot be solved. /Anders > On 14 dec. 2015, at 21:10, Daren Drummond <dar...@ya...> wrote: > > I figured out my mvn install problem. Apparently I had some old junky versions of some pom.xml files in my local repo. Deleting and running mvn install fixed the problem. These are the files I deleted: > > rm -rf ~/.m2/repository/org/codehaus/plexus/plexus-archiver/2.0.1 > rm -rf ~/.m2/repository/org/apache/maven/maven-archiver/2.4.2 > > I would still like to know the right way to run the unit tests though. It looks like I'm supposed to do that with ant. Running: > > ant junit_functionality_test > > produces: > > ojAlgo/build.xml:75: The <classpath> for <junit> must include junit.jar if not in Ant's own classpath > > I don't mind taking a guess as to how to set up the test environment, but it would be nice to just follow a recipe. Finally, is there any reason why the tests don't execute as part of the maven lifecycle? Is there any interest in getting them to run as part of the Maven lifecycle? I wouldn't mind setting that up. > > Thanks, > > Daren > > From: Daren Drummond <dar...@ya...> > To: "oja...@li..." <oja...@li...> > Sent: Monday, December 14, 2015 10:55 AM > Subject: build and test instructions for ojalgo? > > Hello! > > Can someone point me to some instructions on how to build and run the unit tests? I don't see any build and test instructions in the readme files or on the wiki or mailing list archive. Is see both a maven pom.xml file and an ant build.xml file, however the default maven install and ant target commands fail for me. > > I checked out branch v39 and ran: > > mvn install > > which fails with: > > [INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ ojalgo --- > [WARNING] The POM for org.apache.maven:maven-archiver:jar:2.4.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details > [WARNING] The POM for org.codehaus.plexus:plexus-archiver:jar:2.0.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details > Dec 14, 2015 6:43:22 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn > WARNING: Error injecting: org.apache.maven.plugin..jar.JarMojo > java.lang.NoClassDefFoundError: Lorg/codehaus/plexus/archiver/jar/JarArchiver; > at java.lang.Class.getDeclaredFields0(Native Method) > at java.lang.Class.privateGetDeclaredFields(Class.java:2570) > at java.lang.Class.getDeclaredFields(Class.java:1903) > at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:651) > .....<big stack trace here> ... > Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.archiver.jar.JarArchiver > at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) > at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244) > at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230) > ... 57 more > > Also running the default ant target fails: > > dist: > [delete] Deleting directory /Users/ddrummond/dev/ojAlgo/target > [mkdir] Created dir: /Users/ddrummond/dev/ojAlgo/target > > BUILD FAILED > /Users/ddrummond/dev/ojAlgo/build.xml:167: /Users/ddrummond/dev/ojAlgo/bin does not exist. > > About my system: > Maven 3.0.4 > Apache Ant(TM) version 1.9.6 compiled on June 29 2015 > Java version: 1.8.0_05, vendor: Oracle Corporation > Default locale: en_US, platform encoding: UTF-8 > OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac" > > Thanks in advance! > > Cheers, > > Daren > > > ------------------------------------------------------------------------------ > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Daren D. <dar...@ya...> - 2015-12-14 20:13:22
|
I figured out my mvn install problem. Apparently I had some old junky versions of some pom.xml files in my local repo. Deleting and running mvn install fixed the problem. These are the files I deleted: rm -rf ~/.m2/repository/org/codehaus/plexus/plexus-archiver/2.0.1rm -rf ~/.m2/repository/org/apache/maven/maven-archiver/2.4.2 I would still like to know the right way to run the unit tests though. It looks like I'm supposed to do that with ant. Running: ant junit_functionality_test produces: ojAlgo/build.xml:75: The <classpath> for <junit> must include junit.jar if not in Ant's own classpath I don't mind taking a guess as to how to set up the test environment, but it would be nice to just follow a recipe. Finally, is there any reason why the tests don't execute as part of the maven lifecycle? Is there any interest in getting them to run as part of the Maven lifecycle? I wouldn't mind setting that up. Thanks, Daren From: Daren Drummond <dar...@ya...> To: "oja...@li..." <oja...@li...> Sent: Monday, December 14, 2015 10:55 AM Subject: build and test instructions for ojalgo? Hello! Can someone point me to some instructions on how to build and run the unit tests? I don't see any build and test instructions in the readme files or on the wiki or mailing list archive. Is see both a maven pom.xml file and an ant build.xml file, however the default maven install and ant target commands fail for me. I checked out branch v39 and ran: mvn install which fails with: [INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ ojalgo ---[WARNING] The POM for org.apache.maven:maven-archiver:jar:2.4.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details[WARNING] The POM for org.codehaus.plexus:plexus-archiver:jar:2.0.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more detailsDec 14, 2015 6:43:22 PM org.sonatype.guice.bean.reflect.Logs$JULSink warnWARNING: Error injecting: org.apache.maven.plugin.jar.JarMojojava.lang.NoClassDefFoundError: Lorg/codehaus/plexus/archiver/jar/JarArchiver;at java.lang.Class.getDeclaredFields0(Native Method)at java.lang.Class.privateGetDeclaredFields(Class.java:2570)at java.lang.Class.getDeclaredFields(Class.java:1903)at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:651).....<big stack trace here> ...Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.archiver.jar.JarArchiverat org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)... 57 more Also running the default ant target fails: dist: [delete] Deleting directory /Users/ddrummond/dev/ojAlgo/target [mkdir] Created dir: /Users/ddrummond/dev/ojAlgo/target BUILD FAILED/Users/ddrummond/dev/ojAlgo/build.xml:167: /Users/ddrummond/dev/ojAlgo/bin does not exist. About my system: Maven 3.0.4Apache Ant(TM) version 1.9.6 compiled on June 29 2015Java version: 1.8.0_05, vendor: Oracle CorporationDefault locale: en_US, platform encoding: UTF-8OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac" Thanks in advance! Cheers, Daren |
From: Daren D. <dar...@ya...> - 2015-12-14 18:58:30
|
Hello! Can someone point me to some instructions on how to build and run the unit tests? I don't see any build and test instructions in the readme files or on the wiki or mailing list archive. Is see both a maven pom.xml file and an ant build.xml file, however the default maven install and ant target commands fail for me. I checked out branch v39 and ran: mvn install which fails with: [INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ ojalgo ---[WARNING] The POM for org.apache.maven:maven-archiver:jar:2.4.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details[WARNING] The POM for org.codehaus.plexus:plexus-archiver:jar:2.0.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more detailsDec 14, 2015 6:43:22 PM org.sonatype.guice.bean.reflect.Logs$JULSink warnWARNING: Error injecting: org.apache.maven.plugin.jar.JarMojojava.lang.NoClassDefFoundError: Lorg/codehaus/plexus/archiver/jar/JarArchiver;at java.lang.Class.getDeclaredFields0(Native Method)at java.lang.Class.privateGetDeclaredFields(Class.java:2570)at java.lang.Class.getDeclaredFields(Class.java:1903)at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:651).....<big stack trace here> ...Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.archiver.jar.JarArchiverat org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)... 57 more Also running the default ant target fails: dist: [delete] Deleting directory /Users/ddrummond/dev/ojAlgo/target [mkdir] Created dir: /Users/ddrummond/dev/ojAlgo/target BUILD FAILED/Users/ddrummond/dev/ojAlgo/build.xml:167: /Users/ddrummond/dev/ojAlgo/bin does not exist. About my system: Maven 3.0.4Apache Ant(TM) version 1.9.6 compiled on June 29 2015Java version: 1.8.0_05, vendor: Oracle CorporationDefault locale: en_US, platform encoding: UTF-8OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac" Thanks in advance! Cheers, Daren |
From: Anders P. <an...@op...> - 2015-11-29 10:32:13
|
Download from SourceForge. https://sourceforge.net/projects/ojalgo/files/ojAlgo/v39/ The Central (Maven) Repository: http://search.maven.org/#artifactdetails%7Corg.ojalgo%7Cojalgo%7C39.0%7Cjar One of the major new features is the ability to write solver integrations to ExpressionsBasedModel. ojAlgo contains pure Java LP, QP and MIP solvers. They’re great alternatives for when you need pure Java solvers. However, they cannot handle the largest most numerically challenging problems that state-of-the-art commercial solvers can (those are not written in Java). Now you can start modelling, and solving, your problem using ojAlgo. When/if you find that ojAlgo can’t handle your problem (fast enough) you may switch to any of those commercial solvers. In terms of your java code you do that switch with 1 line of code. For example, to start using CPLEX rather than the built in ojAlgo solvers you would simply do. ExpressionsBasedModel.addIntegration(SolverCPLEX.INTEGRATION); Optimatika initiated work on 3 commercial solver integrations: CPLEX, Gurobi and Mosek. The integration code is available at GitHub. https://github.com/optimatika/ojSolverCPLEX https://github.com/optimatika/ojSolverGurobi https://github.com/optimatika/ojSolverMosek View the entire changelog for v39 (since v38): https://github.com/optimatika/ojAlgo/wiki/v39 |
From: Anders P. <an...@op...> - 2015-11-14 22:58:31
|
> On 14 nov. 2015, at 18:27, Uga Buga <mmo...@gm...> wrote: > > Thanks Anders > > When it comes to the z-score I am having difficulties implementing your suggestion. > I have the data in a PhysicalStore as it will require matrix operations, so the methods (sliceColumn) you've used arent available, and it isn't obvious what's the best way to do this then. I’ve just now checked in code that will make any MatrixStore “sliceable” just like Array2D > Should I load in my data into an Array2D first, normalize it, then convert it into a PhysicalStore? How? Would that workflow be efficient? (will be processing GBs of data) Any Access2D instance can be wrapped in a MatrixStore implementation using: MatrixStore.PRIMITIVE.makeWrapper(Access2D<?>); > I've tried this, but it didn't work: I've created a PhysicalStore instance from the normalized Array2D, via physicalFactory.columns(tmpArray2D). But that flattened the 2D data into 1D. It is also unclear if this method allocates new memory, IE creates a copy, or if it just somehow changes the external representation of the same data. > Any ideas? You should do: physicalFactory.copy(tmpArray2D) The method you used will treat the entire “ tmpArray2D” as one column. > PS: ojAlgo would disproportionately benefit from a proper tutorial covering workflow and real world uses, beyond the basic 'getting started' ones on GitHub. > > Martin > > On Thu, Nov 12, 2015 at 4:35 PM, Anders Peterson <an...@op...> wrote: > > > On 12 nov. 2015, at 10:59, Uga Buga <mmo...@gm...> wrote: > > > > Hi Guys > > > > 1) What is the fastest way of getting the diagonal elements of a (square) matrix? > > (IE extract all the diagonal elements in a square matrix into a vector)? > > The way I've solved it 'manually' was like this: > > > > double [] diagonal = new double [(int) myMatrix.countColumns()]; > > for(int i = 0; i < diagonal.length; i++) diagonal[i] = (double) myMatrix.get(i, i); > > > > Is there a better/faster (built-in) way of achieving the same thing? > > (it should give the same results as diag() in R ) > > If what you have is a BasicMatrix or a MatrixStore then that’s what you need to do. It’s not slow or bad - it’s just that you had to code it yourself. > > You should do > > myMatrix.doubleValue(i, i); > > instead of > > (double) myMatrix.get(i, i); > > > If you have an Array2D instead, then you can to this: > > Array2D<Double> tmpArray2D = … ; > Array1D<Double> tmpMainDiagonal = tmpArray2D.sliceDiagonal(0, 0); > double[] tmpRawCopyOfMainDiagonal = tmpMainDiagonal.toRawCopy(); > > > > > 2) What is the fastest way to standardise columns or rows? (also known as Z-score, where each entry is part of a standard normal distribution with mean 0, variance 1) > > There is no direct (1-step) way to do this, but you can get some help: > > Array2D<Double> tmpArray2D = … ; > for (long j = 0L; j < tmpArray2D.countColumns(); j++) { > Array1D<Double> tmpColumn = tmpArray2D.sliceColumn(0L, j); > SampleSet tmpSampleSet = SampleSet.wrap(tmpColumn); > double tmpMean = tmpSampleSet.getMean(); > double tmpStdDev = tmpSampleSet..getStandardDeviation(); > tmpColumn.modifyAll(new PrimitiveFunction.Unary() { > > public double invoke(final double arg) { > return (arg - tmpMean) / tmpStdDev; > } > }); > } > > > > > > > > > > > > Thanks > > Martin > > > > PS: (I've had some problems subscribing so this message may be sent twice, so if this message appears twice admins can delete the first one) > > ------------------------------------------------------------------------------ > > _______________________________________________ > > ojAlgo-user mailing list > > ojAlgo-user@lists..sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/ojalgo-user > > > ------------------------------------------------------------------------------ > _______________________________________________ > 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 |
From: Uga B. <mmo...@gm...> - 2015-11-14 17:27:52
|
Thanks Anders When it comes to the z-score I am having difficulties implementing your suggestion. I have the data in a PhysicalStore as it will require matrix operations, so the methods (sliceColumn) you've used arent available, and it isn't obvious what's the best way to do this then. Should I load in my data into an Array2D first, normalize it, then convert it into a PhysicalStore? How? Would that workflow be efficient? (will be processing GBs of data) I've tried this, but it didn't work: I've created a PhysicalStore instance from the normalized Array2D, via physicalFactory.columns(tmpArray2D). But that flattened the 2D data into 1D. It is also unclear if this method allocates new memory, IE creates a copy, or if it just somehow changes the external representation of the same data. Any ideas? PS: ojAlgo would disproportionately benefit from a proper tutorial covering workflow and real world uses, beyond the basic 'getting started' ones on GitHub. Martin On Thu, Nov 12, 2015 at 4:35 PM, Anders Peterson <an...@op...> wrote: > > > On 12 nov. 2015, at 10:59, Uga Buga <mmo...@gm...> wrote: > > > > Hi Guys > > > > 1) What is the fastest way of getting the diagonal elements of a > (square) matrix? > > (IE extract all the diagonal elements in a square matrix into a vector)? > > The way I've solved it 'manually' was like this: > > > > double [] diagonal = new double [(int) myMatrix.countColumns()]; > > for(int i = 0; i < diagonal.length; i++) diagonal[i] = (double) > myMatrix.get(i, i); > > > > Is there a better/faster (built-in) way of achieving the same thing? > > (it should give the same results as diag() in R ) > > If what you have is a BasicMatrix or a MatrixStore then that’s what you > need to do. It’s not slow or bad - it’s just that you had to code it > yourself. > > You should do > > myMatrix.doubleValue(i, i); > > instead of > > (double) myMatrix.get(i, i); > > > If you have an Array2D instead, then you can to this: > > Array2D<Double> tmpArray2D = … ; > Array1D<Double> tmpMainDiagonal = tmpArray2D.sliceDiagonal(0, 0); > double[] tmpRawCopyOfMainDiagonal = tmpMainDiagonal.toRawCopy(); > > > > > 2) What is the fastest way to standardise columns or rows? (also known > as Z-score, where each entry is part of a standard normal distribution with > mean 0, variance 1) > > There is no direct (1-step) way to do this, but you can get some help: > > Array2D<Double> tmpArray2D = … ; > for (long j = 0L; j < tmpArray2D.countColumns(); j++) { > Array1D<Double> tmpColumn = tmpArray2D.sliceColumn(0L, j); > SampleSet tmpSampleSet = SampleSet.wrap(tmpColumn); > double tmpMean = tmpSampleSet.getMean(); > double tmpStdDev = tmpSampleSet.getStandardDeviation(); > tmpColumn.modifyAll(new PrimitiveFunction.Unary() { > > public double invoke(final double arg) { > return (arg - tmpMean) / tmpStdDev; > } > }); > } > > > > > > > > > > > > Thanks > > Martin > > > > PS: (I've had some problems subscribing so this message may be sent > twice, so if this message appears twice admins can delete the first one) > > > ------------------------------------------------------------------------------ > > _______________________________________________ > > 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 > |
From: Anders P. <an...@op...> - 2015-11-12 16:35:18
|
> On 12 nov. 2015, at 10:59, Uga Buga <mmo...@gm...> wrote: > > Hi Guys > > 1) What is the fastest way of getting the diagonal elements of a (square) matrix? > (IE extract all the diagonal elements in a square matrix into a vector)? > The way I've solved it 'manually' was like this: > > double [] diagonal = new double [(int) myMatrix.countColumns()]; > for(int i = 0; i < diagonal.length; i++) diagonal[i] = (double) myMatrix.get(i, i); > > Is there a better/faster (built-in) way of achieving the same thing? > (it should give the same results as diag() in R ) If what you have is a BasicMatrix or a MatrixStore then that’s what you need to do. It’s not slow or bad - it’s just that you had to code it yourself. You should do myMatrix.doubleValue(i, i); instead of (double) myMatrix.get(i, i); If you have an Array2D instead, then you can to this: Array2D<Double> tmpArray2D = … ; Array1D<Double> tmpMainDiagonal = tmpArray2D.sliceDiagonal(0, 0); double[] tmpRawCopyOfMainDiagonal = tmpMainDiagonal.toRawCopy(); > 2) What is the fastest way to standardise columns or rows? (also known as Z-score, where each entry is part of a standard normal distribution with mean 0, variance 1) There is no direct (1-step) way to do this, but you can get some help: Array2D<Double> tmpArray2D = … ; for (long j = 0L; j < tmpArray2D.countColumns(); j++) { Array1D<Double> tmpColumn = tmpArray2D.sliceColumn(0L, j); SampleSet tmpSampleSet = SampleSet.wrap(tmpColumn); double tmpMean = tmpSampleSet.getMean(); double tmpStdDev = tmpSampleSet.getStandardDeviation(); tmpColumn.modifyAll(new PrimitiveFunction.Unary() { public double invoke(final double arg) { return (arg - tmpMean) / tmpStdDev; } }); } > > > > Thanks > Martin > > PS: (I've had some problems subscribing so this message may be sent twice, so if this message appears twice admins can delete the first one) > ------------------------------------------------------------------------------ > _______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user |
From: Uga B. <mmo...@gm...> - 2015-11-12 09:59:13
|
Hi Guys 1) What is the fastest way of getting the diagonal elements of a (square) matrix? (IE extract all the diagonal elements in a square matrix into a vector)? The way I've solved it 'manually' was like this: * double [] diagonal = new double [(int) myMatrix.countColumns()]; for(int i = 0; i < diagonal.length; i++) diagonal[i] = (double) myMatrix.get(i, i);* Is there a better/faster (built-in) way of achieving the same thing? (it should give the same results as *diag()* in R ) 2) What is the fastest way to standardise columns or rows? (also known as Z-score, where each entry is part of a standard normal distribution with mean 0, variance 1) Thanks Martin PS: (I've had some problems subscribing so this message may be sent twice, so if this message appears twice admins can delete the first one) |
From: applyhhj<app...@16...> - 2015-11-10 01:48:19
|
Thank you very much! I will follow the new release of Ojalgo. Thanks!! Regards! hjh 2015-11-10 applyhhj 发件人:Anders Peterson <an...@op...> 发送时间:2015-11-09 18:01 主题:Re: [ojAlgo-user] how to get exact matrix type of a basicmatrix 收件人:"ojalgo-user"<oja...@li...> 抄送: > On 9 nov. 2015, at 04:36, applyhhj <app...@16...> wrote: > > Thank you very much for your reply. The reason is that I need to extend a vector(n x 1) to a diagnoal matrix(n x n), however I declared all matrix vector as BasicMatrix so I need to know the exact type of the matrix to create a diagnoal matrix. If you need to create your own custom matrix types or more advanced algorithms then you should definitely use MatrixStore/PhysicalStore rather than BasicMatrix. > By the way will MatrixStore/PhysicalStore be faster than BasicMatrix in various operations? It gives you more options and control over what happens. > And is there any difference between MatrixStore and PhysicalStore? If details of these aspects are preseted in the Github wiki that would be great. 10s looking at the source code or reading the javadoc, and you would know the answer to that question. http://ojalgo.org/generated/org/ojalgo/matrix/store/PhysicalStore.html > Moreover I do not see any SpareMatrix in Ojalgo. Is there any way to create spareMatrix to accelerate matrix operations cause I need to operate on big spareMatrix such as diagnoal matrix? Thanks again! There is now - will be in v39. v39 will be released soon, and has some api-breaking changes. If you're starting out with ojAlgo now you should definitely get the latest snapshot downloads from SourceForge. (or work directly with the source repositories) https://github.com/optimatika/ojAlgo/wiki/v39 > Best Regards! > hjh > > 2015-11-09 > applyhhj > 发件人:Anders Peterson <an...@op...> > 发送时间:2015-11-08 18:48 > 主题:Re: [ojAlgo-user] how to get exact matrix type of a basicmatrix > 收件人:"ojalgo-user"<oja...@li...> > 抄送: > > You have to do instanceof on either the matrix or on one of the elements. > > > Why do you need to do this, or why don’t you know which type you have? > > If you consistently declare variables as ComplexMatrix then all operations will actually return ComplexMatrix rather than BasicMatrix. > > final BasicMatrix tmpOrg1 = PrimitiveMatrix.FACTORY.makeEye(3, 3); > final ComplexMatrix tmpOrg2 = ComplexMatrix.FACTORY.makeEye(3, 3); > > final BasicMatrix tmpBasic = tmpOrg1.transpose(); > final ComplexMatrix tmpComplex = tmpOrg2.transpose(); // The specific subclass is maintained > > > Even if you declare things as BasicMatrix rather than one of the specific implementations the underlying type will not change. It is possible to operate on two matrices of different types (add them together), in those cases it is always “this” that decides the type of the returned matrix. > > > Are you sure you want to use the BasicMatrix interface and its implementations? It’s what many users find first, and start using, but I believe most would be better off using the various MatrixStore/PhysicalStore implementations. With BasicMatrix there’s a lot less to worry about but also musch less flexibility in terms of what you can do. BigMatrix, ComplexMatrix and PrimitiveMatrix are immutable. That’s not what most users expect and consequently they use those classes inefficiently. > > Try both alternatives and see which one suits you best, > > /Anders > > > > On 8 nov. 2015, at 09:08, applyhhj <app...@16...> wrote: > > > > Hi everyone, > > Is there any way to tell wether a BasicMatrix is a PrimitiveMatrix or a ComplexMatrix? Thanks! > > > > Regards! > > hjh > > > > 2015-11-08 > > applyhhj > > ------------------------------------------------------------------------------ > > _______________________________________________ > > 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 > ------------------------------------------------------------------------------ > Presto, an open source distributed SQL query engine for big data, initially > developed by Facebook, enables you to easily query your data on Hadoop in a > more interactive manner. Teradata is also now providing full enterprise > support for Presto. Download a free open source copy now. > http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140_______________________________________________ > ojAlgo-user mailing list > ojA...@li... > https://lists.sourceforge.net/lists/listinfo/ojalgo-user ------------------------------------------------------------------------------ Presto, an open source distributed SQL query engine for big data, initially developed by Facebook, enables you to easily query your data on Hadoop in a more interactive manner. Teradata is also now providing full enterprise support for Presto. Download a free open source copy now. http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140 _______________________________________________ ojAlgo-user mailing list ojA...@li... https://lists.sourceforge.net/lists/listinfo/ojalgo-user |