-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHRSTreeSearch.h
52 lines (41 loc) · 1.57 KB
/
HRSTreeSearch.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//========================================================================
// HRSTreeSearch.h
//========================================================================
// Handwritten recognition system that uses linear search.
#ifndef HRS_TREE_H
#define HRS_TREE_H
#include "IHandwritingRecSys.h"
#include "Tree.h"
// Here we use forward declaration instead of #include. Forward
// declaration is a declaration of an identifier (type, variable, or
// class) before giving a complete definition.
//
// We should use forward declaration whenever possible. Using forward
// declaration is almost always better than using #include because
// #include may have some side effects such as:
// - including other headers you don't need
// - polluting the namespcae
// - longer compilation time
class Image;
template < typename T >
class Vector;
//------------------------------------------------------------------------
// HRSTreeSearch
//------------------------------------------------------------------------
class HRSTreeSearch : public IHandwritingRecSys
{
public:
HRSTreeSearch( unsigned int K = 1000 );
void train ( const Vector<Image>& vec );
Image classify( const Image& img );
private:
unsigned int m_k;
Tree<Image> m_tree;
Vector<Image> m_vec;
//'''' ASSIGNMENT TASK '''''''''''''''''''''''''''''''''''''''''''''''''
// Declare private data members and member functions. Note that
// according to our naming convention, data member's name should starts
// with a `m_` prefix.
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
};
#endif