From 64d27fe0d94875d1427199b106e9ee6e622b03d1 Mon Sep 17 00:00:00 2001 From: mdw Date: Tue, 15 Aug 2000 21:42:56 +0000 Subject: [PATCH] Use the small primes type from `genprimes' output. New function for doing trial division the hard way. --- pfilt.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pfilt.h b/pfilt.h index e3461d2..9076701 100644 --- a/pfilt.h +++ b/pfilt.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: pfilt.h,v 1.1 1999/12/22 15:49:39 mdw Exp $ + * $Id: pfilt.h,v 1.2 2000/08/15 21:42:56 mdw Exp $ * * Finding and testing prime numbers * @@ -30,6 +30,10 @@ /*----- Revision history --------------------------------------------------* * * $Log: pfilt.h,v $ + * Revision 1.2 2000/08/15 21:42:56 mdw + * Use the small primes type from `genprimes' output. New function for + * doing trial division the hard way. + * * Revision 1.1 1999/12/22 15:49:39 mdw * Renamed from `pgen'. Reworking for new prime-search system. * @@ -65,11 +69,24 @@ typedef struct pfilt { mp *m; - unsigned char r[NPRIME]; + smallprime r[NPRIME]; } pfilt; /*----- Functions provided ------------------------------------------------*/ +/* --- @pfilt_smallfactor@ --- * + * + * Arguments: @mp *m@ = integer to test + * + * Returns: One of the @PGEN@ result codes. + * + * Use: Tests a number by dividing by a number of small primes. This + * is a useful first step if you're testing random primes; for + * sequential searches, @pfilt_create@ works better. + */ + +extern int pfilt_smallfactor(mp */*m*/); + /* --- @pfilt_create@ --- * * * Arguments: @pfilt *p@ = pointer to prime filtering context -- 2.11.0