FastPolyEval  1.0
Fast Evaluation of Real and Complex Polynomials
powsf.h
Go to the documentation of this file.
1 //
2 // powsf.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 powsf_h
21 #define powsf_h
22 
23 #include "ntypes.h"
24 #include "compf.h"
25 
26 // MARK: data types
27 
30 typedef struct {
32  byte tps;
33  bool *computed;
36 } powsf_struct;
37 
41 typedef powsf_struct powsf_t[1];
42 
45 
46 // MARK: macros & functions prototypes
47 
56 
63 bool powsf_free(powsf zn);
64 
71 bool powsf_set(powsf zn, compf z);
72 
85 
95 
96 #endif /* powsf_h */
Definition of machine complex numbers.
compf_struct compf[1]
Practical wrapper for compf_struct.
Definition: compf.h:43
Definition of basic types.
ulong deg_t
The integer number type to use for polynomial degrees and indexes.
Definition: ntypes.h:128
bool powsf_free(powsf zn)
Frees all the memory used by the buffer zn, assuming the struct has been allocated with malloc(),...
powsf powsf_new(deg_t size)
Returns a new buffer of powers of machine complex numbers, with initial storage space for size powers...
bool powsf_set(powsf zn, compf z)
Sets the complex number of which the powers will be computed by the buffer zn.
compf_ptr powsf_pow(powsf zn, deg_t pow)
Computes z^pow using repeated squares method and the cache of previously computed powers.
powsf_struct powsf_t[1]
Practical wrapper for powsf_struct.
Definition: powsf.h:41
powsf_struct * powsf
Convenience pointer to eval_struct.
Definition: powsf.h:44
compf_ptr powsf_pow_once(powsf zn, deg_t pow)
Computes z^pow using repeated squares method and the cache of previously computed powers.
Machine complex numbers.
Definition: compf.h:29
The powers of the complex number z using machine floating point numbers.
Definition: powsf.h:30
compf res
a buffer for results
Definition: powsf.h:35
bool * computed
the status of powers
Definition: powsf.h:33
compf_ptr zn
the powers of z
Definition: powsf.h:34
deg_t size
the memory size allocated
Definition: powsf.h:31
byte tps
the largest non-negative integer such that 2^tps<=size
Definition: powsf.h:32