feldspar-language-0.4.0.2: A functional embedded language for DSP and parallelism

Feldspar.FixedPoint

Synopsis

Documentation

data Fix a

Abstract real number type with exponent and mantissa

Constructors

Fix 

Instances

Eq (Fix a) 
(Range a ~ Size a, Bounded a, Numeric a, Bits a, Ord a, Real a, Integral a) => Fractional (Fix a) 
(Range a ~ Size a, Bounded a, Numeric a, Bits a, Ord a, Real a) => Num (Fix a) 
Show (Fix a) 
Type a => EdgeInfo (Fix a) 
Type a => Syntactic (Fix a) 
(Type a, Bits a) => Splittable (Fix a) 
Bits a => Fixable (Fix a) 
Type a => MultiEdge (Fix a) Feldspar EdgeSize 

class Splittable t => Fixable t where

Operations to get and set exponent

Methods

fix :: Data DefaultInt -> t -> t

getExp :: t -> Data DefaultInt

Instances

freezeFix :: Type a => Fix a -> Data (DefaultInt, a)

Convers an abstract real number to a pair of exponent and mantissa

freezeFix' :: Bits a => DefaultInt -> Fix a -> Data a

Convers an abstract real number to fixed point integer with given exponent

unfreezeFix :: Type a => Data (DefaultInt, a) -> Fix a

Converts a pair of exponent and mantissa to an abstract real number

unfreezeFix' :: DefaultInt -> Data a -> Fix a

Converts a fixed point integer with given exponent to an abstract real number

(?!) :: forall a. (Syntactic a, Splittable a) => Data Bool -> (a, a) -> a

A version of branching for fixed point algorithms

fixFold :: forall a b. Splittable a => (a -> b -> a) -> a -> Vector b -> a

A version of vector fold for fixed point algorithms