Skip to content

Commit

Permalink
Fixing choice of forms according to indices
Browse files Browse the repository at this point in the history
  • Loading branch information
assaferan committed Jun 24, 2023
1 parent 38fc122 commit b898266
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/omf5.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ int main(int argc, char* argv[])
is_valid = (is_valid) || (is_idxs);
if (is_idxs) {
has_idxs = true;
printf("Read %d indices. These are their values:", num_idxs);
fprintf(stderr, "Read %d indices. These are their values:", num_idxs);
for (j = 0; j < num_idxs; j++)
printf("%d,", idxs[j]);
printf("\b\n");
fprintf(stderr, "%d,", idxs[j]);
fprintf(stderr, "\b\n");
}

if (!is_valid)
Expand Down
22 changes: 17 additions & 5 deletions src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,14 @@ STATUS test_evs(const genus_t genus, const example_evs_t ex, bool nonlifts, int
for (c = 0; c < num_conductors; c++) {
if (num_idxs == 0)
eigenvalues_set_lifts(evs[c], 2, c, genus);
if (next_idx < num_idxs) {
for (form_idx = 0; form_idx < evs[c]->num; form_idx++, total_idx++) {
evs[c]->lift_type[form_idx] = O;
if ((next_idx < num_idxs) && (total_idx == idxs[next_idx++]))
evs[c]->lift_type[form_idx] = G;
// fprintf(stderr, "next_idx = %d, num_idxs = %d\n", next_idx, num_idxs);
for (form_idx = 0; form_idx < evs[c]->num; form_idx++, total_idx++) {
evs[c]->lift_type[form_idx] = O;
// fprintf(stderr, "total_idx = %d, idxs[%d] = %d\n", total_idx, next_idx, idxs[next_idx]);
if ((next_idx < num_idxs) && (total_idx == idxs[next_idx])) {
// fprintf(stderr, "Setting nonlift at total_idx = %d = idxs[%d] = %d\n", total_idx, next_idx, idxs[next_idx]);
evs[c]->lift_type[form_idx] = G;
next_idx++;
}
}
if (c != 0)
Expand All @@ -275,6 +278,15 @@ STATUS test_evs(const genus_t genus, const example_evs_t ex, bool nonlifts, int
has_spinor = true;
}

// We check what indices really get to be checked as nonlifts
total_idx = 0;
for (c = 0; c < num_conductors; c++)
for (form_idx = 0; form_idx < evs[c]->num; form_idx++, total_idx++)
if ((!nonlifts) || (evs[c]->lift_type[form_idx] == G)) {
fprintf(stderr, "Found nonlift at total_idx = %d", total_idx);
fprintf(stderr, ", c = %ld, form_idx = %d\n", c, form_idx);
}

printf("{");
for (c = 0; c < num_conductors; c++) {
printf("%ld : [", genus->conductors[c]);
Expand Down

0 comments on commit b898266

Please sign in to comment.