Dear sage-devel,
I have another question related to Cython. I like to post them here instead of cython-users as it seems to me that the former is a much slower group. That said....
The definition of the Graph class in one of the libraries is :
===================================
class Graph : public AbstractGraph
{
public:
typedef enum {
shs_f = 0, shs_fs, shs_fl, shs_fm, shs_fsm, shs_flm
} SplittingHeuristic;
// blah blah blah
}
===================================
Following Cython's guide on this subject
http://docs.cython.org/src/userguide/external_C_code.html I figured my definition of the wrapped class should look like:
===================================
# blah blah blah
cdef cppclass Graph(AbstractGraph):
ctypedef enum SplittingHeuristic:
shs_f = 0
# blah blah blah
===================================
Unfortunately, this gives me a compilation error:
===================================
cdef cppclass Graph(AbstractGraph):
ctypedef enum SplittingHeuristic:
^
------------------------------------------------------------
sage/graphs/bliss.pyx:45:22: Syntax error in C variable declaration
===================================
Now I think the pasted code completely isolates the issue since I am able to work with the Graph class (access methods) normally. The only issue appears when I introduce this enum thing. Hence I am wondering what exactly I am missing in this code?
Best,
Jernej