/* -*-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
*
/*----- 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.
*
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