Bachelor's degree final project  v1.0
Faculty of Mathematics, University of Barcelona
Data Structures | Defines | Typedefs | Functions
src/include/pic.h File Reference

Header of periodic invariant curve. More...

#include "newton.h"
+ Include dependency graph for pic.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pic
 Periodic Invariant Curve. More...

Defines

#define PIC_AUTONOMOUS
 The dynamic system is autonomous.
#define PIC_NAUTONOMOUS
 The dynamic system is not autonomous.

Typedefs

typedef struct pic pic

Functions

unsigned int pic_get_max_iterations ()
 Get maximum number of iterations.
unsigned int pic_set_max_iterations (unsigned int max_iter)
 Set maximum number of iterations.
size_t pic_get_n (struct pic *const)
size_t pic_get_N (struct pic *const)
double * pic_get_x (struct pic *const)
double * pic_get_X (struct pic *const)
double ** pic_get_DF (struct pic *const)
double pic_get_w (struct pic *const)
size_t pic_get_mesh_size (struct pic *const)
size_t pic_get_dimension_size (struct pic *const)
int pic_set_mesh_size (struct pic *const p, size_t N)
 Set the mesh size.
int pic_set_dimension_size (struct pic *const p, size_t n)
 Set the dimension.
int pic_set_function_pointer (struct pic *const p, _FUNCTION_PROTOTYPE)
int pic_set_function_solve (struct pic *const p, _SOLVE_PROTOTYPE)
struct picpic_create (size_t n, size_t N, double w, double *const X, _FUNCTION_PROTOTYPE, _SOLVE_PROTOTYPE)
 Function that initializes a struct pic.
void * pic_execute (struct pic *const p, double tol)
 Function that compute the Discrete Fourier Transform.
double ** pic_differential (struct pic *const p, size_t *const m, size_t *const n)
 Return a differential matrix for the current pic struct's values.
double * pic_load_fourier_coef (size_t n, size_t N, FILE *const f)
 Function that load the Fourier coefficients from a given file.
double * pic_loadas_fourier_coef (size_t n, size_t N, char *const name)
 Function that load the Fourier coefficients from a given file by name.
int pic_save_fourier_coef (struct pic *const p, FILE *const f)
 Function that saves the Fourier coefficients in a given file.
int pic_saveas_fourier_coef (struct pic *const p, char *const name)
 Function that saves the Fourier coefficients in a given file by name.
int pic_save_curve (struct pic *const p, FILE *const f)
 Function that saves the values of the solution curve in a given file.
int pic_saveas_curve (struct pic *const p, char *const name)
 Function that saves the values of the solution curve in a given file by name.
int pic_saveas_differential (struct pic *const p, char *const name)
 Function that saves the values of the differential of Newton method in a given file by name.
int pic_save_differential (struct pic *const p, FILE *const f)
 Function that saves the values of the differential of Newton method in a given file.
int pic_saveas_differential_indexs (struct pic *const p, char *const name)
 Function that saves the values of the differential of Newton method in a given file by name from its indexs.
int pic_save_differential_indexs (struct pic *const p, FILE *const f)
 Function that saves the values of the differential of Newton method in a given file from its indexs.
void pic_destroy (struct pic *const p)
 Function that frees the memory space pointed to by the differents pointers of struct pic.

Detailed Description

Header of periodic invariant curve.

Author:
Joan Gimeno
Date:
22/01/2014 (start)
Version:
1.0

Define Documentation

#define PIC_AUTONOMOUS

The dynamic system is autonomous.

#define PIC_NAUTONOMOUS

The dynamic system is not autonomous.


Typedef Documentation

pic

Function Documentation

struct pic * pic_create ( size_t  n,
size_t  N,
double  w,
double *const  X,
_FUNCTION_PROTOTYPE  ,
_SOLVE_PROTOTYPE   
) [read]

Function that initializes a struct pic.

Parameters:
[in]nSpace's dimension of the function $ f \colon \mathbb{R}^n \rightarrow \mathbb{R}^n $
[in]NMesh size of the $ \mathbb{T}^1 $, 2N+1
[in]wReal number densely filling the circumference
[in]XSeed of the newton method. The size has to be n(2N+1)
[in]fFunction pointer
[in]solveFunction pointer for solves a linear system equations
Return values:
NULLIf memory space has not been allocated
pPointer to struct pic
Precondition:
The space's dimension is not zero
Postcondition:
The struct pic has been initialized
Note:
If the seed of newton method is NULL, the default seed will be the vector zero

References pic::autonomous, pic::DF, pic::f, pic::n, pic::N, PIC_NAUTONOMOUS, pic::solve, solve(), SOLVE_WITH_LU, pic::w, pic::x, and pic::X.

+ Here is the call graph for this function:

void pic_destroy ( struct pic *const  p)

Function that frees the memory space pointed to by the differents pointers of struct pic.

Parameters:
[in]pPointer to periodic invariant curve
Postcondition:
The memory space has been freed

References pic::autonomous, pic::DF, pic::n, pic::N, pic::x, and pic::X.

double ** pic_differential ( struct pic *const  p,
size_t *const  m,
size_t *const  n 
)

Return a differential matrix for the current pic struct's values.

Parameters:
[in]pPointer to a pic struct
[out]mNumber of differential matrix's rows
[out]nNumber of differential matrix's columns
Returns:
Pointer to initial position of the matrix differential or NULL if some problem occurred
Precondition:
The pointer to a pic struct is not NULL
Note:
The pointers for rows and columns can be NULL

References pic::autonomous, pic::DF, pic::f, pic::n, pic::N, newton_differential(), pic::w, pic::x, and pic::X.

+ Here is the call graph for this function:

void * pic_execute ( struct pic *const  p,
double  tol 
)

Function that compute the Discrete Fourier Transform.

Parameters:
[in]pPointer to the pic struct
[in]tolTolerance for the result
Returns:
NULL if some problem ocurrer. Otherwise the number of iterations performed until the result (minimum 1)
Note:
The mesh size of pic struct can have been changed. Use
See also:
pic_get_mesh_size
Precondition:
The pointers are not NULL
Postcondition:
The vector p->x has the solution

References _init_pic(), pic::autonomous, pic::DF, pic::f, pic::n, pic::N, newton_execute(), pic_error(), pic_estimate_mesh_size(), pic_set_mesh_size(), pic_x(), pic::solve, pic::w, pic::x, and pic::X.

+ Here is the call graph for this function:

double ** pic_get_DF ( struct pic * const  p)
Parameters:
[in]pPointer to a pic struct
Returns:
The pointer to the differential of the pic struct
Precondition:
The pointer is not NULL

References pic::DF.

size_t pic_get_dimension_size ( struct pic * const  p)
Parameters:
[in]pPointer to a pic struct
Returns:
Space's dimension of the pic struct
Precondition:
The pointer is not NULL

References pic::n.

unsigned int pic_get_max_iterations ( )

Get maximum number of iterations.

Returns:
Maximum iterations that increase the mesh size
size_t pic_get_mesh_size ( struct pic * const  p)
Parameters:
[in]pPointer to a pic struct
Returns:
Mesh size of the pic struct
Precondition:
The pointer is not NULL

References pic::N.

size_t pic_get_n ( struct pic * const  p)
Parameters:
[in]pPointer to a pic struct
Returns:
Space's dimension of the pic struct
Precondition:
The pointer is not NULL

References pic::n.

size_t pic_get_N ( struct pic * const  p)
Parameters:
[in]pPointer to a pic struct
Returns:
The mesh size of the pic struct
Precondition:
The pointer is not NULL

References pic::N.

double pic_get_w ( struct pic * const  p)
Parameters:
[in]pPointer to a pic struct
Returns:
The real number of the pic struct
Precondition:
The pointer is not NULL

References pic::w.

double * pic_get_x ( struct pic * const  p)
Parameters:
[in]pPointer to a pic struct
Returns:
The value table of the curve solution of the pic struct
Precondition:
The pointer is not NULL

References pic::x.

double * pic_get_X ( struct pic * const  p)
Parameters:
[in]pPointer to a pic struct
Returns:
The Fourier's coefficients of the pic struct
Precondition:
The pointer is not NULL

References pic::X.

double * pic_load_fourier_coef ( size_t  n,
size_t  N,
FILE *const  f 
)

Function that load the Fourier coefficients from a given file.

Parameters:
[in]nDimension of each coefficient
[in]NNumber of coefficient
[in]fPointer to a file
Returns:
n*(2N+1)-dimensional vector with the Fourier coefficients saved
Precondition:
The pointer is not NULL
Postcondition:
The user has to free the memory for the pointer returned
Note:
The structure of the vector is a_0, a_1, b_1, ..., a_N, b_N where each element is a n-dimensional vector

References _MAX_LENGTH_STRING_INPUT, and pic::n.

+ Here is the caller graph for this function:

double * pic_loadas_fourier_coef ( size_t  n,
size_t  N,
char *const  name 
)

Function that load the Fourier coefficients from a given file by name.

Parameters:
[in]nDimension of each coefficient
[in]NNumber of coefficient
[in]fPointer to a file
Returns:
n*(2N+1)-dimensional vector with the Fourier coefficients saved
Postcondition:
The user has to free the memory for the pointer returned
Precondition:
The pointer is not NULL
Note:
The structure of the vector is a_0, a_1, b_1, ..., a_N, b_N where each element is a n-dimensional vector

References pic::f, and pic_load_fourier_coef().

+ Here is the call graph for this function:

int pic_save_curve ( struct pic *const  p,
FILE *const  f 
)

Function that saves the values of the solution curve in a given file.

Parameters:
[in]pPointer to struct pic
[in]fOutput file
Return values:
0If some error has occurred in some moment of the process
1Otherwise
Precondition:
The pointers are not NULL
Postcondition:
The file with name has been created or modified with the result

References pic::n, pic::N, and pic::x.

+ Here is the caller graph for this function:

