home *** CD-ROM | disk | FTP | other *** search
/ ftp.disi.unige.it / 2015-02-11.ftp.disi.unige.it.tar / ftp.disi.unige.it / pub / .person / BarlaA / sw / OLD / Simo / SVM_mono / patt_rec.h < prev    next >
C/C++ Source or Header  |  2002-06-25  |  1KB  |  64 lines

  1. #define MAXLENGTH    256
  2.  
  3. #define DELTA    .000001     /* precision */
  4. #define DELTA2  1               /* bordino */
  5. #define EPSILON    .000001     /* precision */
  6.  
  7. #define LINEAR_KERNEL     1
  8. #define POLY_KERNEL     2
  9. #define NEGATIVE_KERNEL  3
  10. #define MV_KERNEL        10
  11. #define RBF_KERNEL     50
  12. #define HAUS_KERNEL      100
  13. #define HAUS_KERNEL_SIMM 200
  14.  
  15. #define UNKNOWN_KERNEL     255
  16.  
  17. #ifndef byte
  18. #define byte unsigned char
  19. #endif
  20.  
  21. #define length_training(tr)        ((tr)->ell)
  22. #define dim_training(tr)           ((tr)->dim)
  23. #define class_training(tr, i)      ((tr)->points[i].class)
  24. #define vect_training(tr, i)       ((tr)->points[i].vect)
  25.  
  26. typedef struct {
  27.     double *vect;       /* training vector    */
  28.     int     class;       /* point class         */
  29.     } Point;
  30.  
  31. typedef struct {
  32.     int    ell;        /* number of points    */
  33.     int    dim;        /* point dimensionality */
  34.     Point    *points;    /* training points    */
  35.     } training;
  36.  
  37. double        kernel(int knl, double *v1, double *v2);
  38. double        *solver();
  39. void        write_solution(FILE *fp, double *sol, int knl, double bee, double c_const);
  40. void        *myalloc(void *p, size_t size, char *message);
  41. FILE        *myfopen(char *fn, char *type, char *msg);
  42.  
  43. training    *read_training(FILE *fp1);
  44. double        *solve(training *tr, int knl, double c_const, int spdim, char *image_ker, char *f_kernel);
  45. double      ilmiomin(double x, double y);
  46.  
  47.  
  48.  
  49. double **dmatrix();
  50. int *ivector();
  51. void free_ivector();
  52. void free_dmatrix();
  53. void nrerror();
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.