2016-09-06 15:43:12 +02:00
|
|
|
/*
|
2016-03-23 22:10:58 +01:00
|
|
|
Copyright (C) 2016 Pascal Molin
|
|
|
|
|
2016-09-06 15:43:12 +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-03-23 22:10:58 +01:00
|
|
|
|
|
|
|
#include "dlog.h"
|
|
|
|
|
|
|
|
/* log mod p^e */
|
|
|
|
void
|
|
|
|
dlog_precomp_modpe_init(dlog_precomp_t pre, ulong a, ulong p, ulong e, ulong pe, ulong num)
|
|
|
|
{
|
2016-09-14 14:08:31 +02:00
|
|
|
if (pe < DLOG_TABLE_MODPE_LIM)
|
2016-03-23 22:10:58 +01:00
|
|
|
{
|
|
|
|
dlog_precomp_small_init(pre, a, pe, pe - pe / p, num);
|
|
|
|
return;
|
|
|
|
}
|
2016-09-14 14:08:31 +02:00
|
|
|
else
|
|
|
|
{
|
2016-03-23 22:10:58 +01:00
|
|
|
if (e > 1)
|
|
|
|
{
|
|
|
|
pre->type = DLOG_MODPE;
|
|
|
|
pre->cost = dlog_modpe_init(pre->t.modpe, a, p, e, pe, num);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
dlog_precomp_n_init(pre, a, p, p - 1, num);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|