diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-10-19 13:59:24 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-10-30 18:11:22 -0400 |
commit | 8e3a7158ecae541692826e7b5998c8ffc810173a (patch) | |
tree | beda4f9f8604f77d0513d5fb02b7ddf53d203d09 /libdimension/polynomial.c | |
parent | e9810a7b1aae15320e58371b657a2f963562834d (diff) | |
download | dimension-8e3a7158ecae541692826e7b5998c8ffc810173a.tar.xz |
Make API more consistent.
Object methods should be dmnsn_<object>_<fn>().
Diffstat (limited to 'libdimension/polynomial.c')
-rw-r--r-- | libdimension/polynomial.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libdimension/polynomial.c b/libdimension/polynomial.c index c793562..56f087d 100644 --- a/libdimension/polynomial.c +++ b/libdimension/polynomial.c @@ -244,15 +244,15 @@ dmnsn_bisect_root(const double poly[], size_t degree, double min, double max) return dmnsn_improve_root(poly, degree, min); } - double evmin = dmnsn_evaluate_polynomial(poly, degree, min); - double evmax = dmnsn_evaluate_polynomial(poly, degree, max); + double evmin = dmnsn_polynomial_evaluate(poly, degree, min); + double evmax = dmnsn_polynomial_evaluate(poly, degree, max); double initial_evmin = fabs(evmin), initial_evmax = fabs(evmax); double mid = 0.0, evmid; int lastsign = -1; do { mid = (min*evmax - max*evmin)/(evmax - evmin); - evmid = dmnsn_evaluate_polynomial(poly, degree, mid); + evmid = dmnsn_polynomial_evaluate(poly, degree, mid); int sign = dmnsn_signbit(evmid); if (mid < min) { @@ -394,7 +394,7 @@ dmnsn_solve_cubic(double poly[4], double x[3]) /* Uspensky's algorithm */ DMNSN_HOT size_t -dmnsn_solve_polynomial(const double poly[], size_t degree, double x[]) +dmnsn_polynomial_solve(const double poly[], size_t degree, double x[]) { /* Copy the polynomial so we can be destructive */ double p[degree + 1]; @@ -454,7 +454,7 @@ dmnsn_solve_polynomial(const double poly[], size_t degree, double x[]) /* Print a polynomial */ void -dmnsn_print_polynomial(FILE *file, const double poly[], size_t degree) +dmnsn_polynomial_print(FILE *file, const double poly[], size_t degree) { for (size_t i = degree + 1; i-- > 0;) { if (i < degree) { |