<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Follows the code:<br>
    #include &lt;coin/OsiSymSolverInterface.hpp&gt;<br>
    #include &lt;coin/symphony.h&gt;<br>
    #include &lt;sym_constants.h&gt;<br>
    #include &lt;sym_macros.h&gt;<br>
    #include &lt;sym_cg_u.h&gt;<br>
    <br>
    int user_find_cuts(void *user, int varnum, int iter_num, int level,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int index, double objval, int *indices, double
    *values,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double ub, double etol, int *num_cuts, int
    *alloc_cuts,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cut_data ***cuts);<br>
    <br>
    <br>
    int main(int argc, char **argv)<br>
    {<br>
    &nbsp;&nbsp; OsiSymSolverInterface *sym = new OsiSymSolverInterface();<br>
    <br>
    &nbsp;&nbsp; sym-&gt;parseCommandLine( argc, argv );<br>
    <br>
    &nbsp;&nbsp; sym-&gt;loadProblem();<br>
    <br>
    &nbsp;&nbsp; sym-&gt;branchAndBound();<br>
    <br>
    &nbsp;&nbsp; return(0);<br>
    }<br>
    <br>
    int user_find_cuts(void *user, int varnum, int iter_num, int level,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int index, double objval, int *indices, double
    *values,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double ub, double etol, int *num_cuts, int
    *alloc_cuts,<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cut_data ***cuts)<br>
    {<br>
    &nbsp;&nbsp; printf("hello.\n");<br>
    <br>
    &nbsp;&nbsp; return USER_SUCCESS;<br>
    }<br>
    <br>
    <br>
    -------- Original Message --------
    <table class="moz-email-headers-table" cellpadding="0"
      cellspacing="0" border="0">
      <tbody>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject: </th>
          <td>Compiling symphony with one callback</td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
          <td>Wed, 11 Jan 2012 17:12:21 -0200</td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
          <td>Haroldo Gambini Santos <a class="moz-txt-link-rfc2396E" href="mailto:haroldo.santos@gmail.com">&lt;haroldo.santos@gmail.com&gt;</a></td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">To: </th>
          <td><a class="moz-txt-link-abbreviated" href="mailto:symphony@list.coin-or.org">symphony@list.coin-or.org</a></td>
        </tr>
      </tbody>
    </table>
    <br>
    <br>
    <pre>Hi,

I'm starting to build a code with SYMPHONY, mainly based in the 
"Walkthrough..." example of Michael Trick.

To start I've just included a callback to insert cuts, but it appears 
that is is not being called.

In Trick's example it only defines the function, but there is no 
sym_set_user_callback (something like that) as I expected.

Although my (small) code compiles fine, the callback is not being called 
(put a printf inside it).

What additional step should I do ?

Cheers,

Haroldo

-- 
=============================================================
Haroldo Gambini Santos
Computing Department - Universidade Federal de Ouro Preto - UFOP
email: haroldo [at ] iceb.ufop.br
home/research page: <a class="moz-txt-link-abbreviated" href="http://www.decom.ufop.br/haroldo/">www.decom.ufop.br/haroldo/</a>
sy

</pre>
  </body>
</html>