liba 0.1.15
An algorithm library based on C/C++
Loading...
Searching...
No Matches
poly.h
Go to the documentation of this file.
1
6#ifndef LIBA_POLY_H
7#define LIBA_POLY_H
8
9#include "a.h"
10
17#if defined(__cplusplus)
18extern "C" {
19#endif /* __cplusplus */
20#if defined(LIBA_POLY_C)
21#undef A_INTERN
22#define A_INTERN A_INLINE
23#endif /* LIBA_POLY_C */
24
29
40#if !defined A_HAVE_INLINE || defined(LIBA_POLY_C)
41A_EXTERN a_float a_poly_eval(a_float const *a, a_size n, a_float x);
42#endif /* A_HAVE_INLINE */
43A_EXTERN a_float a_poly_eval_(a_float const *a, a_float const *b, a_float x);
44#if defined(A_HAVE_INLINE) || defined(LIBA_POLY_C)
45A_INTERN a_float a_poly_eval(a_float const *a, a_size n, a_float x)
46{
47 return n ? a_poly_eval_(a, a + n, x) : 0;
48}
49#endif /* A_HAVE_INLINE */
50
61#if !defined A_HAVE_INLINE || defined(LIBA_POLY_C)
62A_EXTERN a_float a_poly_evar(a_float const *a, a_size n, a_float x);
63#endif /* A_HAVE_INLINE */
64A_EXTERN a_float a_poly_evar_(a_float const *a, a_float const *b, a_float x);
65#if defined(A_HAVE_INLINE) || defined(LIBA_POLY_C)
66A_INTERN a_float a_poly_evar(a_float const *a, a_size n, a_float x)
67{
68 return n ? a_poly_evar_(a, a + n, x) : 0;
69}
70#endif /* A_HAVE_INLINE */
71
72#if defined(LIBA_POLY_C)
73#undef A_INTERN
74#define A_INTERN static A_INLINE
75#endif /* LIBA_POLY_C */
76#if defined(__cplusplus)
77} /* extern "C" */
78#endif /* __cplusplus */
79
82#endif /* a/poly.h */
algorithm library
#define a_float
Definition a.h:785
double a_poly_evar(double const *a, size_t n, double x)
horner function for polynomial
double a_poly_eval(double const *a, size_t n, double x)
horner function for polynomial
double * a_poly_swap(double *a, size_t n)
swap between and
#define a_size
Definition a.h:610