int pic_save_differential ( struct pic *const  p,
FILE *const  f 
)

Function that saves the values of the differential of Newton method in a given file.

Parameters:
[in]pPointer to struct pic
[in]fOutput file
Return values:
0If some error has occurred in some moment of the process
1Otherwise
Precondition:
The pointers are not NULL
Postcondition:
The file with name has been created or modified with the result

References pic::DF, pic::n, pic::N, and save_matrix().

+ Here is the call graph for this function:

int pic_save_differential_indexs ( struct pic *const  p,
FILE *const  f 
)

Function that saves the values of the differential of Newton method in a given file from its indexs.

Parameters:
[in]pPointer to struct pic
[in]fOutput file
Return values:
0If some error has occurred in some moment of the process
1Otherwise
Precondition:
The pointers are not NULL
Postcondition:
The file with name has been created or modified with the result

References pic::DF, pic::n, pic::N, and save_matrix_indexs().

+ Here is the call graph for this function:

int pic_save_fourier_coef ( struct pic *const  p,
FILE *const  f 
)

Function that saves the Fourier coefficients in a given file.

Parameters:
[in]pPointer to struct pic
[in]fOutput file
Return values:
0If some error has occurred in some moment of the process
1Otherwise
Precondition:
The pointers are not NULL
Postcondition:
The file has been created or modified with the result

References pic::n, pic::N, and pic::X.

+ Here is the caller graph for this function:

int pic_saveas_curve ( struct pic *const  p,
char *const  name 
)

Function that saves the values of the solution curve in a given file by name.

Parameters:
[in]pPointer to struct pic
[in]nameName of the output file
Return values:
0If some error has occurred in some moment of the process
1Otherwise
Precondition:
The struct pointer is not NULL
Postcondition:
The file with name has been created or modified with the result

References pic::f, and pic_save_curve().

+ Here is the call graph for this function:

int pic_saveas_differential ( struct pic *const  p,
char *const  name 
)

Function that saves the values of the differential of Newton method in a given file by name.

Parameters:
[in]pPointer to struct pic
[in]nameName of the output file
Return values:
0If some error has occurred in some moment of the process
1Otherwise
Precondition:
The struct pointer is not NULL
Postcondition:
The file with name has been created or modified with the result

References pic::DF, pic::n, pic::N, and saveas_matrix().

+ Here is the call graph for this function:

int pic_saveas_differential_indexs ( struct pic *const  p,
char *const  name 
)

Function that saves the values of the differential of Newton method in a given file by name from its indexs.

Parameters:
[in]pPointer to struct pic
[in]nameName of the output file
Return values:
0If some error has occurred in some moment of the process
1Otherwise
Precondition:
The struct pointer is not NULL
Postcondition:
The file with name has been created or modified with the result

References pic::DF, pic::n, pic::N, and saveas_matrix_indexs().

+ Here is the call graph for this function:

int pic_saveas_fourier_coef ( struct pic *const  p,
char *const  name 
)

Function that saves the Fourier coefficients in a given file by name.

Parameters:
[in]pPointer to struct pic
[in]fOutput file
Return values:
0If some error has occurred in some moment of the process
1Otherwise
Precondition:
The pointers are not NULL
Postcondition:
The file has been created or modified with the result

References pic::f, and pic_save_fourier_coef().

+ Here is the call graph for this function:

int pic_set_dimension_size ( struct pic *const  p,
size_t  n 
)

Set the dimension.

Parameters:
[in]pPointer to a pic struct
[in]NNew dimension
Returns:
0 if some error occurred or the old dimension
Precondition:
The new mesh size is not 0 and the pointer is not NULL
Postcondition:
The pointer memory has been reallocated with the new dimension

References _pic_realloc(), pic::autonomous, pic::n, and pic::N.

+ Here is the call graph for this function:

int pic_set_function_pointer ( struct pic *const  p,
_FUNCTION_PROTOTYPE   
)
Parameters:
[in]pPointer to a pic struct
[in]fPointer to a function pointer
Return values:
0if some argument is NULL
1Otherwise
int pic_set_function_solve ( struct pic *const  p,
_SOLVE_PROTOTYPE   
)
Parameters:
[in]pPointer to a pic struct
[in]fPointer to a function pointer
Return values:
0if some argument is NULL
1Otherwise

References pic::solve, and solve().

+ Here is the call graph for this function:

unsigned int pic_set_max_iterations ( unsigned int  max_iter)

Set maximum number of iterations.

Parameters:
[in]max_iterNew value
Returns:
The old maximum iterations that increase the mesh size
int pic_set_mesh_size ( struct pic *const  p,
size_t  N 
)

Set the mesh size.

Parameters:
[in]pPointer to a pic struct
[in]NNew mesh size
Returns:
0 if some error occurred or the old mesh size
Precondition:
The new mesh size is not 0 and the pointer is not NULL
Postcondition:
The pointer memory has been reallocated with the new mesh size

References _pic_realloc(), pic::autonomous, pic::n, and pic::N.

+ Here is the call graph for this function:

+ Here is the caller graph for this function: