We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32a156c commit fa37618Copy full SHA for fa37618
1 file changed
src/pyscipopt/lp.pxi
@@ -571,8 +571,12 @@ cdef class LP:
571
Row basis statuses (length must equal nrows).
572
573
"""
574
- cdef int ncols = len(cstat)
575
- cdef int nrows = len(rstat)
+ cdef int ncols = self.ncols()
+ cdef int nrows = self.nrows()
576
+ if len(cstat) != ncols:
577
+ raise ValueError(f"cstat has length {len(cstat)}, expected {ncols}")
578
+ if len(rstat) != nrows:
579
+ raise ValueError(f"rstat has length {len(rstat)}, expected {nrows}")
580
cdef int* c_cstat = <int*> malloc(ncols * sizeof(int))
581
cdef int* c_rstat = <int*> malloc(nrows * sizeof(int))
582
cdef int i
0 commit comments