siqs_sieve.h File Reference

Structure and functions related to the sieve used in the SIQS algorithm. More...

#include <stdint.h>
#include <stdbool.h>
#include <gmp.h>
#include "exit_codes.h"
#include "array.h"
#include "approx.h"
#include "buckets.h"
#include "siqs_poly.h"
#include "stopwatch.h"

Go to the source code of this file.

Data Structures

struct  struct_siqs_sieve_t
 Defines the sieve used by SIQS. More...

Typedefs

typedef struct struct_siqs_sieve_t siqs_sieve_t
 Equivalent to struct_siqs_sieve_t.

Functions

siqs_sieve_talloc_siqs_sieve (mpz_t n, uint32_array_t *const factor_base, byte_array_t *const log_primes, uint32_array_t *const sqrtm_pi, uint32_t half_width)
 Allocates and returns a new siqs_sieve_t.
void free_siqs_sieve (siqs_sieve_t *sieve)
 Frees a previously allocated siqs_sieve_t.
ecode_t fill_sieve (siqs_sieve_t *const sieve)
 Fills the next chunk of an siqs_sieve_t.
ecode_t scan_sieve (siqs_sieve_t *const sieve, int32_array_t *const survivors, uint32_t nsurvivors)
 Scans a chunk of an siqs_sieve_t.
void set_siqs_sieve_threshold (siqs_sieve_t *const sieve, uint32_t threshold)
 Sets the siqs_sieve_t's threshold.
void print_init_poly_timing (siqs_sieve_t *const sieve)
 Prints an siqs_sieve_t's poly init timing.
void print_fill_timing (siqs_sieve_t *const sieve)
 Prints an siqs_sieve_t's fill timing.
void print_scan_timing (siqs_sieve_t *const sieve)
 Prints an siqs_sieve_t's scan timing.


Detailed Description

Structure and functions related to the sieve used in the SIQS algorithm.

Author:
Jerome Milan
Date:
Fri Jun 10 2011
Version:
2011-06-10

Definition in file siqs_sieve.h.


Function Documentation

siqs_sieve_t* alloc_siqs_sieve ( mpz_t  n,
uint32_array_t *const   factor_base,
byte_array_t *const   log_primes,
uint32_array_t *const   sqrtm_pi,
uint32_t  half_width 
)

Allocates and returns a new siqs_sieve_t.

Parameters:
n the number to factor (or a small multiple)
factor_base the factor base
log_primes logarithms (in base 2) of the primes in the base
sqrtm_pi modular square roots of n for each prime in the base
half_width the (approximate) half_width of the sieving interval (the real half_width will be adjusted to be a multiple of chunk_size if ROUND_HALF_WIDTH is defined as non zero)
Returns:
A pointer to the newly allocated siqs_sieve_t.

ecode_t fill_sieve ( siqs_sieve_t *const   sieve  ) 

Fills the next chunk of an siqs_sieve_t.

Fills the next chunk of sieve, transparently updating (if needed) the polynomial used.

Parameters:
sieve the siqs_sieve_t to fill.
Returns:
An exit code.

void free_siqs_sieve ( siqs_sieve_t sieve  ) 

Frees a previously allocated siqs_sieve_t.

Frees all memory used by the pointed siqs_sieve_t and then frees the sieve pointer.

Warning:
Do not call free(sieve) in client code after a call to free_siqs_sieve(sieve): it would result in an error.
Parameters:
sieve the siqs_sieve_t to free.

void print_fill_timing ( siqs_sieve_t *const   sieve  ) 

Prints an siqs_sieve_t's fill timing.

Prints the time taken by sieve to fill its sieve chunks.

Parameters:
sieve the siqs_sieve_t to read.

void print_init_poly_timing ( siqs_sieve_t *const   sieve  ) 

Prints an siqs_sieve_t's poly init timing.

Prints the time taken by sieve to initialize its polynomials.

Parameters:
sieve the siqs_sieve_t to read.

void print_scan_timing ( siqs_sieve_t *const   sieve  ) 

Prints an siqs_sieve_t's scan timing.

Prints the time taken by sieve to scan its sieve chunks.

Parameters:
sieve the siqs_sieve_t to read.

ecode_t scan_sieve ( siqs_sieve_t *const   sieve,
int32_array_t *const   survivors,
uint32_t  nsurvivors 
)

Scans a chunk of an siqs_sieve_t.

Scans the last filled chunk of sieve.

Parameters:
sieve the siqs_sieve_t to scan.
Returns:
An exit code.

void set_siqs_sieve_threshold ( siqs_sieve_t *const   sieve,
uint32_t  threshold 
)

Sets the siqs_sieve_t's threshold.

Sets sieve's threshold (all positions xi with sieve[xi] < threshold will be tested for smoothness).

Parameters:
sieve the siqs_sieve_t to update.
threshold the new threshold's value.


Generated on Fri Jun 17 11:10:12 2011 for TIFA by Doxygen 1.5.5