[gecode-users] Using custom branching options

Christian Schulte cschulte at kth.se
Mon Apr 7 09:48:00 CEST 2014


Hi,

 

Please read the changelog! 

 

What used to be an enum value such as INT_VAR_NONE before 4.* is now a
function that when called creates a branching description, that is
INT_VAR_NONE(). Please check MPG.

 

Cheers

Christian

 

--

Christian Schulte, Professor of Computer Science, KTH,
www.ict.kth.se/~cschulte/

 

From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Tadele Kebebe
Sent: Saturday, April 05, 2014 12:36 AM
To: users at gecode.org
Subject: [gecode-users] Using custom branching options

 

Hi there, 

 

I am using a custom option class which inherits from the Gecode::Options
class. The custom class looks as below:

 

class Cbcl_Options : public Options{

    protected:

         StringOption _branchval;

         ...

    public:

        Cbcl_Options(const char* e) : Options(e), ....{

             ....

             _branching.add(INT_VAR_NONE, "input");

             _branching.add(INT_VAR_MIN_MIN, "min");

             ...

             branching(INT_VAR_DEGREE_MAX);

             ....

             _branchval.add(INT_VAL_MIN, "min");

             ...

             add(_branchval);

             ....

        }

        ...

}

 

I have used the proper namespaces and header files, but when I compile the
code it gave me the following errors:

 

g++ -Wall -g -I/usr/local/include -c cbcl_options.cpp

cbcl_options.cpp: In constructor 'Cbcl_Options::Cbcl_Options(const char*)':

cbcl_options.cpp:75:40: error: invalid conversion from 'Gecode::IntVarBranch
(*)()' to 'int' [-fpermissive]

    _branching.add(INT_VAR_NONE, "input");

                                        ^

In file included from cbcl_options.cpp:7:0:

/usr/local/include/gecode/driver.hh:195:12: error:   initializing argument 1
of 'void Gecode::Driver::StringOption::add(int, const char*, const char*)'
[-fpermissive]

       void add(int v, const char* o, const char* h = NULL);

            ^

 

I am using gecode-4.2.1, but the seems to work on gecode-3.7.1. 

Can you please help me in correcting those errors. 

 

Thanks

tad.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20140407/cb569407/attachment-0001.html>


More information about the users mailing list