GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
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 "gcg/def.h"
#include "scip/scip.h"

Go to the source code of this file.

Macros

#define GCG_DECL_SORTINDCOMP(x)
#define GCG_DECL_SORTPTRCOMP(x)

Functions

GCG_EXPORT void GCGsortPtr (void **ptrarray, GCG_DECL_SORTPTRCOMP((*ptrcomp)), void *userdata, int len)
GCG_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)
Value:
int x (void* userdata, void* dataptr, int ind1, int ind2)
SCIP_VAR ** x

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 52 of file gcgsort.h.

Referenced by GCGSORTTPL_NAME(), GCGSORTTPL_NAME(), GCGSORTTPL_NAME(), and GCGSORTTPL_NAME().

◆ GCG_DECL_SORTPTRCOMP

#define GCG_DECL_SORTPTRCOMP ( x)
Value:
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 60 of file gcgsort.h.

Referenced by GCG_DECL_SORTPTRCOMP(), GCG_DECL_SORTPTRCOMP(), GCGsortPtr(), GCGsortPtrPtr(), GCGSORTTPL_NAME(), GCGSORTTPL_NAME(), GCGSORTTPL_NAME(), and GCGSORTTPL_NAME().

Function Documentation

◆ GCGsortPtr()

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

References GCG_DECL_SORTPTRCOMP, GCG_EXPORT, and GCGsortPtr().

Referenced by GCGsortPtr(), and LexicographicSort().

◆ GCGsortPtrPtr()

GCG_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
-data element comparator
userdatauserdata that is supplied to the comparator function
lenlength of arrays

References GCG_DECL_SORTPTRCOMP, and GCGsortPtrPtr().

Referenced by GCGsortPtrPtr(), and GCGtransformMastersolToOrigsol().