Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines the algebra over various types of balls in metric spaces
- printTriDistances :: (Show (Scalar m), Metric m) => m -> m -> m -> IO ()
- printQuadDistances :: (Ord (Scalar t), Show (Scalar t), Metric t) => t -> t -> t -> t -> IO ()
- data Ball v = Ball {}
- invar_Ball_radius :: HasScalar v => Ball v -> Logic (Scalar v)
- newtype BanachBall v = BanachBall (Ball v)
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 ()
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?
(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 | |
IsMutable (Ball b) 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 | |
data Mutable m (Ball b0) = Mutable_AppT__ConT_SubHask_Algebra_Metric_Ball___VarT_b_1627650421_ (PrimRef m (Ball b)) 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.
BanachBall (Ball v) |