File: distance.h

package info (click to toggle)
sdcv 0.3.4-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,644 kB
  • ctags: 1,207
  • sloc: sh: 9,235; ansic: 7,803; cpp: 2,613; makefile: 485; yacc: 316; sed: 16
file content (30 lines) | stat: -rw-r--r-- 574 bytes parent folder | download
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
#ifndef DISTANCE_H
#define DISTANCE_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <glib.h>

class EditDistance {
private:
    int *d;
    int currentelements;
    /*Gets the minimum of three values */
    inline int minimum( const int a, const int b, const int c )
    {
        int min = a;
        if ( b < min )
              min = b;
        if ( c < min )
              min = c;
          return min;
    };
public:
    EditDistance(  );
    ~EditDistance(  );
    int CalEditDistance( const gunichar *s, const gunichar *t, const int limit );
};

#endif