1
/* Copyright (C) 2006, 2007 William McCune
3
This file is part of the LADR Deduction Library.
5
The LADR Deduction Library is free software; you can redistribute it
6
and/or modify it under the terms of the GNU General Public License,
9
The LADR Deduction Library is distributed in the hope that it will be
10
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with the LADR Deduction Library; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22
#include <stdlib.h> /* for malloc/free */
25
This package defines Ordertype and has a generic sorting
26
routine merge_sort() that can be used to sort any kind of data.
29
/* Public definitions */
31
/* basic order relations */
33
typedef enum { NOT_COMPARABLE,
38
GREATER_THAN_OR_SAME_AS,
43
/* End of public definitions */
45
/* Public function prototypes from order.c */
47
void merge_sort_recurse(void *a[], /* array to sort */
48
void *w[], /* work array */
49
int start, /* index of first element */
50
int end, /* index of last element */
51
Ordertype (*comp_proc) (void *, void *));
53
void merge_sort(void *a[], /* array to sort */
54
int n, /* size of array */
55
Ordertype (*comp_proc) (void *, void *));
57
Ordertype compare_vecs(int *a, int *b, int n);
59
void copy_vec(int *a, int *b, int n);
61
#endif /* conditional compilation of whole file */