Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 3ab6b33

Browse files
committed
replace sage_malloc by check_malloc
1 parent 3644950 commit 3ab6b33

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/sage/numerical/backends/coin_backend.pyx

+10-10
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ cdef class CoinBackend(GenericBackend):
446446
"""
447447
cdef int i, c
448448
cdef int m = len(constraints)
449-
cdef int * rows = <int *>sage_malloc(m * sizeof(int *))
449+
cdef int * rows = <int *>check_malloc(m * sizeof(int *))
450450
cdef int nrows = self.si.getNumRows()
451451

452452
for i in xrange(m):
@@ -701,8 +701,8 @@ cdef class CoinBackend(GenericBackend):
701701
"""
702702

703703
cdef int n = len(indices)
704-
cdef int * c_indices = <int*>sage_malloc(n*sizeof(int))
705-
cdef double * c_values = <double*>sage_malloc(n*sizeof(double))
704+
cdef int * c_indices = <int*>check_malloc(n*sizeof(int))
705+
cdef double * c_values = <double*>check_malloc(n*sizeof(double))
706706
cdef int i
707707

708708
for 0<= i< n:
@@ -1291,8 +1291,8 @@ cdef class CoinBackend(GenericBackend):
12911291
"""
12921292
cdef int n = self.model.solver().getNumCols()
12931293
cdef int m = self.model.solver().getNumRows()
1294-
cdef int * c_cstat = <int *>sage_malloc(n * sizeof(int))
1295-
cdef int * c_rstat = <int *>sage_malloc(m * sizeof(int))
1294+
cdef int * c_cstat = <int *>check_malloc(n * sizeof(int))
1295+
cdef int * c_rstat = <int *>check_malloc(m * sizeof(int))
12961296
cdef list cstat
12971297
cdef list rstat
12981298
# enableSimplexInterface must be set to use getBasisStatus().
@@ -1419,8 +1419,8 @@ cdef class CoinBackend(GenericBackend):
14191419

14201420
if n != self.model.solver().getNumCols() or m != self.model.solver().getNumRows():
14211421
raise ValueError("Must provide the status of every column and row variables")
1422-
c_cstat = <int *>sage_malloc(n * sizeof(int))
1423-
c_rstat = <int *>sage_malloc(m * sizeof(int))
1422+
c_cstat = <int *>check_malloc(n * sizeof(int))
1423+
c_rstat = <int *>check_malloc(m * sizeof(int))
14241424
for i in range(n):
14251425
c_cstat[i] = cstat[i]
14261426
for i in range(m):
@@ -1487,8 +1487,8 @@ cdef class CoinBackend(GenericBackend):
14871487
if i < 0 or i >= m:
14881488
raise ValueError("i = %s. The i-th row of the tableau doesn't exist" % i)
14891489

1490-
cdef double * c_slack = <double *>sage_malloc(m * sizeof(double))
1491-
cdef double * c_z = <double *>sage_malloc(n * sizeof(double))
1490+
cdef double * c_slack = <double *>check_malloc(m * sizeof(double))
1491+
cdef double * c_z = <double *>check_malloc(n * sizeof(double))
14921492
cdef list slack
14931493
cdef list ithrow
14941494
# enableSimplexInterface must be set to use getBasisStatus().
@@ -1551,7 +1551,7 @@ cdef class CoinBackend(GenericBackend):
15511551
# getBInvACol(j) is getBinvCol(j-n)
15521552
raise ValueError("j = %s. The j-th column of the tableau doesn't exist" % j)
15531553

1554-
cdef double * c_vec = <double *>sage_malloc(m * sizeof(double))
1554+
cdef double * c_vec = <double *>check_malloc(m * sizeof(double))
15551555
cdef list jthcol
15561556
# enableSimplexInterface must be set to use getBasisStatus().
15571557
# See projects.coin-or.org/Osi/ticket/84

0 commit comments

Comments
 (0)