Files | |
| file | eg_numutil.c |
| file | eg_numutil.h |
This file provide the user interface and function definitions for general number utilities. | |
Defines | |
| #define | EGlpNumInnProd(__rop, __arr1, __arr2, __length) __EGlpNumInnProd((&(__rop)),__arr1,__arr2,__length) |
| compute the inner product of two arrays. | |
Functions | |
| void | __EGlpNumInnProd (EGlpNum_t *rop, EGlpNum_t *const arr1, EGlpNum_t *const arr2, const size_t length) |
| internal version, this is done to avoid using stdc99 and rely on more basic stdc89 | |
| void | EGutilPermSort (const size_t sz, int *const perm, const EGlpNum_t *const elem) |
| Sort (in increasing order) a sub-set of entries in an array using quicksort, by permutating the order of the elements in the subset rather than in the whole original array. | |
| void | EGutilPermSort2 (const size_t sz, int *const perm, const EGlpNum_t *const elem) |
| Sort (in decreasing order) a sub-set of entries in an array using quicksort, by permutating the order of the elements in the subset rather than in the whole original array. | |
Here we put some utilities common for different number types but thaat we want to implement as templates, like permutation sorting, inner product of vectors, and so-on..
| #define EGlpNumInnProd | ( | __rop, | ||
| __arr1, | ||||
| __arr2, | ||||
| __length | ||||
| ) | __EGlpNumInnProd((&(__rop)),__arr1,__arr2,__length) |
compute the inner product of two arrays.
| arr1 | first array. | |
| arr2 | second array. | |
| length | number of entries to consider in both arrays, from zero to length - 1. | |
| rop | where to store the result. |
Definition at line 54 of file eg_numutil.h.
Referenced by EGdBsRedBuildGM().
| void __EGlpNumInnProd | ( | EGlpNum_t * | rop, | |
| EGlpNum_t *const | __EGa1, | |||
| EGlpNum_t *const | __EGa2, | |||
| const size_t | length | |||
| ) |
internal version, this is done to avoid using stdc99 and rely on more basic stdc89
| void EGutilPermSort | ( | const size_t | sz, | |
| int *const | perm, | |||
| const EGlpNum_t *const | elem | |||
| ) |
Sort (in increasing order) a sub-set of entries in an array using quicksort, by permutating the order of the elements in the subset rather than in the whole original array.
| sz | length of the permutation array. | |
| perm | array of indices of elements that we want to sort. | |
| elem | array (of length at least max(perm[k]:k=0,...,sz-1)) containing the elements to be sorted. |
Referenced by EGdBsRedBuildGM().
| void EGutilPermSort2 | ( | const size_t | sz, | |
| int *const | perm, | |||
| const EGlpNum_t *const | elem | |||
| ) |
Sort (in decreasing order) a sub-set of entries in an array using quicksort, by permutating the order of the elements in the subset rather than in the whole original array.
| sz | length of the permutation array. | |
| perm | array of indices of elements that we want to sort. | |
| elem | array (of length at least max(perm[k]:k=0,...,sz-1)) containing the elements to be sorted. |
1.7.1