Macros | Functions
sort.c File Reference

This file contains GKlib's various sorting routines. More...

#include <GKlib.h>
Include dependency graph for sort.c:

Go to the source code of this file.

Macros

#define char_gt(a, b)   ((*a) > (*b))
 
#define char_lt(a, b)   ((*a) < (*b))
 
#define ckey_gt(a, b)   ((a)->key > (b)->key)
 
#define ckey_lt(a, b)   ((a)->key < (b)->key)
 
#define dkey_gt(a, b)   ((a)->key > (b)->key)
 
#define dkey_lt(a, b)   ((a)->key < (b)->key)
 
#define double_gt(a, b)   ((*a) > (*b))
 
#define double_lt(a, b)   ((*a) < (*b))
 
#define fkey_gt(a, b)   ((a)->key > (b)->key)
 
#define fkey_lt(a, b)   ((a)->key < (b)->key)
 
#define float_gt(a, b)   ((*a) > (*b))
 
#define float_lt(a, b)   ((*a) < (*b))
 
#define idx_gt(a, b)   ((*a) > (*b))
 
#define idx_lt(a, b)   ((*a) < (*b))
 
#define idxkey_gt(a, b)   ((a)->key > (b)->key)
 
#define idxkey_lt(a, b)   ((a)->key < (b)->key)
 
#define ikey_gt(a, b)   ((a)->key > (b)->key)
 
#define ikey_gt(a, b)   ((a)->key > (b)->key)
 
#define ikey_gt(a, b)   ((a)->key > (b)->key)
 
#define ikey_lt(a, b)   ((a)->key < (b)->key)
 
#define ikey_lt(a, b)   ((a)->key < (b)->key)
 
#define ikey_lt(a, b)   ((a)->key < (b)->key)
 
#define int_gt(a, b)   ((*a) > (*b))
 
#define int_lt(a, b)   ((*a) < (*b))
 
#define skey_gt(a, b)   (strcmp((a)->key, (b)->key) > 0)
 
#define skey_lt(a, b)   (strcmp((a)->key, (b)->key) < 0)
 
#define zkey_gt(a, b)   ((a)->key > (b)->key)
 
#define zkey_lt(a, b)   ((a)->key < (b)->key)
 

Functions

void gk_ckvsortd (size_t n, gk_ckv_t *base)
 
void gk_ckvsorti (size_t n, gk_ckv_t *base)
 
void gk_csortd (size_t n, char *base)
 
void gk_csorti (size_t n, char *base)
 
void gk_dkvsortd (size_t n, gk_dkv_t *base)
 
void gk_dkvsorti (size_t n, gk_dkv_t *base)
 
void gk_dsortd (size_t n, double *base)
 
void gk_dsorti (size_t n, double *base)
 
void gk_fkvsortd (size_t n, gk_fkv_t *base)
 
void gk_fkvsorti (size_t n, gk_fkv_t *base)
 
void gk_fsortd (size_t n, float *base)
 
void gk_fsorti (size_t n, float *base)
 
void gk_i32kvsortd (size_t n, gk_i32kv_t *base)
 
void gk_i32kvsorti (size_t n, gk_i32kv_t *base)
 
void gk_i64kvsortd (size_t n, gk_i64kv_t *base)
 
void gk_i64kvsorti (size_t n, gk_i64kv_t *base)
 
void gk_idxkvsortd (size_t n, gk_idxkv_t *base)
 
void gk_idxkvsorti (size_t n, gk_idxkv_t *base)
 
void gk_idxsortd (size_t n, gk_idx_t *base)
 
void gk_idxsorti (size_t n, gk_idx_t *base)
 
void gk_ikvsortd (size_t n, gk_ikv_t *base)
 
void gk_ikvsorti (size_t n, gk_ikv_t *base)
 
void gk_isortd (size_t n, int *base)
 
void gk_isorti (size_t n, int *base)
 
void gk_skvsortd (size_t n, gk_skv_t *base)
 
void gk_skvsorti (size_t n, gk_skv_t *base)
 
void gk_zkvsortd (size_t n, gk_zkv_t *base)
 
void gk_zkvsorti (size_t n, gk_zkv_t *base)
 

Detailed Description

This file contains GKlib's various sorting routines.

These routines are implemented using the GKSORT macro that is defined in gk_qsort.h and is based on GNU's GLIBC qsort() implementation.

Additional sorting routines can be created using the same way that these routines where defined.

Date
Started 4/4/07
Author
George
Version
$Id: sort.c 10796 2011-09-23 21:33:09Z karypis $ 

Definition in file sort.c.

Macro Definition Documentation

◆ char_gt

#define char_gt (   a,
  b 
)    ((*a) > (*b))

◆ char_lt

#define char_lt (   a,
  b 
)    ((*a) < (*b))

◆ ckey_gt

#define ckey_gt (   a,
  b 
)    ((a)->key > (b)->key)

◆ ckey_lt

#define ckey_lt (   a,
  b 
)    ((a)->key < (b)->key)

◆ dkey_gt

#define dkey_gt (   a,
  b 
)    ((a)->key > (b)->key)

◆ dkey_lt

#define dkey_lt (   a,
  b 
)    ((a)->key < (b)->key)

◆ double_gt

#define double_gt (   a,
  b 
)    ((*a) > (*b))

◆ double_lt

#define double_lt (   a,
  b 
)    ((*a) < (*b))

◆ fkey_gt

#define fkey_gt (   a,
  b 
)    ((a)->key > (b)->key)

◆ fkey_lt

#define fkey_lt (   a,
  b 
)    ((a)->key < (b)->key)

◆ float_gt

#define float_gt (   a,
  b 
)    ((*a) > (*b))

◆ float_lt

#define float_lt (   a,
  b 
)    ((*a) < (*b))

◆ idx_gt

#define idx_gt (   a,
  b 
)    ((*a) > (*b))

◆ idx_lt

#define idx_lt (   a,
  b 
)    ((*a) < (*b))

◆ idxkey_gt

#define idxkey_gt (   a,
  b 
)    ((a)->key > (b)->key)

◆ idxkey_lt

#define idxkey_lt (   a,
  b 
)    ((a)->key < (b)->key)

◆ ikey_gt [1/3]

#define ikey_gt (   a,
  b 
)    ((a)->key > (b)->key)

◆ ikey_gt [2/3]

#define ikey_gt (   a,
  b 
)    ((a)->key > (b)->key)

◆ ikey_gt [3/3]

#define ikey_gt (   a,
  b 
)    ((a)->key > (b)->key)

◆ ikey_lt [1/3]

#define ikey_lt (   a,
  b 
)    ((a)->key < (b)->key)

◆ ikey_lt [2/3]

#define ikey_lt (   a,
  b 
)    ((a)->key < (b)->key)

◆ ikey_lt [3/3]

#define ikey_lt (   a,
  b 
)    ((a)->key < (b)->key)

◆ int_gt

#define int_gt (   a,
  b 
)    ((*a) > (*b))

◆ int_lt

#define int_lt (   a,
  b 
)    ((*a) < (*b))

◆ skey_gt

#define skey_gt (   a,
  b 
)    (strcmp((a)->key, (b)->key) > 0)

◆ skey_lt

#define skey_lt (   a,
  b 
)    (strcmp((a)->key, (b)->key) < 0)

◆ zkey_gt

#define zkey_gt (   a,
  b 
)    ((a)->key > (b)->key)

◆ zkey_lt

#define zkey_lt (   a,
  b 
)    ((a)->key < (b)->key)

Function Documentation

◆ gk_ckvsortd()

void gk_ckvsortd ( size_t  n,
gk_ckv_t *  base 
)

Sorts an array of gk_ckv_t in decreasing order

Definition at line 146 of file sort.c.

◆ gk_ckvsorti()

void gk_ckvsorti ( size_t  n,
gk_ckv_t *  base 
)

Sorts an array of gk_ckv_t in increasing order

Definition at line 135 of file sort.c.

◆ gk_csortd()

void gk_csortd ( size_t  n,
char *  base 
)

Sorts an array of chars in decreasing order

Definition at line 34 of file sort.c.

◆ gk_csorti()

void gk_csorti ( size_t  n,
char *  base 
)

Sorts an array of chars in increasing order

Definition at line 23 of file sort.c.

◆ gk_dkvsortd()

void gk_dkvsortd ( size_t  n,
gk_dkv_t *  base 
)

Sorts an array of gk_fkv_t in decreasing order

Definition at line 278 of file sort.c.

◆ gk_dkvsorti()

void gk_dkvsorti ( size_t  n,
gk_dkv_t *  base 
)

Sorts an array of gk_dkv_t in increasing order

Definition at line 267 of file sort.c.

◆ gk_dsortd()

