Mercurial > hg > qm-dsp
annotate maths/CosineDistance.h @ 489:701233f8ed41
Make include-guards consistent
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Fri, 31 May 2019 16:48:37 +0100 |
parents | d5014ab8b0e5 |
children | bb78ca3fe7de |
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 QM DSP Library |
c@256 | 4 |
c@256 | 5 Centre for Digital Music, Queen Mary, University of London. |
c@256 | 6 This file copyright 2008 Kurt Jacobson. |
c@309 | 7 |
c@309 | 8 This program is free software; you can redistribute it and/or |
c@309 | 9 modify it under the terms of the GNU General Public License as |
c@309 | 10 published by the Free Software Foundation; either version 2 of the |
c@309 | 11 License, or (at your option) any later version. See the file |
c@309 | 12 COPYING included with this distribution for more information. |
c@256 | 13 */ |
c@256 | 14 |
cannam@489 | 15 #ifndef QM_DSP_COSINEDISTANCE_H |
cannam@489 | 16 #define QM_DSP_COSINEDISTANCE_H |
c@256 | 17 |
c@256 | 18 #include <vector> |
c@256 | 19 #include <math.h> |
c@256 | 20 |
c@256 | 21 using std::vector; |
c@256 | 22 |
c@256 | 23 class CosineDistance |
c@256 | 24 { |
c@256 | 25 public: |
c@256 | 26 CosineDistance() { } |
c@256 | 27 ~CosineDistance() { } |
c@256 | 28 |
c@256 | 29 double distance(const vector<double> &v1, const vector<double> &v2); |
c@256 | 30 |
c@256 | 31 protected: |
c@256 | 32 double dist, dDenTot, dDen1, dDen2, dSum1; |
c@256 | 33 }; |
c@256 | 34 |
c@256 | 35 #endif |
c@256 | 36 |