aboutsummaryrefslogtreecommitdiff
path: root/python/nissy_module.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-03-09 18:07:31 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2025-03-09 18:07:31 +0100
commitba75d1632115180d05ba9ce5e35380251d251e7d (patch)
tree5382621c745ab5309ebc69fd82a17f544e5d0ca3 /python/nissy_module.c
parent11e6aeeaf5f08839c6effb8f68710081acf491bf (diff)
downloadnissy-core-ba75d1632115180d05ba9ce5e35380251d251e7d.tar.gz
nissy-core-ba75d1632115180d05ba9ce5e35380251d251e7d.zip
Fixed python module
Diffstat (limited to '')
-rw-r--r--python/nissy_module.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/python/nissy_module.c b/python/nissy_module.c
index 947d06f..6511382 100644
--- a/python/nissy_module.c
+++ b/python/nissy_module.c
@@ -315,6 +315,7 @@ PyDoc_STRVAR(solve_doc,
315"Parameters:\n" 315"Parameters:\n"
316" - cube: a cube in B32 format\n" 316" - cube: a cube in B32 format\n"
317" - solver: the solver to use\n" 317" - solver: the solver to use\n"
318" - options: extra options for the chosen solver\n"
318" - minmoves: the minimum number of moves to use\n" 319" - minmoves: the minimum number of moves to use\n"
319" - maxmoves: the maximum number of moves to use\n" 320" - maxmoves: the maximum number of moves to use\n"
320" - maxsolution: the maximum number of solutions to return\n" 321" - maxsolution: the maximum number of solutions to return\n"
@@ -331,20 +332,21 @@ solve(PyObject *self, PyObject *args)
331 long long result; 332 long long result;
332 unsigned nissflag, minmoves, maxmoves, maxsolutions; 333 unsigned nissflag, minmoves, maxmoves, maxsolutions;
333 int optimal, i, j, k, threads; 334 int optimal, i, j, k, threads;
334 const char *cube, *solver; 335 const char *cube, *solver, *options;
335 char solutions[MAX_SOLUTIONS_SIZE]; 336 char solutions[MAX_SOLUTIONS_SIZE];
336 long long stats[NISSY_SIZE_SOLVE_STATS]; 337 long long stats[NISSY_SIZE_SOLVE_STATS];
337 PyByteArrayObject *data; 338 PyByteArrayObject *data;
338 PyObject *list, *item; 339 PyObject *list, *item;
339 340
340 if (!PyArg_ParseTuple(args, "ssIIIIiiY", &cube, &solver, &nissflag, 341 if (!PyArg_ParseTuple(args, "sssIIIIiiY", &cube, &solver, &options,
341 &minmoves, &maxmoves, &maxsolutions, &optimal, &threads, &data)) 342 &nissflag, &minmoves, &maxmoves, &maxsolutions, &optimal,
343 &threads, &data))
342 return NULL; 344 return NULL;
343 345
344 Py_BEGIN_ALLOW_THREADS 346 Py_BEGIN_ALLOW_THREADS
345 result = nissy_solve(cube, solver, nissflag, minmoves, maxmoves, 347 result = nissy_solve(cube, solver, options, nissflag, minmoves,
346 maxsolutions, optimal, threads, data->ob_alloc, data->ob_bytes, 348 maxmoves, maxsolutions, optimal, threads, data->ob_alloc,
347 MAX_SOLUTIONS_SIZE, solutions, stats); 349 data->ob_bytes, MAX_SOLUTIONS_SIZE, solutions, stats);
348 Py_END_ALLOW_THREADS 350 Py_END_ALLOW_THREADS
349 351
350 if(!check_error(result)) { 352 if(!check_error(result)) {

Generated with cgit - Back to sebastiano.tronto.net