Functions
GKlib/util.c File Reference
#include <GKlib.h>
Include dependency graph for GKlib/util.c:

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)
 

Function Documentation

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.

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.

Parameters
nthe number of elements in the array (e.g., # of vertices)
rangethe cardinality of the set (e.g., # of partitions)
arraythe array that stores the per-element set membership
ptrthe 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.
indthe 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.

int gk_ispow2 ( int  a)

Definition at line 95 of file GKlib/util.c.

int gk_log2 ( int  a)

Definition at line 83 of file GKlib/util.c.

void gk_RandomPermute ( size_t  n,
int p,
int  flag 
)

Definition at line 20 of file GKlib/util.c.



gtsam
Author(s):
autogenerated on Sat May 8 2021 02:51:43