![]() |
Bachelor's degree final project
v1.0
Faculty of Mathematics, University of Barcelona
|
Utilities. More...
Include dependency graph for utils.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Defines | |
| #define | inline static |
| #define | SWAP(a, b) typeof(a) _SWAPPING_VAR; _SWAPPING_VAR = a; a = b; b = _SWAPPING_VAR |
| A macro that swaps two generic values. | |
| #define | free_mem(a) |
| Used to help ensure everything malloc'ed gets freed. | |
Functions | |
| double | euclidian_norm (size_t n, double *const x) |
Derive the euclidian norm of a vector, that is, . | |
| double | inner_product (size_t n, double *const x) |
Derive the ordinary inner product of a vector, that is, . | |
| void | copy_vector (size_t n, double *const x, double *const y) |
| Copy the vector x in y. | |
| void | copy_matrix (size_t m, size_t n, double **const A, double **const B) |
| Copy the matrix A in B. | |
| void | print_matrix (size_t m, size_t n, double **const A, char *const name) |
| Display in stdout a matrix m-by-n. | |
| void | print_vector (size_t idx, size_t n, double *const v, char *const name) |
| Display in stdout a n-dimensional vector starting by an index. | |
| double * | malloc_vector (size_t n) |
| Malloc a n-dimensional vector. | |
| void | free_vector (double *p) |
| Free a vector. | |
| double ** | malloc_matrix (size_t m, size_t n) |
| Malloc a m-by-n matrix. | |
| void | free_matrix (size_t m, double **p) |
| Free a matrix with m rows. | |
| int | qrsis (int n, int m, double **a, double *b, double tol) |
Utilities.
| #define free_mem | ( | a | ) |
Used to help ensure everything malloc'ed gets freed.
| #define inline static |
| #define SWAP | ( | a, | |
| b | |||
| ) | typeof(a) _SWAPPING_VAR; _SWAPPING_VAR = a; a = b; b = _SWAPPING_VAR |
A macro that swaps two generic values.
| void copy_matrix | ( | size_t | m, |
| size_t | n, | ||
| double **const | A, | ||
| double **const | B | ||
| ) |
Copy the matrix A in B.
| [in] | m | Rows |
| [in] | m | Columns |
| [in] | A | Source matrix |
| [out] | B | Destination matrix |
References pic::n.
Here is the caller graph for this function:| void copy_vector | ( | size_t | n, |
| double *const | x, | ||
| double *const | y | ||
| ) |
Copy the vector x in y.
| [in] | n | Dimension |
| [in] | x | Source vector |
| [out] | y | Destination vector |
References pic::n.
| double euclidian_norm | ( | size_t | n, |
| double *const | x | ||
| ) |
Derive the euclidian norm of a vector, that is,
.
| [in] | n | Dimension of vector |
| [in] | x | Input vector |
References pic::n.
Here is the caller graph for this function:| void free_matrix | ( | size_t | m, |
| double ** | p | ||
| ) |
Free a matrix with m rows.
| [in] | m | Rows |
Here is the caller graph for this function:| void free_vector | ( | double * | p | ) |
Free a vector.
| [in] | p | Pointer |
Here is the caller graph for this function:| double inner_product | ( | size_t | n, |
| double *const | x | ||
| ) |
Derive the ordinary inner product of a vector, that is,
.
| [in] | n | Dimension of vector |
| [in] | x | Input vector |
References pic::n.
Here is the caller graph for this function:| double ** malloc_matrix | ( | size_t | m, |
| size_t | n | ||
| ) |
Malloc a m-by-n matrix.
| [in] | m | Rows |
| [in] | n | Columns |
Here is the caller graph for this function:| double * malloc_vector | ( | size_t | n | ) |
Malloc a n-dimensional vector.
| [in] | n | End index |
Here is the caller graph for this function:| void print_matrix | ( | size_t | m, |
| size_t | n, | ||
| double **const | A, | ||
| char *const | name | ||
| ) |
Display in stdout a matrix m-by-n.
| [in] | m | Rows |
| [in] | n | Columns |
| [in] | A | Matrix m-by-n |
| [in] | name | Name of the matrix in stdout |
References pic::n.
| void print_vector | ( | size_t | idx, |
| size_t | n, | ||
| double *const | v, | ||
| char *const | name | ||
| ) |
Display in stdout a n-dimensional vector starting by an index.
| [in] | idx | Start index |
| [in] | n | End index |
| [in] | v | Vector |
| [in] | name | Name of the vector in stdout |
References pic::n.
Here is the caller graph for this function:
1.7.6.1