Safe Haskell | None |
---|
Support for unified handling of scalars and vectors.
Attention:
The rounding and fraction functions only work
for floating point values with maximum magnitude of maxBound :: Int32
.
This way we save expensive handling of possibly seldom cases.
- class (Real a, IsFloating a) => Fraction a where
- truncate :: Value a -> CodeGenFunction r (Value a)
- fraction :: Value a -> CodeGenFunction r (Value a)
- signedFraction :: Fraction a => Value a -> CodeGenFunction r (Value a)
- addToPhase :: Fraction a => Value a -> Value a -> CodeGenFunction r (Value a)
- incPhase :: Fraction a => Value a -> Value a -> CodeGenFunction r (Value a)
- type family Scalar vector :: *
- class Replicate vector where
- replicate :: Value (Scalar vector) -> CodeGenFunction r (Value vector)
- replicateConst :: ConstValue (Scalar vector) -> ConstValue vector
- replicateOf :: (IsConst (Scalar v), Replicate v) => Scalar v -> Value v
- class IsArithmetic a => Real a where
- min :: Value a -> Value a -> CodeGenFunction r (Value a)
- max :: Value a -> Value a -> CodeGenFunction r (Value a)
- abs :: Value a -> CodeGenFunction r (Value a)
- signum :: Value a -> CodeGenFunction r (Value a)
- class (IsArithmetic (Scalar v), IsArithmetic v) => PseudoModule v where
- scale :: a ~ Scalar v => Value a -> Value v -> CodeGenFunction r (Value v)
- scaleConst :: a ~ Scalar v => ConstValue a -> ConstValue v -> CodeGenFunction r (ConstValue v)
- class IsConst a => IntegerConstant a where
- constFromInteger :: Integer -> ConstValue a
- class IntegerConstant a => RationalConstant a where
- constFromRational :: Rational -> ConstValue a
- class RationalConstant a => TranscendentalConstant a where
- constPi :: ConstValue a
Documentation
class (Real a, IsFloating a) => Fraction a whereSource
truncate :: Value a -> CodeGenFunction r (Value a)Source
fraction :: Value a -> CodeGenFunction r (Value a)Source
signedFraction :: Fraction a => Value a -> CodeGenFunction r (Value a)Source
The fraction has the same sign as the argument. This is not particular useful but fast on IEEE implementations.
addToPhase :: Fraction a => Value a -> Value a -> CodeGenFunction r (Value a)Source
increment (first operand) may be negative, phase must always be non-negative
incPhase :: Fraction a => Value a -> Value a -> CodeGenFunction r (Value a)Source
both increment and phase must be non-negative
class Replicate vector whereSource
replicate :: Value (Scalar vector) -> CodeGenFunction r (Value vector)Source
an alternative is using the Constant
vector type
replicateConst :: ConstValue (Scalar vector) -> ConstValue vectorSource
class IsArithmetic a => Real a whereSource
class (IsArithmetic (Scalar v), IsArithmetic v) => PseudoModule v whereSource
scale :: a ~ Scalar v => Value a -> Value v -> CodeGenFunction r (Value v)Source
scaleConst :: a ~ Scalar v => ConstValue a -> ConstValue v -> CodeGenFunction r (ConstValue v)Source
class IsConst a => IntegerConstant a whereSource
constFromInteger :: Integer -> ConstValue aSource
class IntegerConstant a => RationalConstant a whereSource
RationalConstant Double | |
RationalConstant Float | |
(RationalConstant a, IsPrimitive a, Positive n) => RationalConstant (Vector n a) |
class RationalConstant a => TranscendentalConstant a whereSource
constPi :: ConstValue aSource