comparison maths/CosineDistance.h @ 505:930b5b0f707d

Merge branch 'codestyle-and-tidy'
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 05 Jun 2019 12:55:15 +0100
parents bb78ca3fe7de
children
comparison
equal deleted inserted replaced
471:e3335cb213da 505:930b5b0f707d
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /* 2 /*
4 QM DSP Library 3 QM DSP Library
5 4
6 Centre for Digital Music, Queen Mary, University of London. 5 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2008 Kurt Jacobson. 6 This file copyright 2008 Kurt Jacobson.
11 published by the Free Software Foundation; either version 2 of the 10 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 11 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 12 COPYING included with this distribution for more information.
14 */ 13 */
15 14
16 #ifndef COSINEDISTANCE_H 15 #ifndef QM_DSP_COSINEDISTANCE_H
17 #define COSINEDISTANCE_H 16 #define QM_DSP_COSINEDISTANCE_H
18 17
19 #include <vector> 18 #include <vector>
20 #include <math.h> 19 #include <math.h>
21
22 using std::vector;
23 20
24 class CosineDistance 21 class CosineDistance
25 { 22 {
26 public: 23 public:
27 CosineDistance() { } 24 CosineDistance() { }
28 ~CosineDistance() { } 25 ~CosineDistance() { }
29 26
30 double distance(const vector<double> &v1, const vector<double> &v2); 27 double distance(const std::vector<double> &v1,
28 const std::vector<double> &v2);
31 29
32 protected: 30 protected:
33 double dist, dDenTot, dDen1, dDen2, dSum1; 31 double dist, dDenTot, dDen1, dDen2, dSum1;
34 }; 32 };
35 33