#include <factoring_program.h>
Data Fields | |
int | argc |
char ** | argv |
mpz_t | n |
factoring_mode_t | mode |
int | verbose |
int | timing |
uint32_t | nprimes_tdiv |
uint32_t | nfactors |
char * | algo_name |
void * | params |
void(* | print_usage_func )(struct struct_factoring_program *const) |
void(* | print_params_func )(struct struct_factoring_program *const) |
void(* | process_args_func )(struct struct_factoring_program *const) |
ecode_t(* | factoring_algo_func )(mpz_array_t *const factors, uint32_array_t *const multis, const mpz_t n, const void *const params, factoring_mode_t mode) |
void(* | set_params_to_default_func )(struct struct_factoring_program *const) |
tools/include/factoring_program.h
This structure defines a set of data and functions to represent the logic behind all factorization programs. The idea is to be able to write down the actual factoring process once and for all so that actual factorization program can use such a structure by merely "filling-in" the gaps.
Definition at line 58 of file factoring_program.h.
Argument count as given by the "main" function.
Definition at line 62 of file factoring_program.h.
Argument values as given by the "main" function.
Definition at line 66 of file factoring_program.h.
Integer to factor.
Definition at line 70 of file factoring_program.h.
Factoring mode to use.
Definition at line 74 of file factoring_program.h.
Verbosity option. Should be either 1 (be verbose) or 0 (stay laconic).
Definition at line 78 of file factoring_program.h.
Timing option. Should be either 1 (proceed with timings) or 0 (do not perform timings).
Definition at line 83 of file factoring_program.h.
Number of primes used in the trial division of the number to factor.
Definition at line 87 of file factoring_program.h.
uint32_t struct_factoring_program::nfactors |
The maximum number of factors to collect (excluding the factors found in the trial division stage).
Definition at line 92 of file factoring_program.h.
Name of the factoring algorithm to use (preferably a short acronym).
Definition at line 96 of file factoring_program.h.
A pointer to the parameters of the factoring algorithm to use.
Definition at line 100 of file factoring_program.h.
void(* struct_factoring_program::print_usage_func)(struct struct_factoring_program *const) |
A pointer to a function printing the usage of the factoring program.
A | pointer to the factoring_program_t used by the actual factoring program. |
void(* struct_factoring_program::print_params_func)(struct struct_factoring_program *const) |
A pointer to a function printing the values of the parameters used by the actual factoring program.
A | pointer to the factoring_program_t used by the actual factoring program. |
void(* struct_factoring_program::process_args_func)(struct struct_factoring_program *const) |
A pointer to a function reading arguments on the command line and setting the parameters of the actual factoring program.
A | pointer to the factoring_program_t used by the actual factoring program. |
ecode_t(* struct_factoring_program::factoring_algo_func)(mpz_array_t *const factors, uint32_array_t *const multis, const mpz_t n, const void *const params, factoring_mode_t mode) |
A pointer to a function implementing the factorization algorithm to use.
factors | An mpz_array_t to hold the found factors. | |
factors | A uint32_array_t to hold the found multiplicities. | |
n | The integer to factor. | |
params | A pointer to the parameters to be used in the factorization algorithm. | |
mode | The factorization mode to use. |
void(* struct_factoring_program::set_params_to_default_func)(struct struct_factoring_program *const) |
A pointer to a function setting the algorithm's parameters to some default values.
A | pointer to the factoring_program_t used by the actual factoring program. |