Defines | |
| #define | GNN_MIN(x, y) ( ((x) < (y))? (x) : (y) ) |
| gets the minimum of two values. | |
| #define | GNN_MAX(x, y) ( ((x) > (y))? (x) : (y) ) |
| gets the maximum of two values. | |
| #define | GNN_SIGN(x) ( ((x) > 0)? 1 : -1 ) |
| gets the sign of a value. | |
| #define | GNN_SHIFT2(a, b, c) (a)=(b);(b)=(c); |
| shifts two to the left. | |
| #define | GNN_SHIFT3(a, b, c, d) (a)=(b);(b)=(c);(c)=(d); |
| shifts three to the left. | |
| #define | GNN_USE_SIGN(a, b) ( (b) >= 0.0 ? fabs(a) : -fabs(a) ) |
use b's sign for a. | |
Functions | |
| gsl_rng * | gnn_get_rng () |
| Get the global random number generator. | |
| int | gnn_vector_resize (gsl_vector **vector, int new_size) |
| Resize a vector. | |
| int | gnn_vector_sum_elements (gsl_vector *v) |
| Compute the sum of the vector's elements. | |
| double | gnn_vector_euclidian_dist (const gsl_vector *v, const gsl_vector *u) |
| Compute the euclidian distance between to vectors. | |
| int | gnn_matrix_check_sizes_from_stream (FILE *stream, size_t *m, size_t *n) |
| Compute matrix size from a stream. | |
| gsl_vector * | gnn_vector_load (const char *filename) |
| Load a vector from a file. | |
| int | gnn_vector_save (const char *filename, gsl_vector *v) |
| Saves a vector to a file. | |
| gsl_matrix * | gnn_matrix_load (const char *filename) |
| Load a matrix from a file. | |
| int | gnn_matrix_save (const char *filename, gsl_matrix *A) |
| Saves a matrix to a file. | |
|
|
Definition at line 50 of file gnn_utilities.h. |
|
|
Definition at line 44 of file gnn_utilities.h. |
|
|
Definition at line 62 of file gnn_utilities.h. |
|
|
Definition at line 68 of file gnn_utilities.h. |
|
|
Definition at line 56 of file gnn_utilities.h. |
|
|
Definition at line 74 of file gnn_utilities.h. |
|
|
This function returns a pointer to an application-wide GSL random number generator. It allocates a new one if not defined yet. The type of the random number generator is given by the constant libgnn Global Definitions.. Note: This function is not thread safe.
Definition at line 69 of file gnn_utilities.c. |
|
||||||||||||||||
|
This function reads a stream until it reaches EOF, and makes an estimation of the contained matrix size.
Definition at line 201 of file gnn_utilities.c. |
|
|
This function loads a matrix from a file. It creates a gsl_matrix of the correct size.
Definition at line 321 of file gnn_utilities.c. |
|
||||||||||||
|
This function saves a matrix to a file.
Definition at line 369 of file gnn_utilities.c. |
|
||||||||||||
|
This function computes the euclidian distance between to vectors, given by:
Definition at line 172 of file gnn_utilities.c. |
|
|
This function loads a vector from a file. It creates a gsl_vector of the correct size.
Definition at line 248 of file gnn_utilities.c. |
|
||||||||||||
|
This function resizes a vector and tries to preserve all posible values, i.e.
where
Definition at line 98 of file gnn_utilities.c. |
|
||||||||||||
|
This function saves a vector to a file.
Definition at line 296 of file gnn_utilities.c. |
|
|
This function computes the sum of the vector's elements, that is:
Definition at line 150 of file gnn_utilities.c. |
1.2.18