PPL Logo

libs/ck-libs/metis/GKlib/util.c File Reference

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)


Function Documentation

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

Definition at line 20 of file util.c.

References gk_idx_t, and PUP::u.

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

int gk_log2 ( int  a  ) 

Definition at line 83 of file util.c.

References gk_idx_t.

Referenced by gk_ispow2(), and METIS_PartGraphKway().

Here is the caller graph for this function:

int gk_ispow2 ( int  a  ) 

Definition at line 95 of file util.c.

References gk_log2().

Here is the call graph for this function:

float gk_flog2 ( float  a  ) 

Definition at line 104 of file util.c.


Generated on Mon Sep 21 08:09:12 2020 for Charm++ by  doxygen 1.5.5