Functions
GKlib/util.c File Reference

Various utility routines. More...

#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)
 

Detailed Description

Various utility routines.

Date
Started 4/12/2007
Author
George
Version
$Id: util.c 10711 2011-08-31 22:23:04Z karypis $ 

Definition in file GKlib/util.c.

Function Documentation

◆ gk_array2csr()

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
n
the number of elements in the array (e.g., # of vertices)
range
the 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.

◆ gk_flog2()

float gk_flog2 ( float  a)

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

◆ gk_ispow2()

int gk_ispow2 ( int  a)

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

◆ gk_log2()

int gk_log2 ( int  a)

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

◆ gk_RandomPermute()

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

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



gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:43:27