Skip to content

Commit

Permalink
sbndm minlen 2
Browse files Browse the repository at this point in the history
fixes bin/sbndm a 1 aaaaaaaaaa 10
  • Loading branch information
rurban committed Dec 2, 2024
1 parent bff0a0c commit 513c564
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/algocfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const struct algocfg ALGOCFGS[] = {
[_SA] = {_SA, GOOD, ASAN, VFY_PASS, 0, 0, 0, 0, 0, 0},
[_BNDM] = {_BNDM, GOOD, ASAN, VFY_PASS, 0, 0, 0, 0, 0, 0},
[_BNDML] = {_BNDML, GOOD, ASAN, VFY_PASS, 0, 0, 0, 0, 0, 0},
[_SBNDM] = {_SBNDM, GOOD, ASAN, VFY_PASS, 0, 0, 0, 0, 0, 0},
[_SBNDM] = {_SBNDM, GOOD, ASAN, VFY_PASS, 2, 32, 0, 0, 0, 0},
[_TNDM] = {_TNDM, GOOD, ASAN, VFY_PASS, 0, 0, 0, 0, 0, 0},
[_TNDMa] = {_TNDMa, GOOD, ASAN, VFY_PASS, 0, 0, 0, 0, 0, 0},
[_LBNDM] = {_LBNDM, GOOD, ASAN, VFY_PASS, 2, 0, 0, 0, 0, 0},
Expand Down
2 changes: 1 addition & 1 deletion source/algorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ const struct algo ALGOS[] = {
[_SA] = {_SA, OK, "sa", "Shift-And", 0, 0},
[_BNDM] = {_BNDM, OK, "bndm", "BNDM for Long patterns", 0, 0},
[_BNDML] = {_BNDML, OK, "bndml", "BNDM for Long patterns", 0, 0},
[_SBNDM] = {_SBNDM, OK, "sbndm", "Simplified BNDM", 0, 0},
[_SBNDM] = {_SBNDM, OK, "sbndm", "Simplified BNDM", 2, 0},
[_TNDM] = {_TNDM, OK, "tndm", "Two-Way Nondeterministic DAWG Matching", 0, 0},
[_TNDMa] = {_TNDMa, OK, "tndma", "Two-Way Nondeterministic DAWG Matching (version 2)", 0, 0},
[_LBNDM] = {_LBNDM, OK, "lbndm", "long patterns bndm", 2, 0},
Expand Down
5 changes: 4 additions & 1 deletion source/algos/sbndm.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
* Matching. Proceedings of the 10th International Symposium on String
* Processing and Information Retrieval SPIRE'03, Lecture Notes in Computer
* Science, vol.2857, pp.80--94, Springer-Verlag, Berlin, (2003).
*
* Constraints: m >= 2, m < 32
*/

#include "include/define.h"
#include "include/main.h"
#include "include/search_small.h"

int search_large(unsigned char *x, int m, unsigned char *y, int n);

Expand All @@ -38,7 +41,7 @@ int search(unsigned char *x, int m, unsigned char *y, int n) {
if (m > 32)
return search_large(x, m, y, n);
if (m < 2)
return -1;
return search_small(x, m, y, n);

/* Preprocessing */
BEGIN_PREPROCESSING
Expand Down

0 comments on commit 513c564

Please sign in to comment.