FastPolyEval  1.0
Fast Evaluation of Real and Complex Polynomials
Data Structures | Macros | Typedefs | Functions
arrayf.h File Reference

Definition of a variable length array of machine floating point complex numbers. More...

Go to the source code of this file.

Data Structures

struct  arrayf_struct
 A variable length list of machine floating point complex numbers. More...
 

Macros

#define LISTF_MIN_SIZE   100
 
#define LISTF_SIZE_INCREASE   1.25
 

Typedefs

typedef arrayf_struct arrayf_t[1]
 Practical wrapper for arrayf_struct. More...
 
typedef arrayf_structarrayf
 Convenience pointer to arrayf_struct.
 

Functions

arrayf arrayf_new (ulong size)
 Returns a new empty list with memory size at least size. More...
 
arrayf arrayf_new_polyfr (polyfr P)
 Returns the list of coefficients of the real polynomial P. More...
 
arrayf arrayf_new_polyf (polyf P)
 Returns the list of coefficients of the polynomial P. More...
 
bool arrayf_free (arrayf l)
 Frees all the memory used by the list l, assuming the struct has been allocated with malloc(), for example with list_new(). More...
 
bool arrayf_add (arrayf l, compf z)
 Adds the complex number z at the end of the list. The size of the list is automatically increased, if needed. More...
 
compf_ptr arrayf_get (arrayf l, ulong pos)
 Returns the pointer of the element on position pos in the list l. More...
 
bool arrayf_is_real (arrayf l)
 Checks if all complex numbers in the list l are real. More...
 
long arrayf_first_inf (arrayf l)
 Checks if there are infinite values in the list l. More...
 
long arrayf_first_nan (arrayf l)
 Checks if all complex numbers in the list l are well defined. More...
 
polyfr arrayf_polyfr (arrayf l)
 Returns the real polynomial with the coefficients the real parts of the complex numbers in the list l. More...
 
polyf arrayf_polyf (arrayf l)
 Returns the polynomial with the coefficients in the list l. More...
 
bool arrayf_write (arrayf l, char *fileName, bool verbose)
 Writes the list l to a CSV file with the given path fileName. More...
 
bool arrayf_append (arrayf l, char *fileName, bool verbose)
 Writes the list l to the end of a CSV file with the given path fileName. More...
 
arrayf arrayf_read (char *fileName, bool verbose)
 Reads a list of complex numbers from the CSV file with path fileName. More...
 

Detailed Description

Definition of a variable length array of machine floating point complex numbers.

Definition in file arrayf.h.

Typedef Documentation

◆ arrayf_t

typedef arrayf_struct arrayf_t[1]

Practical wrapper for arrayf_struct.

To avoid the constant use * and & the type arrayf_t is a pointer.

Definition at line 47 of file arrayf.h.

Function Documentation

◆ arrayf_add()

bool arrayf_add ( arrayf  l,
compf  z 
)

Adds the complex number z at the end of the list. The size of the list is automatically increased, if needed.

Parameters
lthe list
zthe new element to add to the list
Returns
true if successfull, false otherwise.

◆ arrayf_append()

bool arrayf_append ( arrayf  l,
char *  fileName,
bool  verbose 
)

Writes the list l to the end of a CSV file with the given path fileName.

Parameters
lthe list
fileNamethe path of the CSV file
verbosetrue to print information about the error, if any
Returns
true if successfull, false otherwise.

◆ arrayf_first_inf()

long arrayf_first_inf ( arrayf  l)

Checks if there are infinite values in the list l.

Parameters
lthe list
Returns
the position of the first infinite value in l, -1 if there is none, LONG_MAX if some error occurred.

◆ arrayf_first_nan()

long arrayf_first_nan ( arrayf  l)

Checks if all complex numbers in the list l are well defined.

Parameters
lthe list
Returns
the position of the first undefined value in l, -1 if there is none, LONG_MAX if some error occurred.

◆ arrayf_free()

bool arrayf_free ( arrayf  l)

Frees all the memory used by the list l, assuming the struct has been allocated with malloc(), for example with list_new().

Parameters
lthe list
Returns
true if successfull, false otherwise.

◆ arrayf_get()

compf_ptr arrayf_get ( arrayf  l,
ulong  pos 
)

Returns the pointer of the element on position pos in the list l.

Parameters
lthe list
posthe position of the element
Returns
the pointer to the element on position pos in l, NULL if some error occurred.

◆ arrayf_is_real()

bool arrayf_is_real ( arrayf  l)

Checks if all complex numbers in the list l are real.

Parameters
lthe list
Returns
true if all elements in the list are real, false otherwise.

◆ arrayf_new()

arrayf arrayf_new ( ulong  size)

Returns a new empty list with memory size at least size.

Parameters
sizethe number of elements to allocate memory for
Returns
the list, NULL if not enougn memory is available

◆ arrayf_new_polyf()

arrayf arrayf_new_polyf ( polyf  P)

Returns the list of coefficients of the polynomial P.

Parameters
Pthe polynomial
Returns
the list, NULL if some error occurred.

◆ arrayf_new_polyfr()

arrayf arrayf_new_polyfr ( polyfr  P)

Returns the list of coefficients of the real polynomial P.

Parameters
Pthe real polynomial
Returns
the list, NULL if some error occurred.

◆ arrayf_polyf()

polyf arrayf_polyf ( arrayf  l)

Returns the polynomial with the coefficients in the list l.

Parameters
lthe list
Returns
the polynomial, NULL if some error occurred.

◆ arrayf_polyfr()

polyfr arrayf_polyfr ( arrayf  l)

Returns the real polynomial with the coefficients the real parts of the complex numbers in the list l.

Parameters
lthe list
Returns
the polynomial, NULL if some coefficients are not real or some other error occurred.

◆ arrayf_read()

arrayf arrayf_read ( char *  fileName,
bool  verbose 
)

Reads a list of complex numbers from the CSV file with path fileName.

Parameters
fileNamethe path of the CSV file
verbosetrue to print information about the file and the error, if any
Returns
the list of complex numbers in the CSV file, NULL if some error occurred.

◆ arrayf_write()

bool arrayf_write ( arrayf  l,
char *  fileName,
bool  verbose 
)

Writes the list l to a CSV file with the given path fileName.

Parameters
lthe list
fileNamethe path of the CSV file
verbosetrue to print information about the error, if any
Returns
true if successfull, false otherwise.