-
Notifications
You must be signed in to change notification settings - Fork 11
/
start.c
38 lines (35 loc) · 849 Bytes
/
start.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "states.h"
#include "modulus.h"
#include "sortstate.h"
#include "outstream.h"
#define FINALSTATE ((uint64_t)-1LL)
int main(int argc, char *argv[])
{
int wd,modidx;
goout *go;
jtset *jts;
statecnt sc;
uint64_t modulus;
if (argc!=3) {
printf ("usage: %s width imod\n", argv[0]);
exit(1);
}
wd = atoi(argv[1]);
modidx = atoi(argv[2]);
printf("%s %d %d\n", argv[0], wd, modidx);
if (modidx < 0 || modidx >= NMODULI) {
printf ("modulo_index %d not in range [0,%d)\n", modidx, NMODULI);
exit(1);
}
modulus = -(uint64_t)modulusdeltas[modidx];
go = goinit(wd, modidx, modulus, 0, 0, 1, 0);
jts = jtalloc(65536, modulus, 1);
sc.state = startstate();
sc.cnt = 1L;
jtinsert(jts, &sc);
dumpstates(go, jts, 0, FINALSTATE);
return 0;
}