Gaia
bpfdistance.h
1 /*
2  * Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
3  *
4  * This file is part of Gaia
5  *
6  * Gaia is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Affero General Public License as published by the Free
8  * Software Foundation (FSF), either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the Affero GNU General Public License
17  * version 3 along with this program. If not, see http://www.gnu.org/licenses/
18  */
19 
20 #ifndef GAIA_BPFCOMPOSE_H
21 #define GAIA_BPFCOMPOSE_H
22 
23 #include "distancefunction.h"
24 
25 namespace gaia2 {
26 
37 class BPFDistance : public DistanceFunction {
38  public:
39  BPFDistance(const PointLayout& layout, const ParameterMap& params);
40  ~BPFDistance();
41 
42  Real operator()(const Point& p1, const Point& p2, int seg1, int seg2) const;
43 
44  protected:
45 
46  class BPF {
47  protected:
48  std::vector<Real> _xpoints, _ypoints;
49 
50  public:
51  void setBreakPoints(QList<QPointF> bpoints);
52  Real operator()(Real x) const;
53  };
54 
55  BPF _bpf;
56  DistanceFunction* _dist;
57 };
58 
59 } // namespace gaia2
60 
61 #endif // GAIA_BPFCOMPOSE_H
Definition: bpfdistance.h:46
This class describes the layout of a point.
Definition: pointlayout.h:60
Main Gaia namespace, which contains all the library functions.
Definition: addfield.cpp:22
Definition: distancefunction.h:37
Definition: parameter.h:34
Real operator()(const Point &p1, const Point &p2, int seg1, int seg2) const
This function computes the distance between the two given points.
Definition: bpfdistance.cpp:95
Definition: point.h:106
This class composes the breakpoint function specified by its pairs of (split point, value) with the given distance.
Definition: bpfdistance.h:37