Gaia
frozendistance.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_FROZENDISTANCE_H
21 #define GAIA_FROZENDISTANCE_H
22 
23 #include <QVector>
24 #include <QPointer>
25 #include "Eigen/Dense"
26 #include "layoutawarefactory.h"
27 #include "frozendataset.h"
28 #include "utils.h"
29 
30 namespace gaia2 {
31 
32 
34 public:
35  FrozenDistance(const FrozenDataSet& dataset) : _dataset(dataset) {}
36  virtual ~FrozenDistance() {}
37 
38  virtual void prepare(const FrozenPoint& query) { Q_UNUSED(query); }
39  virtual Real operator()(int i, const FrozenPoint& query) const = 0;
40 
41  const FrozenDataSet& dataset() const { return _dataset; }
42 
43  // needed for the factory
44  QString name;
45  QStringList validParams;
46 
47 protected:
48  const FrozenDataSet& _dataset;
49  //int _offset, _size;
50 };
51 
52 
53 
54 
56 typedef FrozenMetricFactory FrozenDistanceFunctionFactory;
57 
58 void registerFrozenMetrics();
59 
60 
61 } // namespace gaia2
62 
63 #endif // GAIA_FROZENDISTANCE_H
Definition: frozendistance.h:33
Main Gaia namespace, which contains all the library functions.
Definition: addfield.cpp:22
A FrozenDataSet is a dataset that has been flagged as immutable.
Definition: frozendataset.h:49
A tuned implementation of a factory.
Definition: layoutawarefactory.h:39