void gk_dsortd ( size_t  n,
double *  base 
)

Sorts an array of doubles in decreasing order

Definition at line 100 of file sort.c.

◆ gk_dsorti()

void gk_dsorti ( size_t  n,
double *  base 
)

Sorts an array of doubles in increasing order

Definition at line 89 of file sort.c.

◆ gk_fkvsortd()

void gk_fkvsortd ( size_t  n,
gk_fkv_t *  base 
)

Sorts an array of gk_fkv_t in decreasing order

Definition at line 256 of file sort.c.

◆ gk_fkvsorti()

void gk_fkvsorti ( size_t  n,
gk_fkv_t *  base 
)

Sorts an array of gk_fkv_t in increasing order

Definition at line 245 of file sort.c.

◆ gk_fsortd()

void gk_fsortd ( size_t  n,
float *  base 
)

Sorts an array of floats in decreasing order

Definition at line 78 of file sort.c.

◆ gk_fsorti()

void gk_fsorti ( size_t  n,
float *  base 
)

Sorts an array of floats in increasing order

Definition at line 67 of file sort.c.

◆ gk_i32kvsortd()

void gk_i32kvsortd ( size_t  n,
gk_i32kv_t *  base 
)

Sorts an array of gk_i32kv_t in decreasing order

Definition at line 190 of file sort.c.

◆ gk_i32kvsorti()

void gk_i32kvsorti ( size_t  n,
gk_i32kv_t *  base 
)

Sorts an array of gk_i32kv_t in increasing order

Definition at line 179 of file sort.c.

◆ gk_i64kvsortd()

void gk_i64kvsortd ( size_t  n,
gk_i64kv_t *  base 
)

Sorts an array of gk_i64kv_t in decreasing order

Definition at line 212 of file sort.c.

◆ gk_i64kvsorti()

void gk_i64kvsorti ( size_t  n,
gk_i64kv_t *  base 
)

Sorts an array of gk_i64kv_t in increasing order

Definition at line 201 of file sort.c.

◆ gk_idxkvsortd()

void gk_idxkvsortd ( size_t  n,
gk_idxkv_t *  base 
)

Sorts an array of gk_idxkv_t in decreasing order

Definition at line 322 of file sort.c.

◆ gk_idxkvsorti()

void gk_idxkvsorti ( size_t  n,
gk_idxkv_t *  base 
)

Sorts an array of gk_idxkv_t in increasing order

Definition at line 311 of file sort.c.

◆ gk_idxsortd()

void gk_idxsortd ( size_t  n,
gk_idx_t base 
)

Sorts an array of gk_idx_t in decreasing order

Definition at line 122 of file sort.c.

◆ gk_idxsorti()

void gk_idxsorti ( size_t  n,
gk_idx_t base 
)

Sorts an array of gk_idx_t in increasing order

Definition at line 111 of file sort.c.

◆ gk_ikvsortd()

void gk_ikvsortd ( size_t  n,
gk_ikv_t *  base 
)

Sorts an array of gk_ikv_t in decreasing order

Definition at line 168 of file sort.c.

◆ gk_ikvsorti()

void gk_ikvsorti ( size_t  n,
gk_ikv_t *  base 
)

Sorts an array of gk_ikv_t in increasing order

Definition at line 157 of file sort.c.

◆ gk_isortd()

void gk_isortd ( size_t  n,
int base 
)

Sorts an array of integers in decreasing order

Definition at line 56 of file sort.c.

◆ gk_isorti()

void gk_isorti ( size_t  n,
int base 
)

Sorts an array of integers in increasing order

Definition at line 45 of file sort.c.

◆ gk_skvsortd()

void gk_skvsortd ( size_t  n,
gk_skv_t *  base 
)

Sorts an array of gk_skv_t in decreasing order

Definition at line 300 of file sort.c.

◆ gk_skvsorti()

void gk_skvsorti ( size_t  n,
gk_skv_t *  base 
)

Sorts an array of gk_skv_t in increasing order

Definition at line 289 of file sort.c.

◆ gk_zkvsortd()

void gk_zkvsortd ( size_t  n,
gk_zkv_t *  base 
)

Sorts an array of gk_zkv_t in decreasing order

Definition at line 234 of file sort.c.

◆ gk_zkvsorti()

void gk_zkvsorti ( size_t  n,
gk_zkv_t *  base 
)

Sorts an array of gk_zkv_t in increasing order

Definition at line 223 of file sort.c.



gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:52