More code cleanup
[svmtool++.git] / src / weight.h
blobebe7d51ad084750996a4635c6811a647b102b5d5
1 /*
2 * Copyright (C) 2004 Jesus Gimenez, Lluis Marquez and Senen Moya
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef SVMT_WEIGHT_H
21 typedef struct weight_node_t
23 char pos[5];
24 long double data;
25 } weight_node_t;
27 class weightRepository
29 private:
30 hash_t wr;
32 //char *wrGetMergeInput(hash_t *tptr); //DEL 180705
33 char *wrGetMergeInput(hash_t *tptr, float filter); //ADD 180705
34 FILE *openFile(char *name, char mode[]);
35 void wrReadMergeModel(FILE *in,float filter);
36 char wrSaltarBlancs(FILE *in,char c,int jmp);
37 void wrAddPOS(uintptr_t obj, char* pos, long double weight);
39 public:
40 long double wrGetWeight(const char *feature,char *pos);
41 void wrAdd(char *feature, char* pos, long double weight);
42 //void wrWrite(const char *outName); //DEL 180705
43 void wrWrite(const char *outName, float filter); //ADD 180705
44 void wrWriteHash(hash_t *tptr,FILE *f,char separador);
45 weightRepository(char *fileName,float filter);
46 weightRepository();
47 ~weightRepository();
50 #define SVMT_WEIGHT_H
51 #endif