autoheader generates config.h instead of cconfig.h.
[pazpar2-moved-to-github.git] / src / relevance.c
index ddf511f..b35adce 100644 (file)
@@ -1,7 +1,5 @@
-/* $Id: relevance.c,v 1.13 2007-05-10 11:46:09 adam Exp $
-   Copyright (c) 2006-2007, Index Data.
-
-This file is part of Pazpar2.
+/* This file is part of Pazpar2.
+   Copyright (C) 2006-2008 Index Data
 
 Pazpar2 is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
@@ -14,17 +12,17 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with Pazpar2; see the file LICENSE.  If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
- */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+*/
 
 #include <ctype.h>
 #include <math.h>
 #include <stdlib.h>
 
 #if HAVE_CONFIG_H
-#include <cconfig.h>
+#include <config.h>
 #endif
 
 #include "relevance.h"
@@ -286,31 +284,6 @@ void relevance_donerecord(struct relevance *r, struct record_cluster *cluster)
     r->doc_frequency_vec[0]++;
 }
 
-#ifdef GAGA
-#ifdef FLOAT_REL
-static int comp(const void *p1, const void *p2)
-{
-    float res;
-    struct record **r1 = (struct record **) p1;
-    struct record **r2 = (struct record **) p2;
-    res = (*r2)->relevance - (*r1)->relevance;
-    if (res > 0)
-        return 1;
-    else if (res < 0)
-        return -1;
-    else
-        return 0;
-}
-#else
-static int comp(const void *p1, const void *p2)
-{
-    struct record_cluster **r1 = (struct record_cluster **) p1;
-    struct record_cluster **r2 = (struct record_cluster **) p2;
-    return (*r2)->relevance - (*r1)->relevance;
-}
-#endif
-#endif
-
 // Prepare for a relevance-sorted read
 void relevance_prepare_read(struct relevance *rel, struct reclist *reclist)
 {
@@ -352,9 +325,6 @@ void relevance_prepare_read(struct relevance *rel, struct reclist *reclist)
         }
         rec->relevance = (int) (relevance * 100000);
     }
-#ifdef GAGA
-    qsort(reclist->flatlist, reclist->num_records, sizeof(struct record*), comp);
-#endif
     reclist->pointer = 0;
     xfree(idfvec);
 }