test_qsort-def.c
Go to the documentation of this file.
00001 
00006 /*
00007 Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson.
00008 All rights reserved.
00009 
00010 This file is part of the VLFeat library and is made available under
00011 the terms of the BSD license (see the COPYING file).
00012 */
00013 
00014 #define VL_QSORT_prefix my_qsort
00015 #define VL_QSORT_type   float
00016 #include <vl/qsort-def.h>
00017 
00018 #include <stdio.h>
00019 
00020 int
00021 main (int argc VL_UNUSED, char ** argv VL_UNUSED)
00022 {
00023   float values [] = {.4, 12.3, 44.0, 1.2, 3.4, 5.6} ;
00024   vl_size n = sizeof(values) / sizeof(values[0]) ;
00025   vl_uindex i ;
00026 
00027   for (i = 0 ; i < n ; ++i) printf("%5.2f ", values [i]) ;
00028   printf("\n") ;
00029 
00030   my_qsort_sort (values, n) ;
00031 
00032   for (i = 0 ; i < n ; ++i) printf("%5.2f ", values [i]) ;
00033   printf("\n") ;
00034 
00035   return 0 ;
00036 }


libvlfeat
Author(s): Andrea Vedaldi
autogenerated on Thu Jun 6 2019 20:25:51