numeric-prelude-0.2: An experimental alternative hierarchy of numeric type classes

Portability requires multi-parameter type classes provisional numericprelude@henning-thielemann.de

Algebra.NormedSpace.Euclidean

Description

Abstraction of normed vector spaces

Synopsis

# Documentation

class (C a, C a v) => Sqr a v whereSource

Helper class for `C` that does not need an algebraic type `a`.

Minimal definition: `normSqr`

Methods

normSqr :: v -> aSource

Square of the Euclidean norm of a vector. This is sometimes easier to implement.

Instances

 Sqr Double Double Sqr Float Float Sqr Int Int Sqr Integer Integer Sqr a v => Sqr a [v] Sqr a b => Sqr a (T b) Sqr a b => Sqr a (T b) (Sqr a v0, Sqr a v1) => Sqr a (v0, v1) (Ord i, Eq a, Eq v, Sqr a v) => Sqr a (Map i v) (Sqr a v0, Sqr a v1, Sqr a v2) => Sqr a (v0, v1, v2) (C a, C a) => Sqr (T a) (T a)

normSqrFoldable :: (Sqr a v, Foldable f) => f v -> aSource

Default definition for `normSqr` that is based on `Foldable` class.

normSqrFoldable1 :: (Sqr a v, Foldable f, Functor f) => f v -> aSource

Default definition for `normSqr` that is based on `Foldable` class and the argument vector has at least one component.

class Sqr a v => C a v whereSource

A vector space equipped with an Euclidean or a Hilbert norm.

Minimal definition: `norm`

Methods

norm :: v -> aSource

Euclidean norm of a vector.

Instances

 C Double Double C Float Float C Int Int C Integer Integer (C a, Sqr a v) => C a [v] (C a, Sqr a b) => C a (T b) (C a, Sqr a b) => C a (T b) (C a, Sqr a v0, Sqr a v1) => C a (v0, v1) (Ord i, Eq a, Eq v, C a, Sqr a v) => C a (Map i v) (C a, Sqr a v0, Sqr a v1, Sqr a v2) => C a (v0, v1, v2)

defltNorm :: (C a, Sqr a v) => v -> aSource