Description

This module defines the algebra over various types of balls in metric spaces

Synopsis

# Documentation

printTriDistances :: (Show (Scalar m), Metric m) => m -> m -> m -> IO () Source

Useful for identifying tree metrics.

printQuadDistances :: (Ord (Scalar t), Show (Scalar t), Metric t) => t -> t -> t -> t -> IO () Source

There are three distinct perfect matchings in every complete 4 node graph. A metric is a tree metric iff two of these perfect matchings have the same weight. This is called the 4 points condition. printQuadDistances :: (Ord (Scalar m), Show (Scalar m), Metric m) => m -> m -> m -> m -> IO ()

data Ball v Source

The closed balls in metric space. Note that since we are not assuming any special structure, addition is rather inefficient.

FIXME: There are several valid ways to perform the addition; which should we use? We could add Lattice instances in a similar way as we could with Box if we added an empty element; should we do this?

Constructors

 Ball Fieldsradius :: !(Scalar v) center :: !v

Instances

 (Read v, Read (Scalar v)) => Read (Ball v) Source (Show v, Show (Scalar v)) => Show (Ball v) Source (Arbitrary v, Arbitrary (Scalar v), HasScalar v) => Arbitrary (Ball v) Source (NFData v, NFData (Scalar v)) => NFData (Ball v) Source Source (Metric v, HasScalar v, ClassicalLogic v) => Container (Ball v) Source (Metric v, HasScalar v, ClassicalLogic v) => Constructible (Ball v) Source (Metric v, HasScalar v, ClassicalLogic v) => Semigroup (Ball v) Source (Eq v, HasScalar v) => Eq_ (Ball v) Source Source type Elem (Ball v) = v Source type Scalar (Ball v) = Scalar v Source type Logic (Ball v) = Logic v Source type SetElem (Ball v) v' = Ball v' Source

newtype BanachBall v Source

FIXME: In a Banach space we can make Ball addition more efficient by moving the center to an optimal location.

Constructors

 BanachBall (Ball v)