Mercurial > hg > qm-dsp
annotate maths/CosineDistance.h @ 435:ad02841a1172
Add a MSVC build project. This is hard to use, because it depends on a BLAS library
| author | Chris Cannam <c.cannam@qmul.ac.uk> |
|---|---|
| date | Mon, 05 Feb 2018 17:36:47 +0000 |
| parents | d5014ab8b0e5 |
| children | 701233f8ed41 |
| rev | line source |
|---|---|
| c@256 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
| c@256 | 2 |
| c@256 | 3 /* |
| c@256 | 4 QM DSP Library |
| c@256 | 5 |
| c@256 | 6 Centre for Digital Music, Queen Mary, University of London. |
| c@256 | 7 This file copyright 2008 Kurt Jacobson. |
| c@309 | 8 |
| c@309 | 9 This program is free software; you can redistribute it and/or |
| c@309 | 10 modify it under the terms of the GNU General Public License as |
| c@309 | 11 published by the Free Software Foundation; either version 2 of the |
| c@309 | 12 License, or (at your option) any later version. See the file |
| c@309 | 13 COPYING included with this distribution for more information. |
| c@256 | 14 */ |
| c@256 | 15 |
| c@256 | 16 #ifndef COSINEDISTANCE_H |
| c@256 | 17 #define COSINEDISTANCE_H |
| c@256 | 18 |
| c@256 | 19 #include <vector> |
| c@256 | 20 #include <math.h> |
| c@256 | 21 |
| c@256 | 22 using std::vector; |
| c@256 | 23 |
| c@256 | 24 class CosineDistance |
| c@256 | 25 { |
| c@256 | 26 public: |
| c@256 | 27 CosineDistance() { } |
| c@256 | 28 ~CosineDistance() { } |
| c@256 | 29 |
| c@256 | 30 double distance(const vector<double> &v1, const vector<double> &v2); |
| c@256 | 31 |
| c@256 | 32 protected: |
| c@256 | 33 double dist, dDenTot, dDen1, dDen2, dSum1; |
| c@256 | 34 }; |
| c@256 | 35 |
| c@256 | 36 #endif |
| c@256 | 37 |
