Skip to content

Commit 89dd4f2

Browse files
committed
(core) added a Python binding for the new simplex_graph_limited_fractional function
1 parent 4d2453b commit 89dd4f2

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

nimplex.nim

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,16 +478,28 @@ when appType == "lib" and not defined(nimdoc):
478478
let graph = simplex_graph_3C_fractional(ndiv)
479479
return (graph[0].toSeq2D(), graph[1])
480480

481-
proc simplex_graph_py*(dim: int, ndiv: int): (seq[seq[int]], seq[seq[int]]) {.exportpy.} =
481+
proc simplex_graph_py*(
482+
dim: int, ndiv: int
483+
): (seq[seq[int]], seq[seq[int]]) {.exportpy.} =
482484
let graph = simplex_graph(dim, ndiv)
483485
return (graph[0].toSeq2D(), graph[1])
484486

485-
proc simplex_graph_limited_py*(dim: int, ndiv: int, limit: seq[seq[int]]): (seq[seq[int]], seq[seq[int]]) {.exportpy.} =
487+
proc simplex_graph_fractional_py*(
488+
dim: int, ndiv: int
489+
): (seq[seq[float]], seq[seq[int]]) {.exportpy.} =
490+
let graph = simplex_graph_fractional(dim, ndiv)
491+
return (graph[0].toSeq2D(), graph[1])
492+
493+
proc simplex_graph_limited_py*(
494+
dim: int, ndiv: int, limit: seq[seq[int]]
495+
): (seq[seq[int]], seq[seq[int]]) {.exportpy.} =
486496
let graph = simplex_graph_limited(dim, ndiv, limit)
487497
return (graph[0].toSeq2D(), graph[1])
488498

489-
proc simplex_graph_fractional_py*(dim: int, ndiv: int): (seq[seq[float]], seq[seq[int]]) {.exportpy.} =
490-
let graph = simplex_graph_fractional(dim, ndiv)
499+
proc simplex_graph_limited_fractional_py*(
500+
dim: int, ndiv: int, limit: seq[seq[float]]
501+
): (seq[seq[float]], seq[seq[int]]) {.exportpy.} =
502+
let graph = simplex_graph_limited_fractional(dim, ndiv, limit)
491503
return (graph[0].toSeq2D(), graph[1])
492504

493505
# Extra functions for Python bindings only

0 commit comments

Comments
 (0)