YAC 3.18.0
Yet Another Coupler
Loading...
Searching...
No Matches
utils_common.h File Reference
#include "yac_config.h"
#include <stdlib.h>
#include "ppm/ppm_xfuncs.h"
#include "ppm/core.h"
#include "yac_types.h"
#include "yac_assert.h"
Include dependency graph for utils_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  yac_name_type_pair
 

Macros

#define MAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define YAC_OMP_PARALLEL
 
#define YAC_OMP_FOR
 
Macros
#define DEF_NAME_TYPE_PAIR(NAME, TYPE)   {.name = #NAME, .type = (int)(TYPE)}
 
#define DEF_NAME_TYPE_PAIRS(NAME, ...)
 

Functions

static void yac_remove_duplicates_int (int *array, size_t *n)
 
void yac_qsort_index (void *a, size_t count, size_t size, int(*compare)(void const *, void const *), size_t *idx)
 
Functions
char const * yac_name_type_pair_get_name (struct yac_name_type_pair const *pairs, size_t count, int type)
 
int yac_name_type_pair_get_type (struct yac_name_type_pair const *pairs, size_t count, char const *name)
 

Macro Definition Documentation

◆ MAX

#define MAX ( a,
b )   ((a) > (b) ? (a) : (b))

Definition at line 136 of file utils_common.h.

◆ MIN

#define MIN ( a,
b )   ((a) < (b) ? (a) : (b))

Definition at line 140 of file utils_common.h.

◆ YAC_OMP_FOR

#define YAC_OMP_FOR

Definition at line 148 of file utils_common.h.

◆ YAC_OMP_PARALLEL

#define YAC_OMP_PARALLEL

Definition at line 147 of file utils_common.h.

Function Documentation

◆ yac_qsort_index()

void yac_qsort_index ( void * a_,
size_t count,
size_t size,
int(* compare )(void const *, void const *),
size_t * idx )

Non-recursive stack version of Quicksort

... from N. Wirth's Pascal Book, 'Algorithms + Data Structures = Programms'. by Alan Miller ( 19 Jul 1995 )

taken from:

Parameters
[in,out]a_data to be sorted
[in]countlength of data
[in]sizesize of single data element
[in]comparecompare routine for data elements
[out]idxold index of sorted returned a

Definition at line 185 of file quicksort.c.

Here is the caller graph for this function:

◆ yac_remove_duplicates_int()

static void yac_remove_duplicates_int ( int * array,
size_t * n )
inlinestatic

remove duplicated entries from a list of integers

Parameters
[in,out]arrayarray containing a sorted (ascending) list of integers
[in,out]nnumber of entries in array

Definition at line 25 of file utils_common.h.

Here is the caller graph for this function: