@@ -451,24 +451,14 @@ find_nondominated_3d_impl_sorted(const double ** rows, size_t size,
451451 return new_size ;
452452}
453453
454- static __force_inline__ size_t
455- find_nondominated_3d_impl (const double * * restrict rows , size_t size ,
456- const bool keep_weakly ,
457- const bool find_dominated )
458- {
459- // Sort in ascending lexicographic order from the last dimension.
460- qsort_typesafe (rows , size , cmp_ppdouble_asc_rev_3d );
461- // Help GCC generate all possible specializations of this function.
462- return keep_weakly
463- ? find_nondominated_3d_impl_sorted (rows , size , true, find_dominated )
464- : find_nondominated_3d_impl_sorted (rows , size , false, find_dominated );
465- }
466-
467454static inline size_t
468- find_dominated_3d_ (const double * restrict points , size_t size , bool keep_weakly )
455+ find_dominated_3d_impl (const double * restrict points , size_t size , bool keep_weakly )
469456{
470- const double * * rows = generate_row_pointers (points , size , 3 );
471- size_t pos = find_nondominated_3d_impl (rows , size , keep_weakly , /* find_dominated=*/ true);
457+ // Sort in ascending lexicographic order from the last dimension.
458+ const double * * rows = generate_row_pointers_asc_rev_3d (points , size );
459+ size_t pos = keep_weakly
460+ ? find_nondominated_3d_impl_sorted (rows , size , true, /* find_dominated=*/ true)
461+ : find_nondominated_3d_impl_sorted (rows , size , false, /* find_dominated=*/ true);
472462 if (pos < size )
473463 pos = row_index_from_ptr (points , rows [pos ], 3 );
474464 free (rows );
@@ -480,12 +470,14 @@ find_dominated_3d_(const double * restrict points, size_t size, bool keep_weakly
480470 nondominated points.
481471*/
482472static inline size_t
483- find_nondominated_set_3d_ (const double * restrict points , size_t size ,
484- const bool keep_weakly , boolvec * restrict nondom )
473+ find_nondominated_set_3d_impl (const double * restrict points , size_t size ,
474+ const bool keep_weakly , boolvec * restrict nondom )
485475{
486476 ASSUME (nondom != NULL );
487- const double * * rows = generate_row_pointers (points , size , 3 );
488- size_t new_size = find_nondominated_3d_impl (rows , size , keep_weakly , /* find_dominated=*/ false);
477+ const double * * rows = generate_row_pointers_asc_rev_3d (points , size );
478+ size_t new_size = keep_weakly
479+ ? find_nondominated_3d_impl_sorted (rows , size , true, /* find_dominated=*/ false)
480+ : find_nondominated_3d_impl_sorted (rows , size , false, /* find_dominated=*/ false);
489481
490482 if (new_size < size ) {
491483 memset (nondom , false, size * sizeof (* nondom ));
@@ -652,7 +644,7 @@ find_dominated_point_(const double * restrict points, size_t size, dimension_t d
652644 if (dim == 2 ) {
653645 res = find_dominated_2d_ (pp , size , keep_weakly );
654646 } else {
655- res = find_dominated_3d_ (pp , size , keep_weakly );
647+ res = find_dominated_3d_impl (pp , size , keep_weakly );
656648 }
657649 if (pp != points )
658650 free ((void * ) pp );
@@ -696,7 +688,7 @@ find_nondominated_set_(const double * restrict points, size_t size, dimension_t
696688 if (dim == 2 ) {
697689 new_size = find_nondominated_set_2d_ (pp , size , keep_weakly , nondom );
698690 } else if (dim == 3 ) {
699- new_size = find_nondominated_set_3d_ (pp , size , keep_weakly , nondom );
691+ new_size = find_nondominated_set_3d_impl (pp , size , keep_weakly , nondom );
700692 } else {
701693 new_size = find_nondominated_set_kung (pp , size , dim , keep_weakly , nondom );
702694 }
0 commit comments