~ubuntu-branches/ubuntu/quantal/flint/quantal

« back to all changes in this revision

Viewing changes to QS/mp_factor_base.h

  • Committer: Bazaar Package Importer
  • Author(s): Tim Abbott
  • Date: 2008-05-30 00:34:12 UTC
  • Revision ID: james.westby@ubuntu.com-20080530003412-84wwi86s4iy2gji1
Tags: upstream-1.06
ImportĀ upstreamĀ versionĀ 1.06

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*============================================================================
 
2
 
 
3
    This file is part of FLINT.
 
4
 
 
5
    FLINT is free software; you can redistribute it and/or modify
 
6
    it under the terms of the GNU General Public License as published by
 
7
    the Free Software Foundation; either version 2 of the License, or
 
8
    (at your option) any later version.
 
9
 
 
10
    FLINT is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
    GNU General Public License for more details.
 
14
 
 
15
    You should have received a copy of the GNU General Public License
 
16
    along with FLINT; if not, write to the Free Software
 
17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
18
 
 
19
===============================================================================*/
 
20
/******************************************************************************
 
21
 
 
22
 mp_factor_base.h
 
23
 Header file for factor_base.c.
 
24
 
 
25
 (C) 2006 William Hart
 
26
 
 
27
******************************************************************************/
 
28
 
 
29
#ifndef MP_FACTORBASE_H
 
30
#define MP_FACTORBASE_H
 
31
 
 
32
#include <gmp.h>
 
33
 
 
34
#include "mpQS.h"
 
35
#include "common.h"
 
36
 
 
37
#define KSMAX 1000
 
38
 
 
39
unsigned long num_FB_primes(unsigned long bits);
 
40
 
 
41
void sqrts_init(QS_t * qs_inf);
 
42
 
 
43
void sqrts_clear(void);
 
44
 
 
45
void compute_sizes(QS_t * qs_inf);
 
46
 
 
47
void sizes_clear(void);
 
48
 
 
49
//Knuth-Schroeppel multipliers and a macro to count them
 
50
 
 
51
static const unsigned long multipliers[] = {1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 
 
52
                                            15, 17, 19, 21, 22, 23, 26, 29, 
 
53
                                            30, 31, 33, 34, 35, 37, 38, 41, 
 
54
                                            42, 43, 47};
 
55
 
 
56
#define NUMMULTS (sizeof(multipliers)/sizeof(unsigned long))
 
57
#define max_mult_size 6 // number of bits of maximum multiplier
 
58
 
 
59
void primes_clear(void);
 
60
 
 
61
void primes_init(QS_t * qs_inf);
 
62
 
 
63
unsigned long knuth_schroeppel(QS_t * qs_inf);
 
64
 
 
65
unsigned long compute_factor_base(QS_t * qs_inf);
 
66
 
 
67
#endif