[gecode-users] Using custom branching options

Tadele Kebebe tadkebau at gmail.com
Sat Apr 5 00:35:51 CEST 2014


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/20140405/a70d2ee6/attachment.html>


More information about the users mailing list