linear-1.23.2: Linear Algebra

Copyright | (C) 2012-2015 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell2010

Linear.Epsilon

Description

Testing for values "near" zero

Synopsis

- class Num a => Epsilon a where
  - nearZero :: a -> Bool

# Documentation

class Num a => Epsilon a where Source #

Provides a fairly subjective test to see if a quantity is near zero.

    >>> nearZero (1e-11 :: Double)
    False

    >>> nearZero (1e-17 :: Double)
    True

    >>> nearZero (1e-5 :: Float)
    False

    >>> nearZero (1e-7 :: Float)
    True

Methods

nearZero :: a -> Bool Source #

Determine if a quantity is near zero.

#### Instances

Instances details

Epsilon CDouble Source #

    abs a <= 1e-12

Instance details Defined in Linear.Epsilon Methods nearZero :: CDouble -> Bool Source #

Epsilon CFloat Source #

    abs a <= 1e-6

Instance details Defined in Linear.Epsilon Methods nearZero :: CFloat -> Bool Source #

Epsilon Double Source #

    abs a <= 1e-12

Instance details Defined in Linear.Epsilon Methods nearZero :: Double -> Bool Source #

Epsilon Float Source #

    abs a <= 1e-6

Instance details Defined in Linear.Epsilon Methods nearZero :: Float -> Bool Source #
(Epsilon a, RealFloat a) => Epsilon (Complex a) Source # |
Instance details Defined in Linear.Epsilon Methods nearZero :: Complex a -> Bool Source #
Epsilon a => Epsilon (Plucker a) Source # |
Instance details Defined in Linear.Plucker Methods nearZero :: Plucker a -> Bool Source #
(RealFloat a, Epsilon a) => Epsilon (Quaternion a) Source # |
Instance details Defined in Linear.Quaternion Methods nearZero :: Quaternion a -> Bool Source #
Epsilon (V0 a) Source # |
Instance details Defined in Linear.V0 Methods nearZero :: V0 a -> Bool Source #
Epsilon a => Epsilon (V1 a) Source # |
Instance details Defined in Linear.V1 Methods nearZero :: V1 a -> Bool Source #
Epsilon a => Epsilon (V2 a) Source # |
Instance details Defined in Linear.V2 Methods nearZero :: V2 a -> Bool Source #
Epsilon a => Epsilon (V3 a) Source # |
Instance details Defined in Linear.V3 Methods nearZero :: V3 a -> Bool Source #
Epsilon a => Epsilon (V4 a) Source # |
Instance details Defined in Linear.V4 Methods nearZero :: V4 a -> Bool Source #
Epsilon (f a) => Epsilon (Point f a) Source # |
Instance details Defined in Linear.Affine Methods nearZero :: Point f a -> Bool Source #
(Dim n, Epsilon a) => Epsilon (V n a) Source # |
Instance details Defined in Linear.V Methods nearZero :: V n a -> Bool Source #