414 return ERROR_INT(
"lh not defined", __func__, 1);
415 if (index < 0 || index >= lh->
n)
416 return ERROR_INT(
"invalid index", __func__, 1);
424 valc = *(l_float32 *)(lh->
array[ic - 1]);
425 valp = *(l_float32 *)(lh->
array[ip - 1]);
428 SWAP_ITEMS(ip - 1, ic - 1);
436 valc = *(l_float32 *)(lh->
array[ic - 1]);
437 valp = *(l_float32 *)(lh->
array[ip - 1]);
440 SWAP_ITEMS(ip - 1, ic - 1);
474l_float32 valp, valcl, valcr;
477 return ERROR_INT(
"lh not defined", __func__, 1);
487 valp = *(l_float32 *)(lh->
array[ip - 1]);
488 valcl = *(l_float32 *)(lh->
array[icl - 1]);
492 SWAP_ITEMS(ip - 1, icl - 1);
495 valcr = *(l_float32 *)(lh->
array[icr - 1]);
496 if (valp <= valcl && valp <= valcr)
498 if (valcl <= valcr) {
499 SWAP_ITEMS(ip - 1, icl - 1);
502 SWAP_ITEMS(ip - 1, icr - 1);
512 valp = *(l_float32 *)(lh->
array[ip - 1]);
513 valcl = *(l_float32 *)(lh->
array[icl - 1]);
517 SWAP_ITEMS(ip - 1, icl - 1);
520 valcr = *(l_float32 *)(lh->
array[icr - 1]);
521 if (valp >= valcl && valp >= valcr)
523 if (valcl >= valcr) {
524 SWAP_ITEMS(ip - 1, icl - 1);
527 SWAP_ITEMS(ip - 1, icr - 1);