12#ifndef __RD_METRICMATRIXCAL_H__
13#define __RD_METRICMATRIXCAL_H__
32template <
class vectType,
class entryType>
48 void setMetricFunc(
double (*mFunc)(
const entryType &,
const entryType &,
50 dp_metricFunc = mFunc;
81 unsigned int dim,
double *distMat) {
84 for (
unsigned int i = 1; i < nItems; i++) {
85 unsigned int itab = i * (i - 1) / 2;
86 for (
unsigned int j = 0; j < i; j++) {
87 distMat[itab + j] = dp_metricFunc(descripts[i], descripts[j], dim);
102 double (*dp_metricFunc)(
const entryType &,
const entryType &,
unsigned int);
#define CHECK_INVARIANT(expr, mess)
A generic metric matrix calculator (e.g similarity matrix or distance matrix)
void setMetricFunc(double(*mFunc)(const entryType &, const entryType &, unsigned int))
Set the metric function.
void calcMetricMatrix(const vectType &descripts, unsigned int nItems, unsigned int dim, double *distMat)
The calculator function.
MetricMatrixCalc()
Default Constructor.