]> granicus.if.org Git - graphviz/commitdiff
remove unused vector_median
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 23 Jun 2021 03:41:55 +0000 (20:41 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 25 Jun 2021 13:52:00 +0000 (06:52 -0700)
lib/sparse/general.c
lib/sparse/general.h

index e6ba341215491ca239fc08865f54cc39d1efb1d7..1ba6358a439cf71375fda74ef193c2db4545754f 100644 (file)
 double _statistics[10];
 #endif
 
-real vector_median(int n, real *x){
-  /* find the median value in a list of real */
-  int *p = NULL;
-  real res;
-  vector_ordering(n, x, &p);
-
-  if ((n/2)*2 == n){
-    res = 0.5*(x[p[n/2-1]] + x[p[n/2]]);
-  } else {
-    res = x[p[n/2]];
-  }
-  FREE(p);
-  return res;
-}
 real vector_percentile(int n, real *x, real y){
   /* find the value such that y% of element of vector x is <= that value.
    y: a value between 0 and 1.
index ef88f2947c8639857239c244bd0220e770a8c580..40329d9fc04c5b68eb7bb062cca06c38ed9badfb 100644 (file)
@@ -104,7 +104,6 @@ void vector_float_take(int n, float *v, int m, int *p, float **u);
 */
 void vector_ordering(int n, real *v, int **p);
 void vector_sort_int(int n, int *v);
-real vector_median(int n, real *x);
 real vector_percentile(int n, real *x, real y);/* find the value such that y% of element of vector x is <= that value.*/
 
 void vector_print(char *s, int n, real *x);