-/* $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-2009 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
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 <math.h>
+#include <stdlib.h>
+
#include "relevance.h"
#include "pazpar2.h"
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)
{
}
rec->relevance = (int) (relevance * 100000);
}
-#ifdef GAGA
- qsort(reclist->flatlist, reclist->num_records, sizeof(struct record*), comp);
-#endif
reclist->pointer = 0;
xfree(idfvec);
}
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
+