From 3bfd0bb403d62bd942d1912d085ea59b156062fd Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 10 Feb 2023 23:30:20 +0100 Subject: Added (just a few) tests for alg and added fields to alg struct --- src/solve.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'src/solve.c') diff --git a/src/solve.c b/src/solve.c index df15cca..d5a8f3d 100644 --- a/src/solve.c +++ b/src/solve.c @@ -4,7 +4,6 @@ /* Local functions ***********************************************************/ -static bool allowed_next(Move move, Step *s, Move l0, Move l1); static bool cancel_niss(DfsArg *arg); static void copy_dfsarg(DfsArg *src, DfsArg *dst); static void dfs(DfsArg *arg); @@ -18,19 +17,6 @@ static bool solvestop(int d, int op, SolveOptions *opts, AlgList *sols); /* Local functions ***********************************************************/ -static bool -allowed_next(Move m, Step *s, Move l0, Move l1) -{ - bool allowed, order; - uint64_t mbit; - - mbit = ((uint64_t)1) << m; - allowed = mbit & s->moveset->mask[l1][l0]; - order = !commute(l0, m) || l0 < m; - - return allowed && order; -} - static bool cancel_niss(DfsArg *arg) { @@ -82,16 +68,14 @@ copy_dfsarg(DfsArg *src, DfsArg *dst) dst->ind[i].t = src->ind[i].t; } -/* src->s->copy_extra(src, dst); -*/ } static void dfs(DfsArg *arg) { int i; - Move m; + Move m, l0, l1; DfsArg newarg; if (dfs_move_checkstop(arg)) @@ -105,9 +89,11 @@ dfs(DfsArg *arg) for (i = 0; arg->s->moveset->sorted_moves[i] != NULLMOVE; i++) { m = arg->s->moveset->sorted_moves[i]; - if (allowed_next(m, arg->s, arg->last[0], arg->last[1])) { + l0 = arg->last[0]; + l1 = arg->last[1]; + if (possible_next(m, arg->s->moveset, l0, l1)) { copy_dfsarg(arg, &newarg); - newarg.last[1] = arg->last[0]; + newarg.last[1] = l0; newarg.last[0] = m; append_move(arg->current_alg, m, newarg.niss); dfs(&newarg); -- cgit v1.3