[Symphony] Fwd: Compiling symphony with one callback

Haroldo Gambini Santos haroldo.santos at gmail.com
Wed Jan 11 14:13:45 EST 2012


Follows the code:
#include <coin/OsiSymSolverInterface.hpp>
#include <coin/symphony.h>
#include <sym_constants.h>
#include <sym_macros.h>
#include <sym_cg_u.h>

int user_find_cuts(void *user, int varnum, int iter_num, int level,
                    int index, double objval, int *indices, double *values,
                    double ub, double etol, int *num_cuts, int *alloc_cuts,
                    cut_data ***cuts);


int main(int argc, char **argv)
{
    OsiSymSolverInterface *sym = new OsiSymSolverInterface();

    sym->parseCommandLine( argc, argv );

    sym->loadProblem();

    sym->branchAndBound();

    return(0);
}

int user_find_cuts(void *user, int varnum, int iter_num, int level,
                    int index, double objval, int *indices, double *values,
                    double ub, double etol, int *num_cuts, int *alloc_cuts,
                    cut_data ***cuts)
{
    printf("hello.\n");

    return USER_SUCCESS;
}


-------- Original Message --------
Subject: 	Compiling symphony with one callback
Date: 	Wed, 11 Jan 2012 17:12:21 -0200
From: 	Haroldo Gambini Santos <haroldo.santos at gmail.com>
To: 	symphony at list.coin-or.org



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: www.decom.ufop.br/haroldo/
sy


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/symphony/attachments/20120111/10055565/attachment.html>


More information about the Symphony mailing list