gcgsorttpl.c
Go to the documentation of this file.
35 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
38 * #define GCGSORTTPL_NAMEEXT <ext> extension to be used for SCIP method names, for example DownIntRealPtr
40 * #define GCGSORTTPL_FIELD1TYPE <type> data type of first additional array which should be sorted in the same way (optional)
41 * #define GCGSORTTPL_FIELD2TYPE <type> data type of second additional array which should be sorted in the same way (optional)
42 * #define GCGSORTTPL_FIELD3TYPE <type> data type of third additional array which should be sorted in the same way (optional)
43 * #define GCGSORTTPL_FIELD4TYPE <type> data type of fourth additional array which should be sorted in the same way (optional)
44 * #define GCGSORTTPL_FIELD5TYPE <type> data type of fifth additional array which should be sorted in the same way (optional)
45 * #define GCGSORTTPL_FIELD6TYPE <type> data type of fifth additional array which should be sorted in the same way (optional)
195 GCGSORTTPL_HASFIELD1PAR( GCGSORTTPL_FIELD1TYPE* field1 ) /**< additional field that should be sorted in the same way */
196 GCGSORTTPL_HASFIELD2PAR( GCGSORTTPL_FIELD2TYPE* field2 ) /**< additional field that should be sorted in the same way */
197 GCGSORTTPL_HASFIELD3PAR( GCGSORTTPL_FIELD3TYPE* field3 ) /**< additional field that should be sorted in the same way */
198 GCGSORTTPL_HASFIELD4PAR( GCGSORTTPL_FIELD4TYPE* field4 ) /**< additional field that should be sorted in the same way */
199 GCGSORTTPL_HASFIELD5PAR( GCGSORTTPL_FIELD5TYPE* field5 ) /**< additional field that should be sorted in the same way */
200 GCGSORTTPL_HASFIELD6PAR( GCGSORTTPL_FIELD6TYPE* field6 ) /**< additional field that should be sorted in the same way */
203 GCGSORTTPL_HASINDCOMPPAR( void* dataptr ) /**< pointer to data field that is given to the external compare method */
262 GCGSORTTPL_HASFIELD1PAR( GCGSORTTPL_FIELD1TYPE* field1 ) /**< additional field that should be sorted in the same way */
263 GCGSORTTPL_HASFIELD2PAR( GCGSORTTPL_FIELD2TYPE* field2 ) /**< additional field that should be sorted in the same way */
264 GCGSORTTPL_HASFIELD3PAR( GCGSORTTPL_FIELD3TYPE* field3 ) /**< additional field that should be sorted in the same way */
265 GCGSORTTPL_HASFIELD4PAR( GCGSORTTPL_FIELD4TYPE* field4 ) /**< additional field that should be sorted in the same way */
266 GCGSORTTPL_HASFIELD5PAR( GCGSORTTPL_FIELD5TYPE* field5 ) /**< additional field that should be sorted in the same way */
267 GCGSORTTPL_HASFIELD6PAR( GCGSORTTPL_FIELD6TYPE* field6 ) /**< additional field that should be sorted in the same way */
270 GCGSORTTPL_HASINDCOMPPAR( void* dataptr ) /**< pointer to data field that is given to the external compare method */
274 SCIP_Bool type /**< TRUE, if quick-sort should start with with key[lo] < pivot <= key[hi], key[lo] <= pivot < key[hi] otherwise */
336 /* everything is greater or equal than the pivot element: move pivot to the left (degenerate case) */
337 assert(!GCGSORTTPL_ISBETTER(key[mid], pivotkey)); /* the pivot element did not change its position */
357 /* everything is greater or equal than the pivot element: move pivot to the left (degenerate case) */
358 assert(!GCGSORTTPL_ISBETTER(key[mid], pivotkey)); /* the pivot element did not change its position */
445 GCGSORTTPL_HASINDCOMPPAR( void* dataptr ) /**< pointer to data field that is given to the external compare method */
459 /** SCIPsort...(): sorts array 'key' and performs the same permutations on the additional 'field' arrays */
463 GCGSORTTPL_HASFIELD1PAR( GCGSORTTPL_FIELD1TYPE* field1 ) /**< additional field that should be sorted in the same way */
464 GCGSORTTPL_HASFIELD2PAR( GCGSORTTPL_FIELD2TYPE* field2 ) /**< additional field that should be sorted in the same way */
465 GCGSORTTPL_HASFIELD3PAR( GCGSORTTPL_FIELD3TYPE* field3 ) /**< additional field that should be sorted in the same way */
466 GCGSORTTPL_HASFIELD4PAR( GCGSORTTPL_FIELD4TYPE* field4 ) /**< additional field that should be sorted in the same way */
467 GCGSORTTPL_HASFIELD5PAR( GCGSORTTPL_FIELD5TYPE* field5 ) /**< additional field that should be sorted in the same way */
468 GCGSORTTPL_HASFIELD6PAR( GCGSORTTPL_FIELD6TYPE* field6 ) /**< additional field that should be sorted in the same way */
471 GCGSORTTPL_HASINDCOMPPAR( void* dataptr ) /**< pointer to data field that is given to the external compare method */
530 GCGSORTTPL_HASFIELD1PAR( GCGSORTTPL_FIELD1TYPE* field1 ) /**< additional field that should be sorted in the same way */
531 GCGSORTTPL_HASFIELD2PAR( GCGSORTTPL_FIELD2TYPE* field2 ) /**< additional field that should be sorted in the same way */
532 GCGSORTTPL_HASFIELD3PAR( GCGSORTTPL_FIELD3TYPE* field3 ) /**< additional field that should be sorted in the same way */
533 GCGSORTTPL_HASFIELD4PAR( GCGSORTTPL_FIELD4TYPE* field4 ) /**< additional field that should be sorted in the same way */
534 GCGSORTTPL_HASFIELD5PAR( GCGSORTTPL_FIELD5TYPE* field5 ) /**< additional field that should be sorted in the same way */
535 GCGSORTTPL_HASFIELD6PAR( GCGSORTTPL_FIELD6TYPE* field6 ) /**< additional field that should be sorted in the same way */
538 GCGSORTTPL_HASINDCOMPPAR( void* dataptr ) /**< pointer to data field that is given to the external compare method */
578 /** SCIPsortedvecDelPos...(): deletes an element at a given position from a sorted multi-vector */
582 GCGSORTTPL_HASFIELD1PAR( GCGSORTTPL_FIELD1TYPE* field1 ) /**< additional field that should be sorted in the same way */
583 GCGSORTTPL_HASFIELD2PAR( GCGSORTTPL_FIELD2TYPE* field2 ) /**< additional field that should be sorted in the same way */
584 GCGSORTTPL_HASFIELD3PAR( GCGSORTTPL_FIELD3TYPE* field3 ) /**< additional field that should be sorted in the same way */
585 GCGSORTTPL_HASFIELD4PAR( GCGSORTTPL_FIELD4TYPE* field4 ) /**< additional field that should be sorted in the same way */
586 GCGSORTTPL_HASFIELD5PAR( GCGSORTTPL_FIELD5TYPE* field5 ) /**< additional field that should be sorted in the same way */
587 GCGSORTTPL_HASFIELD6PAR( GCGSORTTPL_FIELD6TYPE* field6 ) /**< additional field that should be sorted in the same way */
590 GCGSORTTPL_HASINDCOMPPAR( void* dataptr ) /**< pointer to data field that is given to the external compare method */
615 /* The SCIPsortedvecFind...() method only has needs the key array but not the other field arrays. In order to
616 * avoid defining the same method multiple times, only include this method if we do not have any additional fields.
620 /** SCIPsortedvecFind...(): Finds the position at which 'val' is located in the sorted vector by binary search.
621 * If the element exists, the method returns TRUE and stores the position of the element in '*pos'.
622 * If the element does not exist, the method returns FALSE and stores the position of the element that follows
623 * 'val' in the ordering in '*pos', i.e., '*pos' is the position at which 'val' would be inserted.
624 * Note that if the element is not found, '*pos' may be equal to len if all existing elements are smaller than 'val'.
631 GCGSORTTPL_HASINDCOMPPAR( void* dataptr ) /**< pointer to data field that is given to the external compare method */