Class MinkowskiMetric

java.lang.Object
org.episteme.core.mathematics.topology.metrics.MinkowskiMetric
All Implemented Interfaces:
Metric<Vector<Real>>

public class MinkowskiMetric extends Object implements Metric<Vector<Real>>
Minkowski metric (Lp norm).

d(x,y) = (Σ|xᵢ - yᵢ|ᵖ)^(1/p)

Special cases: - p = 1: Manhattan metric - p = 2: Euclidean metric - p = ∞: Chebyshev metric

*

Reference:
Minkowski, H. (1908). Raum und Zeit. Physikalische Zeitschrift, 10, 104-111.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • MinkowskiMetric

      public MinkowskiMetric(Real p)
      Creates a Minkowski metric with the given p value.
      Parameters:
      p - the power (must be >= 1)
    • MinkowskiMetric

      public MinkowskiMetric(double p)
      Creates a Minkowski metric with the given p value.
      Parameters:
      p - the power (must be >= 1)
  • Method Details

    • distance

      public Real distance(Vector<Real> a, Vector<Real> b)
      Description copied from interface: Metric
      Computes the distance between two objects.
      Specified by:
      distance in interface Metric<Vector<Real>>
      Parameters:
      a - the first object
      b - the second object
      Returns:
      the distance between a and b (always non-negative)
    • getP

      public Real getP()
      Returns the p value.
      Returns:
      the power