CluE  1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
squaredlpmetric.cpp
Go to the documentation of this file.
1 #include "../point/squaredlpmetric.h"
2 #include "../point/point.h"
3 
4 using namespace CluE;
5 
6 SquaredLPMetric::SquaredLPMetric(double pValue) : p(pValue)
7 {
8 }
9 
11 {
12  return new SquaredLPMetric(*this);
13 }
14 
15 double SquaredLPMetric::dissimilarity(Point const& p1, Point const& p2) const
16 {
17  return p1.squaredLpDistance(p2, p);
18 }
19 
20 void SquaredLPMetric::setP(double p)
21 {
22  this->p = p;
23 }
Squared Lp metric for Point.
double squaredLpDistance(Point const &, double p) const
Definition: point.cpp:142
virtual SquaredLPMetric * clone() const
void setP(double p)
Sets p ("Squared Lp distance").
Weighted point of arbitrary dimension.
Definition: point.h:17
virtual double dissimilarity(Point const &, Point const &) const
Computes the squared Lp-distance between the two given Point instances.