-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlabels.h
60 lines (52 loc) · 2.6 KB
/
labels.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef _LVQ_LABELS_H
#define _LVQ_LABELS_H
/************************************************************************
* *
* Program packages 'lvq_pak' and 'som_pak' : *
* *
* labels.h *
* - header file for label manipulation functions *
* *
* Version 3.2 *
* Date: 21 Aug 1995 *
* *
* NOTE: This program package is copyrighted in the sense that it *
* may be used for scientific purposes. The package as a whole, or *
* parts thereof, cannot be included or used in any commercial *
* application without written permission granted by its producents. *
* No programs contained in this package may be copied for commercial *
* distribution. *
* *
* All comments concerning this program package may be sent to the *
* e-mail address 'lvq@cochlea.hut.fi'. *
* *
************************************************************************/
#define LABEL_EMPTY 0
struct hit_entry {
struct hit_entry *next, *prev;
long label;
long freq; /* frequency of this label */
};
struct hitlist {
struct hit_entry *head, *tail;
long entries; /* number of entries */
};
int find_conv_to_ind(char *str);
char *find_conv_to_lab(int ind);
int number_of_labels();
void free_labels();
int set_entry_label(struct data_entry *entry, int label);
int get_entry_labels(struct data_entry *entry, int i);
#define get_entry_label(e) get_entry_labels((e), 0)
void clear_entry_labels(struct data_entry *entry);
int add_entry_label(struct data_entry *entry, int label);
int copy_entry_labels(struct data_entry *dest, struct data_entry *source);
/* hitlists */
struct hitlist *new_hitlist(void);
void clear_hitlist(struct hitlist *hl);
void free_hitlist(struct hitlist *hl);
struct hit_entry *find_hit(struct hitlist *hl, long label);
long add_hit(struct hitlist *hl, long label);
void print_hitlist(struct hitlist *hl, FILE *fp);
long hitlist_label_freq(struct hitlist *hl, long label);
#endif /* _LVQ_LABELS_H */