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 / patt_rec.h < prev    next >
C/C++ Source or Header  |  2002-06-25  |  1KB  |  52 lines

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