ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
util.c File Reference
#include "metis.h"
Include dependency graph for util.c:

Go to the source code of this file.

Functions

void print_help (char *program_name)
 
void clusterSize (GraphType *graph, int *clustersize)
 
void sparse2dense (GraphType *graph, double *dense, float *m_adjwgt)
 
void extractfilename (char *path, char *name)
 
void graclus_errexit (char *f_str,...)
 
Chainschainmalloc (int n, char *msg)
 
float ** f2malloc (int n, int m, char *msg)
 
int ** i2malloc (int n, int m, char *msg)
 
int * imalloc (int n, char *msg)
 
idxtypeidxmalloc (int n, char *msg)
 
float * fmalloc (int n, char *msg)
 
int * ismalloc (int n, int ival, char *msg)
 
idxtypeidxsmalloc (int n, idxtype ival, char *msg)
 
void * GKmalloc (int nbytes, char *msg)
 
void GKfree (void **ptr1,...)
 
int * iset (int n, int val, int *x)
 
idxtypeidxset (int n, idxtype val, idxtype *x)
 
float * sset (int n, float val, float *x)
 
int iamax (int n, int *x)
 
int idxamax (int n, idxtype *x)
 
int idxamax_strd (int n, idxtype *x, int incx)
 
int samax (int n, float *x)
 
int samax2 (int n, float *x)
 
int idxamin (int n, idxtype *x)
 
int samin (int n, float *x)
 
int idxsum (int n, idxtype *x)
 
int idxsum_strd (int n, idxtype *x, int incx)
 
void idxadd (int n, idxtype *x, idxtype *y)
 
int charsum (int n, char *x)
 
int isum (int n, int *x)
 
float ssum (int n, float *x)
 
float ssum_strd (int n, float *x, int incx)
 
void sscale (int n, float alpha, float *x)
 
float snorm2 (int n, float *v)
 
float sdot (int n, float *x, float *y)
 
void saxpy (int n, float alpha, float *x, int incx, float *y, int incy)
 
void RandomPermute (int n, idxtype *p, int flag)
 
void RandomInit (int n, int k, idxtype *label)
 
int ispow2 (int a)
 
void InitRandom (int seed)
 
int log2_metis (int a)
 

Function Documentation

◆ chainmalloc()

Chains* chainmalloc ( int  n,
char *  msg 
)

Definition at line 121 of file util.c.

References GKmalloc(), and NULL.

◆ charsum()

int charsum ( int  n,
char *  x 
)

Definition at line 463 of file util.c.

◆ clusterSize()

void clusterSize ( GraphType graph,
int *  clustersize 
)

Definition at line 33 of file util.c.

References graphdef::nvtxs, and graphdef::where.

Referenced by ComputeRAsso(), remove_empty_clusters_l1(), and remove_empty_clusters_l2().

◆ extractfilename()

void extractfilename ( char *  path,
char *  name 
)

Definition at line 73 of file util.c.

References length(), name, and cloudViewer::t::geometry::path.

◆ f2malloc()

float** f2malloc ( int  n,
int  m,
char *  msg 
)

Definition at line 132 of file util.c.

References GKmalloc(), and NULL.

◆ fmalloc()

float* fmalloc ( int  n,
char *  msg 
)

Definition at line 188 of file util.c.

References GKmalloc(), and NULL.

◆ GKfree()

void GKfree ( void **  ptr1,
  ... 
)

Definition at line 243 of file util.c.

References LTERM, and NULL.

◆ GKmalloc()

void* GKmalloc ( int  nbytes,
char *  msg 
)

Definition at line 225 of file util.c.

References graclus_errexit(), and NULL.

Referenced by chainmalloc(), f2malloc(), fmalloc(), i2malloc(), idxmalloc(), idxsmalloc(), imalloc(), and ismalloc().

◆ graclus_errexit()

void graclus_errexit ( char *  f_str,
  ... 
)

◆ i2malloc()

int** i2malloc ( int  n,
int  m,
char *  msg 
)

Definition at line 148 of file util.c.

References GKmalloc(), and NULL.

◆ iamax()

int iamax ( int  n,
int *  x 
)

Definition at line 311 of file util.c.

References max().

◆ idxadd()

void idxadd ( int  n,
idxtype x,
idxtype y 
)

Definition at line 453 of file util.c.

◆ idxamax()

int idxamax ( int  n,
idxtype x 
)

Definition at line 325 of file util.c.

References max().

◆ idxamax_strd()

int idxamax_strd ( int  n,
idxtype x,
int  incx 
)

Definition at line 338 of file util.c.

References max().

◆ idxamin()

int idxamin ( int  n,
idxtype x 
)

Definition at line 396 of file util.c.

References min().

◆ idxmalloc()

idxtype* idxmalloc ( int  n,
char *  msg 
)

Definition at line 176 of file util.c.

References GKmalloc(), and NULL.

Referenced by RandomInit().

◆ idxset()

idxtype* idxset ( int  n,
idxtype  val,
idxtype x 
)

Definition at line 282 of file util.c.

Referenced by idxsmalloc().

◆ idxsmalloc()

idxtype* idxsmalloc ( int  n,
idxtype  ival,
char *  msg 
)

Definition at line 213 of file util.c.

References GKmalloc(), idxset(), and NULL.

◆ idxsum()

int idxsum ( int  n,
idxtype x 
)

Definition at line 424 of file util.c.

◆ idxsum_strd()

int idxsum_strd ( int  n,
idxtype x,
int  incx 
)

Definition at line 438 of file util.c.

◆ imalloc()

int* imalloc ( int  n,
char *  msg 
)

Definition at line 164 of file util.c.

References GKmalloc(), and NULL.

◆ InitRandom()

void InitRandom ( int  seed)

Definition at line 650 of file util.c.

◆ iset()

int* iset ( int  n,
int  val,
int *  x 
)

Definition at line 268 of file util.c.

Referenced by ismalloc().

◆ ismalloc()

int* ismalloc ( int  n,
int  ival,
char *  msg 
)

Definition at line 200 of file util.c.

References GKmalloc(), iset(), and NULL.

◆ ispow2()

int ispow2 ( int  a)

Definition at line 640 of file util.c.

◆ isum()

int isum ( int  n,
int *  x 
)

Definition at line 476 of file util.c.

◆ log2_metis()

int log2_metis ( int  a)

Definition at line 663 of file util.c.

◆ print_help()

void print_help ( char *  program_name)

Definition at line 19 of file util.c.

◆ RandomInit()

void RandomInit ( int  n,
int  k,
idxtype label 
)

Definition at line 618 of file util.c.

References idxmalloc(), and RandomPermute().

◆ RandomPermute()

void RandomPermute ( int  n,
idxtype p,
int  flag 
)

Definition at line 576 of file util.c.

Referenced by RandomInit().

◆ samax()

int samax ( int  n,
float *  x 
)

Definition at line 354 of file util.c.

References max().

◆ samax2()

int samax2 ( int  n,
float *  x 
)

Definition at line 367 of file util.c.

◆ samin()

int samin ( int  n,
float *  x 
)

Definition at line 410 of file util.c.

References min().

◆ saxpy()

void saxpy ( int  n,
float  alpha,
float *  x,
int  incx,
float *  y,
int  incy 
)

Definition at line 560 of file util.c.

◆ sdot()

float sdot ( int  n,
float *  x,
float *  y 
)

Definition at line 545 of file util.c.

References partial.

◆ snorm2()

float snorm2 ( int  n,
float *  v 
)

Definition at line 529 of file util.c.

References partial.

◆ sparse2dense()

void sparse2dense ( GraphType graph,
double *  dense,
float *  m_adjwgt 
)

Definition at line 46 of file util.c.

References graphdef::adjncy, graphdef::adjwgt, NULL, graphdef::nvtxs, and graphdef::xadj.

◆ sscale()

void sscale ( int  n,
float  alpha,
float *  x 
)

Definition at line 517 of file util.c.

◆ sset()

float* sset ( int  n,
float  val,
float *  x 
)

Definition at line 296 of file util.c.

◆ ssum()

float ssum ( int  n,
float *  x 
)

Definition at line 489 of file util.c.

◆ ssum_strd()

float ssum_strd ( int  n,
float *  x,
int  incx 
)

Definition at line 503 of file util.c.