mirror of
https://github.com/vale981/arb
synced 2025-03-04 17:01:40 -05:00
minor editing
This commit is contained in:
parent
37e0ad9610
commit
73a7d07129
9 changed files with 19 additions and 33 deletions
30
dlog.h
30
dlog.h
|
@ -1,27 +1,13 @@
|
|||
/*=============================================================================
|
||||
|
||||
This file is part of ARB.
|
||||
|
||||
ARB is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
ARB is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with ARB; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
=============================================================================*/
|
||||
/******************************************************************************
|
||||
|
||||
/*
|
||||
Copyright (C) 2016 Pascal Molin
|
||||
|
||||
******************************************************************************/
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#ifndef DLOG_H
|
||||
#define DLOG_H
|
||||
|
|
|
@ -37,7 +37,7 @@ dlog_precomp_clear(dlog_precomp_t pre)
|
|||
dlog_order23_clear(pre->t.order23);
|
||||
break;
|
||||
default:
|
||||
printf("THE TYPE IS %d\n", pre->type);
|
||||
flint_printf("dlog_precomp_clear: unknown type %d\n", pre->type);
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -15,12 +15,13 @@
|
|||
void
|
||||
dlog_precomp_modpe_init(dlog_precomp_t pre, ulong a, ulong p, ulong e, ulong pe, ulong num)
|
||||
{
|
||||
if ( pe < DLOG_TABLE_MODPE_LIM )
|
||||
if (pe < DLOG_TABLE_MODPE_LIM)
|
||||
{
|
||||
dlog_precomp_small_init(pre, a, pe, pe - pe / p, num);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
if (e > 1)
|
||||
{
|
||||
pre->type = DLOG_MODPE;
|
||||
|
|
|
@ -18,7 +18,8 @@ dlog_precomp_n_init(dlog_precomp_t pre, ulong a, ulong mod, ulong n, ulong num)
|
|||
{
|
||||
if (n % 2 && n_is_probabprime(n))
|
||||
dlog_precomp_p_init(pre, a, mod, n, num);
|
||||
else {
|
||||
else
|
||||
{
|
||||
if (n < DLOG_TABLE_N_LIM)
|
||||
{
|
||||
dlog_precomp_small_init(pre, a, mod, n, num);
|
||||
|
|
|
@ -10,13 +10,12 @@
|
|||
*/
|
||||
|
||||
#include "dlog.h"
|
||||
#include "math.h"
|
||||
|
||||
/* we known the order is prime */
|
||||
void
|
||||
dlog_precomp_p_init(dlog_precomp_t pre, ulong a, ulong mod, ulong p, ulong num)
|
||||
{
|
||||
if ( p < DLOG_TABLE_P_LIM )
|
||||
if (p < DLOG_TABLE_P_LIM)
|
||||
{
|
||||
dlog_precomp_small_init(pre, a, mod, p, num);
|
||||
}
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
void
|
||||
dlog_precomp_pe_init(dlog_precomp_t pre, ulong a, ulong mod, ulong p, ulong e, ulong pe, ulong num)
|
||||
{
|
||||
if ( pe < DLOG_TABLE_PE_LIM )
|
||||
if (pe < DLOG_TABLE_PE_LIM)
|
||||
{
|
||||
dlog_precomp_small_init(pre, a, mod, pe, num);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( e == 1)
|
||||
if (e == 1)
|
||||
{
|
||||
dlog_precomp_p_init(pre, a, mod, p, num);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ dlog_precomp_small_init(dlog_precomp_t pre, ulong a, ulong mod, ulong n, ulong n
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( mod < DLOG_TABLE_LIM )
|
||||
if (mod < DLOG_TABLE_LIM)
|
||||
{
|
||||
pre->type = DLOG_TABLE;
|
||||
pre->cost = dlog_table_init(pre->t.table, a, mod);
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
*/
|
||||
|
||||
#include "dlog.h"
|
||||
#include <math.h>
|
||||
|
||||
void
|
||||
dlog_rho_init(dlog_rho_t t, ulong a, ulong mod, ulong n)
|
||||
|
|
|
@ -26,6 +26,6 @@ dlog_vec_loop(ulong * v, ulong nv, ulong a, ulong va, nmod_t mod, ulong na, nmod
|
|||
vx = nmod_add(vx, va, order);
|
||||
}
|
||||
while (x != 1);
|
||||
for(x = mod.n + 1; x < nv; x++)
|
||||
for (x = mod.n + 1; x < nv; x++)
|
||||
v[x] = v[x - mod.n];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue