arb/dirichlet/ui_vec_set_null.c

32 lines
746 B
C
Raw Normal View History

2016-09-06 15:32:23 +02:00
/*
Copyright (C) 2016 Pascal Molin
2016-09-06 15:32:23 +02:00
This file is part of Arb.
Arb is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
2016-10-06 14:19:39 +02:00
#include "dirichlet.h"
void
2016-10-08 17:22:19 +02:00
dirichlet_vec_set_null(ulong *v, const dirichlet_group_t G, slong nv)
{
2016-03-29 14:37:21 +01:00
slong k, l;
2016-03-29 14:04:08 +01:00
if (G->q_even > 1)
{
for (k = 2; k < nv; k += 2)
v[k] = -1;
}
2016-07-14 15:51:25 +02:00
for (l = G->neven; l < G->num; l++)
2016-03-29 14:04:08 +01:00
{
ulong p = G->P[l].p;
2016-03-29 14:04:08 +01:00
for (k = p; k < nv; k += p)
2016-10-06 14:19:39 +02:00
v[k] = DIRICHLET_CHI_NULL;
2016-03-29 14:04:08 +01:00
}
}