<div dir="ltr">Hi Edson,<div><br></div><div style>I found the way of running the derivative checker, so no worries about that.</div><div style><br></div><div style>Many thanks,</div><div style><br></div><div style>Alberto</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 18 January 2013 15:57, Alberto Calzada <span dir="ltr"><<a href="mailto:albertocalsa@gmail.com" target="_blank">albertocalsa@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello, Edson,<div><br></div><div>I am struggling to find a solution to these errors. </div><div><br></div>
<div>1) I am not sure if I am running properly the derivative tests in JIpopt. I am just adding these 2 lines:</div>
<div><div><span style="white-space:pre-wrap">                </span>addStrOption(Ipopt.KEY_DERIVATIVE_TEST, "first-order");</div><div><span style="white-space:pre-wrap">                </span>addStrOption(Ipopt.KEY_DERIVATIVE_TEST_PRINT_ALL, "yes");</div>
<div>But the program is not printing anything.</div></div><div><br></div><div>2) When I run a big optimisation problem, I get the error I mentioned you in my previous e-mail. But when I try to run a small optimisation problem, the following error appears:</div>
<div><br></div><div><div><i>******************************************************************************</i></div><div><i>This program contains Ipopt, a library for large-scale nonlinear optimization.</i></div><div><i> Ipopt is released as open source code under the Common Public License (CPL).</i></div>
<div><i> For more information visit <a href="http://projects.coin-or.org/Ipopt" target="_blank">http://projects.coin-or.org/Ipopt</a></i></div><div><i>******************************************************************************</i></div>
<div><i><br></i></div><div><i>Option hessian_information is not chosen as limited_memory, but eval_h returns f</i></div><div><i>alse.</i></div><div><i>Exception of type: OPTION_INVALID in file "IpTNLPAdapter.cpp" at line 869:</i></div>
<div><i> Exception message: eval_h is called but has not been implemented</i></div><div><i><br></i></div><div><i>EXIT: Invalid option encountered.</i></div><div><i>DEBUG [AWT-EventQueue-1] (NotificationManager.java:104) - java.lang.ArrayIndexOu</i></div>
<div><i>tOfBoundsException: 0</i></div><div><i>java.lang.ArrayIndexOutOfBoundsException: 0</i></div><div><i> at model.core.Optimisation.ExtendedRuleBaseOptimisation.eval_h(ExtendedR</i></div><div><i>uleBaseOptimisation.java:220)</i></div>
<div><i> at org.coinor.Ipopt.IpoptSolve(Native Method)</i></div><div><i> at org.coinor.Ipopt.solve(Ipopt.java:347)</i></div><div><i> at model.core.DataStructure.SubRuleBase.optimise(SubRuleBase.java:1230)</i></div>
<div><i> at view.util.MeasureParametersDialog$6.actionPerformed(MeasureParameters</i></div><div><i>Dialog.java:158)</i></div><div><i> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)</i></div>
<div><i> at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)</i></div><div><i> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)</i></div><div><i> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)</i></div>
<div><i> at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour</i></div><div><i>ce)</i></div><div class="gmail_extra"><br>The thing is that I have actually implemented the eval_h function! This is my eval_h function:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra"><i><span style="white-space:pre-wrap">        </span>@Override</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">        </span>protected boolean eval_h(int n, double[] x, boolean new_x,</i></div>
<div class="gmail_extra"><i><span style="white-space:pre-wrap">                        </span>double obj_factor, int m, double[] lambda, boolean new_lambda,</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                        </span>int nele_hess, int[] iRow, int[] jCol, double[] values) {</i></div>
<div class="gmail_extra"><i><br></i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                </span>/* return the structure. This is a symmetric matrix, fill the lower left</i></div><div class="gmail_extra">
<i><span style="white-space:pre-wrap">                </span> * triangle only. */</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                </span>if(values == null){</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                                </span>/* return the structure. This is a symmetric matrix, fill the lower left</i></div>
<div class="gmail_extra"><i><span style="white-space:pre-wrap">                                </span> * triangle only. */</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                        </span>int idx = 0; /* nonzero element counter */</i></div>
<div class="gmail_extra"><i><span style="white-space:pre-wrap">                        </span>int row = 0; /* row counter for loop */</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                        </span>int col = 0; /* col counter for loop */</i></div>
<div class="gmail_extra"><i><br></i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                                </span>idx=0;</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                                </span>for (row = 0; row < 4; row++) {</i></div>
<div class="gmail_extra"><i><span style="white-space:pre-wrap">                                        </span>for (col = 0; col <= row; col++) {</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                                                </span>iRow[idx] = row;</i></div>
<div class="gmail_extra"><i><span style="white-space:pre-wrap">                                                </span>jCol[idx] = col;</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                                                </span>idx++;</i></div><div class="gmail_extra">
<i><span style="white-space:pre-wrap">                                        </span>}</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                                </span>}</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                                </span>nele_hess = idx;</i></div>
<div class="gmail_extra"><i><span style="white-space:pre-wrap">                </span>}</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                </span>else {</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                        </span>for(int i=0;i<nele_hess;i++){</i></div>
<div class="gmail_extra"><i><span style="white-space:pre-wrap">                                </span>values[i] = 0;</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                        </span>}</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                </span>}</i></div>
<div class="gmail_extra"><span style="white-space:pre-wrap"><i>                </i></span></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">                </span>return true;</i></div><div class="gmail_extra"><i><span style="white-space:pre-wrap">        </span>}</i></div>
<br><div class="gmail_quote">Because what I am trying to optimise are the parameters of a rule-based knowledge representation system (weights, antecedents and consequent of each rule and attribute) and all my constraints are of the type: g_U[k] = a1+a2+..+aN, their second derivative (if I am not wrong) will always be zero for all of them. That is why I always do "<i>values[i] = 0" </i>for all my constraints.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">I am downloading the Valgrind application to debug the system, but I think that the problem I am getting now is not related with memory issues but maybe by solving this problem when optimising small rule-bases, we might solve also the one for big rule-bases at once...</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Many thanks once again Edson, I wouldn't be able to make this thing work without you,</div><div class="gmail_quote"><br></div><div class="gmail_quote">
All the best,</div><div class="gmail_quote"><br></div><div class="gmail_quote">Alberto</div><div><div class="h5"><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div>
<div class="gmail_quote">On 18 January 2013 13:19, Edson Cordeiro do Valle <span dir="ltr"><<a href="mailto:edsoncv@enq.ufrgs.br" target="_blank">edsoncv@enq.ufrgs.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div> Hello Alberto<br>
Well, if things went wrong, I suggest to use the default approach:
use derivative checker to detect errors on first and second
derivatives.<br>
To see the outputs from ipopt to java it is necessary to send the
outputs of ipopt to a java stream, through a JTextArea (implements
the intermediate callback function in java) and analyze your
output.<br>
The implementation in Java of this function would be something
like that:<br>
<br>
public boolean intermediate_callback(int AlgorithmMode, int
iter,<br>
double obj_value, double inf_pr, double inf_du, double
mu,<br>
double d_norm, double regularization_size, double
alpha_du,<br>
double alpha_pr, int ls_trials) {<br>
Formatter formatter = new Formatter();<br>
// publish results to the output window<br>
myArea.append(formatter.format("%d \t %1.4e \t %1.2e \t
%1.2e \t" +<br>
"%+1.1f \t %1.2e \t %1.1f \t %1.2e \t %1.2e \t
%d",<br>
iter, obj_value, inf_pr, inf_du, mu, d_norm,
regularization_size, <br>
alpha_du, alpha_pr, ls_trials).toString() + "\n");<br>
return true;<br>
}<br>
<br>
Notice that due to a swing thread issues it may be necessary to
create a swingworker to update this values. I have a jipopt
version that interacts with swing controls and a JTextArea using
swingworkers. I will ask my company if I can share this
implementation with COIN-Ipopt, but you can try the above
solution.<br>
<br>
It is also possible to run your java executable in valgrind (even
if it runs inside jvm) and check for leaks (I know that this work
because Ive done this in the past to debug the first versions of
jipopt). The problem in this case is that, since jipopt.dll was
not built with debug symbols, you may not find exactly where (what
line) exactly the problem is, but it can give you a clue.<br>
<br>
Regards<br>
<br>
<br>
Em 17-01-2013 18:37, Alberto Calzada escreveu:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Dear Rafael and Edson,
<div><br>
</div>
<div>Thank you very much for your patience and
attention. I was finally and just now able to solve the link
issue. It was because my project is inside another (much
bigger) open-source project, and I needed to add the jipopt
.jar library not to the path of my own project, but to the
path of the whole workbench. Thank you for your advise during
this last month, it was very helpful to find the root of the
problem.</div>
<div>However, now I think I got another problem which I
believe is out of my scope (it seems to occur out of the JVM,
and looks like a memory error).</div>
<div>Please find attached the logs of the 4 failed
executions I have had.</div>
<div><br>
</div>
<div>Again, any suggestion would be more than welcome,</div>
<div>Many thanks beforehand,</div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>Alberto</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On 16 January 2013 23:12, Edson
Cordeiro do Valle <span dir="ltr"><<a href="mailto:edsoncv@enq.ufrgs.br" target="_blank">edsoncv@enq.ufrgs.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> Hello
Alberto<br>
Can you send me your version of your project (a zipped
folder) or a resumed version of it? If you send me I can
take a look.<br>
Regards<br>
<br>
Em 11-01-2013 15:16, Alberto Calzada escreveu:
<div>
<div><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Dear Rafael,<br>
<br>
Again, thank you very much for your prompt respond and
attention.<br>
<br>
That's the most strange thing: I am in Eclipse and I
have added the JIpopt library (jipopt-3.2.2.jar) in
the path of my project. Moreover, I am not getting any
compilation error and I can access the Ipopt class
from Eclipse and the imports I do in my Java class
which extends Ipopt works also fine.<br>
<br>
I have also checked the jipopt-3.2.2.jar file and it
has indeed inside the org.coinor.Ipopt class. That is
why I don't know exactly where could be the problem.<br>
<br>
Thank you very much again,<br>
Best regards,<br>
<br>
Alberto<br>
</blockquote>
<br>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<i><font color="#666666" face="arial, helvetica, sans-serif">-- <br>
</font></i>
<div>
<p style="margin:0px"><i><font color="#666666" face="arial, helvetica, sans-serif"><span style="background-image:initial">Mr Alberto
Calzada<br>
Full-time PhD Candidate</span></font></i></p>
<p style="margin:0px"><i><font color="#666666" face="arial, helvetica, sans-serif"><span style="background-image:initial">Room 16J25</span> </font></i>
</p>
</div>
<div>
<p style="margin:0px"><i><font color="#666666" face="arial, helvetica, sans-serif"><span style="background-image:initial">School of
Computing and Mathematics<br>
Faculty of Computing and Engineering</span></font></i></p>
</div>
<div>
<p style="margin:0px"><i><font color="#666666" face="arial, helvetica, sans-serif"><span style="background-image:initial">University of
Ulster at Jordanstown Campus<br>
Northern Ireland, UK<br>
Email: </span><span style="background-repeat:initial initial;background-image:initial"><a href="mailto:Calzada-A@email.ulster.ac.uk" target="_blank">Calzada-A@email.ulster.ac.uk</a></span></font></i></p>
<p style="margin:0px"><i><font color="#666666" face="arial, helvetica, sans-serif"><span style="background-image:initial">Tel: </span>
<span>+44 28
90361114</span> </font></i></p>
</div>
</div>
</blockquote>
<br>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><i><font face="arial, helvetica, sans-serif" color="#666666">-- <br></font></i><div><p style="margin:0px">
<i><font face="arial, helvetica, sans-serif" color="#666666"><span style="background-image:initial">Mr Alberto Calzada<br>Full-time PhD Candidate</span><u></u><u></u></font></i></p><p style="margin:0px">
<i><font face="arial, helvetica, sans-serif" color="#666666"><span style="background-image:initial">Room 16J25</span> </font></i>
</p></div><div><p style="margin:0px"><i><font face="arial, helvetica, sans-serif" color="#666666"><span style="background-image:initial">School of Computing and Mathematics<br>
Faculty of Computing and Engineering</span></font></i></p></div><div><p style="margin:0px"><i><font face="arial, helvetica, sans-serif" color="#666666"><span style="background-image:initial">University of Ulster at Jordanstown Campus<br>
Northern Ireland, UK<br>Email: </span><span style="background-repeat:initial initial;background-image:initial"><a href="mailto:Calzada-A@email.ulster.ac.uk" target="_blank">Calzada-A@email.ulster.ac.uk</a></span></font></i></p>
<p style="margin:0px"><i><font face="arial, helvetica, sans-serif" color="#666666"><span style="background-image:initial">Tel: </span>
<span><a href="tel:%2B44%2028%2090361114" value="+442890361114" target="_blank">+44 28 90361114</a></span> </font></i></p></div>
</div></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><i><font face="arial, helvetica, sans-serif" color="#666666">-- <br></font></i><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<i><font face="arial, helvetica, sans-serif" color="#666666"><span style="background-image:initial;background-color:white">Mr Alberto Calzada<br>Full-time PhD Candidate</span><u></u><u></u></font></i></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<i><font face="arial, helvetica, sans-serif" color="#666666"><span style="background-image:initial;background-color:white">Room 16J25</span> </font></i>
</p></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><i><font face="arial, helvetica, sans-serif" color="#666666"><span style="background-image:initial;background-color:white">School of Computing and Mathematics<br>
Faculty of Computing and Engineering</span></font></i></p></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><i><font face="arial, helvetica, sans-serif" color="#666666"><span style="background-image:initial;background-color:white">University of Ulster at Jordanstown Campus<br>
Northern Ireland, UK<br>Email: </span><span style="background-image:initial;background-color:white;background-repeat:initial initial"><a href="mailto:Calzada-A@email.ulster.ac.uk" target="_blank">Calzada-A@email.ulster.ac.uk</a></span></font></i></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><i><font face="arial, helvetica, sans-serif" color="#666666"><span style="background-image:initial;background-color:white">Tel: </span>
<span style="background-color:rgb(255,255,255)">+44 28 90361114</span> </font></i></p></div>
</div>