Skip to content

Commit ffcf001

Browse files
committed
Fix most compilation issues and warnings
1 parent dc08654 commit ffcf001

3 files changed

Lines changed: 58 additions & 18 deletions

File tree

src/pyscipopt/event.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cdef class Eventhdlr:
3939

4040

4141
# local helper functions for the interface
42-
cdef Eventhdlr getPyEventhdlr(SCIP_EVENTHDLR* eventhdlr) noexcept with gil:
42+
cdef Eventhdlr getPyEventhdlr(SCIP_EVENTHDLR* eventhdlr):
4343
cdef SCIP_EVENTHDLRDATA* eventhdlrdata
4444
eventhdlrdata = SCIPeventhdlrGetData(eventhdlr)
4545
return <Eventhdlr>eventhdlrdata

src/pyscipopt/scip.pxd

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ cdef extern from "scip/scip.h":
385385
ctypedef struct SCIP_ROW:
386386
pass
387387

388-
ctypedef struct SCIP_ROW_EXACT:
388+
ctypedef struct SCIP_ROWEXACT:
389389
pass
390390

391391
ctypedef struct SCIP_NLROW:
@@ -394,7 +394,7 @@ cdef extern from "scip/scip.h":
394394
ctypedef struct SCIP_COL:
395395
pass
396396

397-
ctypedef struct SCIP_COL_EXACT:
397+
ctypedef struct SCIP_COLEXACT:
398398
pass
399399

400400
ctypedef struct SCIP_SOL:
@@ -427,12 +427,6 @@ cdef extern from "scip/scip.h":
427427
ctypedef struct SCIP_PROPDATA:
428428
pass
429429

430-
ctypedef struct SCIP_PROPTIMING:
431-
pass
432-
433-
ctypedef struct SCIP_PRESOLTIMING:
434-
pass
435-
436430
ctypedef struct SCIP_PRESOL:
437431
pass
438432

@@ -484,9 +478,6 @@ cdef extern from "scip/scip.h":
484478
ctypedef struct SCIP_PRESOL:
485479
pass
486480

487-
ctypedef struct SCIP_HEURTIMING:
488-
pass
489-
490481
ctypedef struct SCIP_SEPA:
491482
pass
492483

@@ -535,10 +526,10 @@ cdef extern from "scip/scip.h":
535526
ctypedef struct SCIP_LPI:
536527
pass
537528

538-
ctypedef struct BMS_BLKMEM:
529+
ctypedef struct SCIP_LPEXACT:
539530
pass
540531

541-
ctypedef struct SCIP_EXPR:
532+
ctypedef struct BMS_BLKMEM:
542533
pass
543534

544535
ctypedef struct SCIP_EXPRHDLR:
@@ -2083,13 +2074,13 @@ cdef class Column:
20832074
@staticmethod
20842075
cdef create(SCIP_COL* scipcol)
20852076

2086-
cdef class Column:
2077+
cdef class ColumnExact:
20872078
cdef SCIP_COLEXACT* scip_col_exact
20882079
# can be used to store problem data
20892080
cdef public object data
20902081

20912082
@staticmethod
2092-
cdef create(SCIP_COLEXACT* scipcol_exact)
2083+
cdef create(SCIP_COLEXACT* scip_col_exact)
20932084

20942085
cdef class Row:
20952086
cdef SCIP_ROW* scip_row
@@ -2105,7 +2096,7 @@ cdef class RowExact:
21052096
cdef public object data
21062097

21072098
@staticmethod
2108-
cdef create(SCIP_ROWEXACT* sciprow_exact)
2099+
cdef create(SCIP_ROWEXACT* scip_row_exact)
21092100

21102101
cdef class NLRow:
21112102
cdef SCIP_NLROW* scip_nlrow

src/pyscipopt/scip.pxi

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,31 @@ cdef class Column:
625625
return (self.__class__ == other.__class__
626626
and self.scip_col == (<Column>other).scip_col)
627627

628+
cdef class ColumnExact:
629+
"""Base class holding a pointer to corresponding SCIP_COLEXACT."""
630+
631+
@staticmethod
632+
cdef create(SCIP_COLEXACT* scipcolexact):
633+
"""
634+
Main method for creating a ColumnExact class. Is used instead of __init__.
635+
636+
Parameters
637+
----------
638+
scipcolexact : SCIP_COLEXACT*
639+
A pointer to the SCIP_COLEXACT
640+
641+
Returns
642+
-------
643+
col : ColumnExact
644+
The Python representative of the SCIP_COLEXACT
645+
646+
"""
647+
if scipcolexact == NULL:
648+
raise Warning("cannot create ColumnExact with SCIP_COLEXACT* == NULL")
649+
col = ColumnExact()
650+
col.scip_col_exact = scipcolexact
651+
return col
652+
628653
cdef class Row:
629654
"""Base class holding a pointer to corresponding SCIP_ROW."""
630655

@@ -909,6 +934,31 @@ cdef class Row:
909934
return (self.__class__ == other.__class__
910935
and self.scip_row == (<Row>other).scip_row)
911936

937+
cdef class RowExact:
938+
"""Base class holding a pointer to corresponding SCIP_ROW."""
939+
940+
@staticmethod
941+
cdef create(SCIP_ROWEXACT* sciprowexact):
942+
"""
943+
Main method for creating a RowExact class. Is used instead of __init__.
944+
945+
Parameters
946+
----------
947+
sciprow : SCIP_ROWEXACT*
948+
A pointer to the SCIP_ROWEXACT
949+
950+
Returns
951+
-------
952+
row : Row
953+
The Python representative of the SCIP_ROWEXACT
954+
955+
"""
956+
if sciprowexact == NULL:
957+
raise Warning("cannot create Row with SCIP_ROWEXACT* == NULL")
958+
row_exact = RowExact()
959+
row_exact.scip_row_exact = sciprowexact
960+
return row_exact
961+
912962
cdef class NLRow:
913963
"""Base class holding a pointer to corresponding SCIP_NLROW."""
914964

@@ -7615,7 +7665,6 @@ cdef class Model:
76157665
76167666
"""
76177667
raise Warning("model.getDualMultiplier(cons) is deprecated: please use model.getDualsolLinear(cons)")
7618-
return self.getDualsolLinear(cons)
76197668

76207669
def getDualfarkasLinear(self, Constraint cons):
76217670
"""

0 commit comments

Comments
 (0)