#include <GKlib.h>
Go to the source code of this file.
Functions | |
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. More... | |
float | gk_flog2 (float a) |
int | gk_ispow2 (int a) |
int | gk_log2 (int a) |
void | gk_RandomPermute (size_t n, int *p, int flag) |
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 GKlib/util.c.
float gk_flog2 | ( | float | a | ) |
Definition at line 104 of file GKlib/util.c.
Definition at line 95 of file GKlib/util.c.
Definition at line 83 of file GKlib/util.c.
Definition at line 20 of file GKlib/util.c.