MCPcopy Create free account
hub / github.com/GenericMappingTools/gmt / gmt_sort_array

Function gmt_sort_array

src/gmt_support.c:6940–6968  ·  view source on GitHub ↗

! . */

Source from the content-addressed store, hash-verified

6938
6939/*! . */
6940void gmt_sort_array (struct GMT_CTRL *GMT, void *base, uint64_t n, unsigned int type) {
6941 /* Front function to call qsort on all <type> array into ascending order */
6942 size_t width[GMT_N_TYPES] = {
6943 sizeof(uint8_t), /* GMT_UCHAR */
6944 sizeof(int8_t), /* GMT_CHAR */
6945 sizeof(uint16_t), /* GMT_USHORT */
6946 sizeof(int16_t), /* GMT_SHORT */
6947 sizeof(uint32_t), /* GMT_UINT */
6948 sizeof(int32_t), /* GMT_INT */
6949 sizeof(uint64_t), /* GMT_ULONG */
6950 sizeof(int64_t), /* GMT_LONG */
6951 sizeof(float), /* GMT_FLOAT */
6952 sizeof(double)}; /* GMT_DOUBLE */
6953 int (*compare[GMT_N_TYPES]) (const void *, const void *) = {
6954 /* Array of function pointers */
6955 gmtsupport_comp_uchar_asc, /* GMT_CHAR */
6956 gmtsupport_comp_char_asc, /* GMT_UCHAR */
6957 gmtsupport_comp_ushort_asc, /* GMT_USHORT */
6958 gmtsupport_comp_short_asc, /* GMT_SHORT */
6959 gmtsupport_comp_uint_asc, /* GMT_UINT */
6960 gmtsupport_comp_int_asc, /* GMT_INT */
6961 gmtsupport_comp_ulong_asc, /* GMT_ULONG */
6962 gmtsupport_comp_long_asc, /* GMT_LONG */
6963 gmtsupport_comp_float_asc, /* GMT_FLOAT */
6964 gmtsupport_comp_double_asc}; /* GMT_DOUBLE */
6965 gmt_M_unused(GMT);
6966
6967 qsort (base, n, width[type], compare[type]);
6968}
6969
6970/*! . */
6971void gmt_sort_order (struct GMT_CTRL *GMT, struct GMT_ORDER *base, uint64_t n, int dir) {

Callers 15

gmt_plotinitFunction · 0.85
GMT_makecptFunction · 0.85
gmt_crossoverFunction · 0.85
gmt_set_int_selectionFunction · 0.85
gmtsupport_unique_arrayFunction · 0.85
gmtmath_LMSSCLFunction · 0.85
gmtmath_MADFunction · 0.85
gmtmath_MEDIANFunction · 0.85
gmtmath_PQUANTFunction · 0.85
gmtregress_icept_basicFunction · 0.85
gmtregress_LMS_misfitFunction · 0.85
fitcircle_circle_misfitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected