FastPolyEval  1.0
Fast Evaluation of Real and Complex Polynomials
polyfr.h
Go to the documentation of this file.
1 //
2 // polyfr.h
3 //
4 // Authors: Nicolae Mihalache & François Vigneron
5 //
6 // This software is released under BSD licence, with an attribution clause (see Licence file).
7 // Please cite the reference below if you use or distribute this software.
8 //
9 // • [1] R. Anton, N. Mihalache & F. Vigneron. Fast evaluation of real and complex polynomials. 2022.
10 // https://hal.archives-ouvertes.fr/hal-03820369
11 //
12 // Copyright 2022 Univ. Paris-Est Créteil & Univ. de Reims Champagne-Ardenne.
13 //
14 
20 #ifndef polyfr_h
21 #define polyfr_h
22 
23 #include "ntypes.h"
24 #include "compf.h"
25 #include "polyf.h"
26 
27 // MARK: data types
28 
31 typedef struct {
34  bool modified;
36 
41 
44 
45 // MARK: functions prototypes
46 
53 
61 
69 bool polyfr_set(polyfr P, coeff_t coeff, deg_t ind);
70 
78 
86 bool polyfr_eval_c(compf res, polyfr P, compf z);
87 
95 
102 
109 
117 
125 
133 
140 
148 
155 
162 
169 
176 
177 #endif /* polyfr_h */
Definition of machine complex numbers.
compf_struct compf[1]
Practical wrapper for compf_struct.
Definition: compf.h:43
Definition of basic types.
double coeff_t
The machine number type to use for polynomial coefficients and evaluation.
Definition: ntypes.h:81
ulong deg_t
The integer number type to use for polynomial degrees and indexes.
Definition: ntypes.h:128
Definition of complex polynomials with machine floating point coefficients.
bool polyfr_eval_c(compf res, polyfr P, compf z)
Evaluates P(z) using Horner's method.
polyfr polyf_cheb(int n)
Computes the Chebyshev polynomial of degree n.
polyfr polyfr_sqr(polyfr P)
Computes the square of P.
polyfr polyfr_prod(polyfr P, polyfr Q)
Computes P*Q.
polyfr polyfr_diff(polyfr P, polyfr Q)
Computes P-Q.
bool polyfr_set(polyfr P, coeff_t coeff, deg_t ind)
Sets the coefficient corresponding to the power ind to coeff.
polyfr polyfr_sum(polyfr P, polyfr Q)
Computes P+Q.
polyfr polyf_lag(int n)
Computes the Laguerre polynomial of degree n.
polyfr_struct polyfr_t[1]
Practical wrapper for polyfr_struct.
Definition: polyfr.h:40
polyfr polyfr_derivative(polyfr P)
Computes the derivative of P.
bool polyfr_free(polyfr P)
Frees all the memory used by the polynomial P, assuming the struct has been allocated with malloc(),...
polyfr polyfr_new(deg_t degree)
Returns a new real polynomial of given degree, with machine floating point coefficients.
polyfr polyf_her(int n)
Computes the Hermite polynomial of degree n.
coeff_t polyfr_get(polyfr P, deg_t ind)
Returns the coefficient corresponding to the power ind.
polyfr polyf_hyp(int n)
Computes the n-th hyperbolic polynomial, the n-th image of 0 under the iteration of z->z^2+c....
polyfr_struct * polyfr
Convenience pointer to polyfr_struct.
Definition: polyfr.h:43
polyf polyfr_comp(polyfr P)
Return a complex version of the real polynomial P.
polyfr polyf_leg(int n)
Computes the Legendre polynomial of degree n.
coeff_t polyfr_eval(polyfr P, coeff_t x)
Evaluates P(x) using Horner's method.
Polynomial with machine floating point complex coefficients.
Definition: polyf.h:30
Polynomial with machine floating point real coefficients.
Definition: polyfr.h:31
coeff_t * a
the coefficients
Definition: polyfr.h:33
bool modified
the status of the coefficients
Definition: polyfr.h:34
deg_t degree
the degree of the polynomial
Definition: polyfr.h:32