From 8174a918ea3b7cb216bf7ea98cfdc10661b5c37d Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 6 May 2020 16:56:32 +0200 Subject: make the whole project more python idiomatic * rename src directory to allocbench * make global variable names UPPERCASE * format a lot of code using yapf * use lowercase ld_preload and ld_library_path as Allocator members * name expected Errors 'err' and don't raise a new Exception * disable some pylint messages --- src/benchmarks/cfrac/pfactor.h | 62 ------------------------------------------ 1 file changed, 62 deletions(-) delete mode 100644 src/benchmarks/cfrac/pfactor.h (limited to 'src/benchmarks/cfrac/pfactor.h') diff --git a/src/benchmarks/cfrac/pfactor.h b/src/benchmarks/cfrac/pfactor.h deleted file mode 100644 index edd5686..0000000 --- a/src/benchmarks/cfrac/pfactor.h +++ /dev/null @@ -1,62 +0,0 @@ -typedef struct Pfs { - struct Pfs *next; - precision factor; - unsigned count; -} Pfactor; - -typedef Pfactor *FactorPtr; -typedef FactorPtr FactorList; -typedef precision (*pfunc)(); /* pointer to func returning precision */ - -#ifndef __STDC__ - -extern int pprime(); /* test whether a number is prime */ -extern precision pnextprime(); /* next prime >= it's argument */ - -extern precision pgcd(); /* greatest common divisor */ -extern precision plcm(); /* least common multiple */ -extern precision peuclid(); /* extended euclid's algorithm */ - -extern precision prho(); /* find factor using rho method */ -extern precision pfermat(); /* find factor using Fermat's method */ -extern precision pcfrac(); /* factor w/continued fractions */ - -extern int prhoInit(); /* alter parameters for rho method */ -extern int pcfracInit(); /* alter paramteres for cfrac method */ - -extern precision ptrial(); /* find factors using trial division */ -extern precision prfactor(); /* recursively factor a number */ - -extern void paddfactor(); /* add a factor to a factorlist */ -extern void pputfactors(); /* print a factorlist */ -extern void pfreefactors(); /* return a factorlist to memory */ - -#else - -extern int pprime(precision, unsigned trialCount); -extern precision pnextprime(precision, unsigned trialCount); - -extern precision pgcd(precision, precision); -extern precision plcm(precision, precision); -extern precision peuclid(precision, precision, precision *, precision *); - -extern precision prho(precision n, unsigned *maxCount); -extern precision pfermat(precision n, unsigned *maxCount); -extern precision pcfrac(precision n, unsigned *maxCount); - -extern int prhoInit(precision c, unsigned batchSize); -extern int pcfracInit(unsigned m, unsigned k, unsigned aborts); - -extern precision ptrial(precision n, unsigned *maxCount, FactorList *); -extern precision prfactor(precision, unsigned *maxCount, pfunc, FactorList *); - -extern void paddfactor(FactorList *, precision); -extern void pfreefactors(FactorList *); - -#ifndef BUFSIZE -#include -#endif - -extern void pputfactors(FILE *, FactorList); - -#endif -- cgit v1.2.3