-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSimilarityScore.h
110 lines (86 loc) · 2.16 KB
/
SimilarityScore.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#ifndef SimilarityScore_h
#define SimilarityScore_h
//============================================================================
/**
Abstract base template class representing a numerical expression for the
similarity between two keys or chords.
@author Johan Pauwels
@date 20100914
*/
//============================================================================
#include <string>
#include <vector>
#include "MusOO/Chroma.h"
template <typename T>
class SimilarityScore
{
public:
/** Default constructor. */
SimilarityScore();
/** Destructor. */
virtual ~SimilarityScore();
virtual const double score(const T& inRef, const T& inTest) = 0;
const size_t& getRefIndex() const;
const size_t& getTestIndex() const;
const std::vector<T>& getLabels() const;
const size_t getNumOfRefLabels() const;
const size_t getNumOfTestLabels() const;
const T& getMappedRefLabel() const;
const T& getMappedTestLabel() const;
protected:
static const MusOO::Chroma s_firstChroma;
size_t m_NumOfRefLabels;
size_t m_NumOfTestLabels;
size_t m_RefIndex;
size_t m_TestIndex;
T m_MappedRefLabel;
T m_MappedTestLabel;
std::vector<T> m_Labels;
private:
};
template <typename T>
const MusOO::Chroma SimilarityScore<T>::s_firstChroma(MusOO::Chroma::A());
template <typename T>
SimilarityScore<T>::SimilarityScore()
{
}
template <typename T>
SimilarityScore<T>::~SimilarityScore()
{
}
template <typename T>
const size_t& SimilarityScore<T>::getRefIndex() const
{
return m_RefIndex;
}
template <typename T>
const size_t& SimilarityScore<T>::getTestIndex() const
{
return m_TestIndex;
}
template <typename T>
const std::vector<T>& SimilarityScore<T>::getLabels() const
{
return m_Labels;
}
template <typename T>
const size_t SimilarityScore<T>::getNumOfRefLabels() const
{
return m_NumOfRefLabels;
}
template <typename T>
const size_t SimilarityScore<T>::getNumOfTestLabels() const
{
return m_NumOfTestLabels;
}
template <typename T>
const T& SimilarityScore<T>::getMappedRefLabel() const
{
return m_MappedRefLabel;
}
template <typename T>
const T& SimilarityScore<T>::getMappedTestLabel() const
{
return m_MappedTestLabel;
}
#endif // #ifndef SimilarityScore_h