aboutsummaryrefslogtreecommitdiff
path: root/src/benchmarks/cfrac/pfactor.h
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-05-06 16:56:32 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-06-02 11:18:47 +0200
commit8174a918ea3b7cb216bf7ea98cfdc10661b5c37d (patch)
tree0747ec3ccb9f8d7eeccfac35977fc17855ca3bbb /src/benchmarks/cfrac/pfactor.h
parent8f52e8fc02dd235582f5961941bcd564e9a681cd (diff)
downloadallocbench-8174a918ea3b7cb216bf7ea98cfdc10661b5c37d.tar.gz
allocbench-8174a918ea3b7cb216bf7ea98cfdc10661b5c37d.zip
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
Diffstat (limited to 'src/benchmarks/cfrac/pfactor.h')
-rw-r--r--src/benchmarks/cfrac/pfactor.h62
1 files changed, 0 insertions, 62 deletions
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 <stdio.h>
-#endif
-
-extern void pputfactors(FILE *, FactorList);
-
-#endif