+ fixed some index bugs in the evaluation
[qpalma.git] / dyn_prog / penalty_info.h
1 #ifndef __PENALTY_INFO_H__
2 #define __PENALTY_INFO_H__
3
4 #include "common.h"
5 #include "Mathmatics.h"
6
7 enum ETransformType
8 {
9 T_LINEAR,
10 T_LOG,
11 T_LOG_PLUS1,
12 T_LOG_PLUS3,
13 T_LINEAR_PLUS3
14 } ;
15
16 struct penalty_struct
17 {
18 INT len ;
19 REAL *limits ;
20 REAL *penalties ;
21 INT max_len ;
22 INT min_len ;
23 REAL *cache ;
24 enum ETransformType transform ;
25 INT id ;
26 struct penalty_struct *next_pen ;
27 char * name ;
28 INT use_svm ;
29 } ;
30
31 void init_penalty_struct(struct penalty_struct &PEN) ;
32 void delete_penalty_struct_palma(struct penalty_struct &PEN) ;
33 //void delete_penalty_struct_array(struct penalty_struct *PEN, INT len) ;
34 void copy_penalty_struct(struct penalty_struct *old, struct penalty_struct *newp);
35
36 //#ifdef HAVE_MATLAB
37 //struct penalty_struct * read_penalty_struct_from_cell(const mxArray * mx_penalty_info, mwSize &P) ;
38 //#endif
39
40 REAL lookup_penalty(const struct penalty_struct *PEN, INT p_value,
41 REAL* svm_values, bool follow_next=true) ;
42
43 enum mode { NORMAL, USE_QUALITY_SCORES};
44
45 #endif