[BCP] Starting out

António Duarte aduarte at ipb.pt
Fri Mar 20 10:08:29 EDT 2009


Hello again,

Problem solved. It appears that packer_init() (from class USER_initialize)
must be overridden too. The default packer_init() returns a null pointer
that causes the exception on line 106 of BCP_message_single.cpp.

Maybe the default implementation of packer_init() should include a warning
for the user (like the other ??_init() functions) or a probe on the pointer
in the debug version of the library.

Best regards,
António Duarte


-----Original Message-----
From: bcp-bounces at list.coin-or.org [mailto:bcp-bounces at list.coin-or.org] On
Behalf Of António Duarte
Sent: quarta-feira, 11 de Março de 2009 20:42
To: bcp at list.coin-or.org
Subject: Re: [BCP] Starting out

Hello,

I think my question is: what is the minimum set of derived classes and
overrides that I must define in order for the code to run?

As I said, right now I derived USER_initialize, BCP_tm_user and BCP_lp_user
and override tm_init and lp_init.

I attach a copy of my code.

Best regards,
Antonio



-----Original Message-----
From: fmargot at andrew.cmu.edu [mailto:fmargot at andrew.cmu.edu]
Sent: quarta-feira, 11 de Março de 2009 16:24
To: António Duarte
Cc: bcp
Subject: Re: [BCP] Starting out


Antonio:

It is a little bit difficult to understand what your code looks like.
Maybe look at the SHELL example available from

http://wpweb2.tepper.cmu.edu/fmargot/COIN/coin.html

It is an almost empty example that you can customize.

Francois


On Wed, 11 Mar 2009, António Duarte wrote:

> Hello again,
>
> The problem occurs executing line 106 of BCP_message_single.cpp:
>
> _tm_prob->packer->user_class = _tm_prob->user;
>
> Best regards,
> Antonio Duarte
>
>
>
> From: bcp-bounces at list.coin-or.org [mailto:bcp-bounces at list.coin-or.org]
On
> Behalf Of António Duarte
> Sent: quarta-feira, 11 de Março de 2009 11:36
> To: bcp at list.coin-or.org
> Subject: [BCP] Starting out
>
> Hello,
>
> I?m trying to put bcp to work but I?m having a problem.  I?m following the
> bac example but it seems I?m missing something.
>
> I started a blank project and did the following steps:
>
> 1. Derived classes from USER_initialize, BCP_tm_user and BCP_lp_user;
> 2. Overridden tm_init and lp_init in USER_initialize derived class to
return
> pointers to the other derived classes;
> 3. Called bcp_main(?) and passed a pointer to an instance of
USER_initialize
> derived class.
>
> The code compiles ok. When running, tm_init() is executed and after that a
> segmentation fault occurs.
>
> Am I forgetting something? I did not create any columns or rows in the
> problem. I?m just putting the code to work in an empty problem. Do you
think
> maybe this is the reason? Do I need to set up a problem?
>
> I?m using version 1.2.1 of bcp.
>
> Thanks in advance,
> Antonio Duarte
>
>
>
>
>




More information about the BCP mailing list