Scippy

GCG

Branch-and-Price & Column Generation for Everyone

gcgsort.h File Reference

Detailed Description

sorting functions, adapted from SCIP's sorttpl to include userdata

Author
Tobias Oelschlegel

Definition in file gcgsort.h.

#include "scip/scip.h"

Go to the source code of this file.

Macros

#define GCG_DECL_SORTINDCOMP(x)   int x (void* userdata, void* dataptr, int ind1, int ind2)
 
#define GCG_DECL_SORTPTRCOMP(x)   int x (void* userdata, void* elem1, void* elem2)
 

Functions

SCIP_EXPORT void GCGsortPtr (void **ptrarray, GCG_DECL_SORTPTRCOMP((*ptrcomp)), void *userdata, int len)
 
SCIP_EXPORT void GCGsortPtrPtr (void **ptrarray1, void **ptrarray2, GCG_DECL_SORTPTRCOMP((*ptrcomp)), void *userdata, int len)
 

Macro Definition Documentation

◆ GCG_DECL_SORTINDCOMP

#define GCG_DECL_SORTINDCOMP (   x)    int x (void* userdata, void* dataptr, int ind1, int ind2)

compares two element indices result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value

0: ind2 comes after (is worse than) ind2

Definition at line 50 of file gcgsort.h.

◆ GCG_DECL_SORTPTRCOMP

#define GCG_DECL_SORTPTRCOMP (   x)    int x (void* userdata, void* elem1, void* elem2)

compares two data element pointers result: < 0: elem1 comes before (is better than) elem2 = 0: both elements have the same value

0: elem2 comes after (is worse than) elem2

Definition at line 58 of file gcgsort.h.

Function Documentation

◆ GCGsortPtr()

SCIP_EXPORT void GCGsortPtr ( void **  ptrarray,
GCG_DECL_SORTPTRCOMP((*ptrcomp))  ,
void *  userdata,
int  len 
)
Parameters
ptrarraypointer array to be sorted
userdatauserdata that is supplied to the comparator function
lenlength of array

Referenced by LexicographicSort().

◆ GCGsortPtrPtr()

SCIP_EXPORT void GCGsortPtrPtr ( void **  ptrarray1,
void **  ptrarray2,
GCG_DECL_SORTPTRCOMP((*ptrcomp))  ,
void *  userdata,
int  len 
)

sort of two joint arrays of pointers/pointers, sorted by first array in non-decreasing order

Parameters
ptrarray1first pointer array to be sorted
ptrarray2second pointer array to be permuted in the same way
userdatauserdata that is supplied to the comparator function
lenlength of arrays

Referenced by GCGtransformMastersolToOrigsol().