![]() |
FastPolyEval
1.0
Fast Evaluation of Real and Complex Polynomials
|
Definition of a buffer for pre-computed powers of a machine complex number. More...
Go to the source code of this file.
Data Structures | |
struct | powsf_struct |
The powers of the complex number z using machine floating point numbers. More... | |
Typedefs | |
typedef powsf_struct | powsf_t[1] |
Practical wrapper for powsf_struct . More... | |
typedef powsf_struct * | powsf |
Convenience pointer to eval_struct . | |
Functions | |
powsf | powsf_new (deg_t size) |
Returns a new buffer of powers of machine complex numbers, with initial storage space for size powers. More... | |
bool | powsf_free (powsf zn) |
Frees all the memory used by the buffer zn , assuming the struct has been allocated with malloc() , for example with powsf_new() . More... | |
bool | powsf_set (powsf zn, compf z) |
Sets the complex number of which the powers will be computed by the buffer zn . More... | |
compf_ptr | powsf_pow (powsf zn, deg_t pow) |
Computes z^pow using repeated squares method and the cache of previously computed powers. More... | |
compf_ptr | powsf_pow_once (powsf zn, deg_t pow) |
Computes z^pow using repeated squares method and the cache of previously computed powers. More... | |
Definition of a buffer for pre-computed powers of a machine complex number.
Definition in file powsf.h.
typedef powsf_struct powsf_t[1] |
Practical wrapper for powsf_struct
.
To avoid the constant use *
and &
the type powsf_t
is a pointer.
Frees all the memory used by the buffer zn
, assuming the struct has been allocated with malloc()
, for example with powsf_new()
.
zn | the powers buffer |
Returns a new buffer of powers of machine complex numbers, with initial storage space for size
powers.
size
must be at most MAX_DEG
.size | the size of the buffer |
NULL
if some error occurred. Computes z^pow
using repeated squares method and the cache of previously computed powers.
It caches intermediary powers of z
that have been computed to accelerate later calls of this function. Also, if pow
is larger than the size of the buffer zn
, it is automatically increased to store the result.
zn | the powers buffer |
pow | the power to compute |
z^pow
, NULL
if some error occurred. Computes z^pow
using repeated squares method and the cache of previously computed powers.
It does NOT cache intermediary powers of z
into zn
.
zn | the powers buffer |
pow | the power to compute |
z^pow
, NULL
if some error occurred.