[Symphony-tickets] [SYMPHONY] #90: cuts from user callback are added wrongly
SYMPHONY
coin-trac at coin-or.org
Wed Mar 4 13:12:50 EST 2009
#90: cuts from user callback are added wrongly
-----------------------+----------------------------------------------------
Reporter: asm4 | Owner: asm4
Type: defect | Status: assigned
Priority: major | Milestone: 5.2
Component: Not Sure | Version:
Resolution: | Keywords:
-----------------------+----------------------------------------------------
Changes (by asm4):
* cc: rar39 at cam.ac.uk (added)
Comment:
Richard Russell reports that changing the cg_add_explicit_cut() to the
following fixes the issue:
{{{
int cg_add_explicit_cut(int nzcnt, int *indices, double *values,
double rhs, double range, char sense,
char send_to_cp, int *num_cuts, int *alloc_cuts,
cut_data ***cuts)
{
int i,tmp;
cut_data *cut = (cut_data *) calloc(1,sizeof(cut_data));
cut->type = EXPLICIT_ROW;
cut->sense = sense;
cut->rhs = rhs;
cut->range = range;
cut->size = DSIZE + nzcnt * (ISIZE + DSIZE);
cut->coef = (char *) malloc (cut->size);
((int *) cut->coef)[0] = nzcnt;
memcpy(cut->coef + DSIZE, (char*) values, nzcnt*DSIZE);
memcpy(cut->coef + ((nzcnt+1) * DSIZE), (char*)indices, nzcnt *
ISIZE);
cut->branch = DO_NOT_BRANCH_ON_THIS_ROW;
cut->deletable = TRUE;
cut->name = send_to_cp ? CUT__SEND_TO_CP : CUT__DO_NOT_SEND_TO_CP;
return(cg_send_cut(cut,num_cuts,alloc_cuts,cuts));
}
}}}
--
Ticket URL: <https://projects.coin-or.org/SYMPHONY/ticket/90#comment:2>
SYMPHONY <http://projects.coin-or.org/SYMPHONY>
The SYMPHONY framework for parallel branch-and-cut algorithms.
More information about the Symphony-tickets
mailing list