Go to the source code of this file.
Functions | |
void | gk_RandomPermute (size_t n, int *p, int flag) |
void | gk_array2csr (size_t n, size_t range, int *array, int *ptr, int *ind) |
Converts an element-based set membership into a CSR-format set-based membership. | |
int | gk_log2 (int a) |
int | gk_ispow2 (int a) |
float | gk_flog2 (float a) |
Converts an element-based set membership into a CSR-format set-based membership.
For example, it takes an array such as part[] that stores where each element belongs to and returns a pair of arrays (pptr[], pind[]) that store in CSF format the list of elements belonging in each partition.
n | the number of elements in the array (e.g., # of vertices) | |
range | the cardinality of the set (e.g., # of partitions) | |
array | the array that stores the per-element set membership | |
ptr | the array that will store the starting indices in ind for the elements of each set. This is filled by the routine and its size should be at least range+1. | |
ind | the array that stores consecutively which elements belong to each set. The size of this array should be n. |
Definition at line 62 of file util.c.
References gk_idx_t.
Definition at line 83 of file util.c.
References gk_idx_t.
Referenced by gk_ispow2(), and METIS_PartGraphKway().