easytensor-0.1.0.0: Initial project template from stack

Copyright(c) Artem Chirkin
LicenseMIT
Maintainerchirkin@arch.ethz.ch
Safe HaskellNone
LanguageHaskell2010

Numeric.Commons

Contents

Description

 

Synopsis

Documentation

class PrimBytes a where Source #

Minimal complete definition

toBytes, fromBytes, byteSize, byteAlign

Methods

toBytes :: a -> ByteArray# Source #

Store content of a data type in a primitive byte array

fromBytes :: ByteArray# -> a Source #

Load content of a data type from a primitive byte array

byteSize :: a -> Int# Source #

Size of a data type in bytes

byteAlign :: a -> Int# Source #

Alignment of a data type in bytes

Instances

PrimBytes Double Source # 
PrimBytes Float Source # 
PrimBytes Int Source # 
PrimBytes Int8 Source # 
PrimBytes Int16 Source # 
PrimBytes Int32 Source # 
PrimBytes Int64 Source # 
PrimBytes Word Source # 
PrimBytes Word8 Source # 
PrimBytes Word16 Source # 
PrimBytes Word32 Source # 
PrimBytes Word64 Source # 
PrimBytes (TT t n m) => PrimBytes (Tensor t n m) Source # 

class FloatBytes a where Source #

Primitive indexing. No checks, no safety.

Minimal complete definition

ixF

Methods

ixF :: Int# -> a -> Float# Source #

Primitive get Float# (element offset)

Instances

FloatBytes Float Source # 

Methods

ixF :: Int# -> Float -> Float# Source #

FloatBytes (TT t n m) => FloatBytes (Tensor t n m) Source # 

Methods

ixF :: Int# -> Tensor t n m -> Float# Source #

class DoubleBytes a where Source #

Primitive indexing. No checks, no safety.

Minimal complete definition

ixD

Methods

ixD :: Int# -> a -> Double# Source #

Primitive get Double# (element offset)

Instances

DoubleBytes Double Source # 

Methods

ixD :: Int# -> Double -> Double# Source #

DoubleBytes (TT t n m) => DoubleBytes (Tensor t n m) Source # 

Methods

ixD :: Int# -> Tensor t n m -> Double# Source #

class IntBytes a where Source #

Primitive indexing. No checks, no safety.

Minimal complete definition

ixI

Methods

ixI :: Int# -> a -> Int# Source #

Primitive get Int# (element offset)

Instances

IntBytes Int Source # 

Methods

ixI :: Int# -> Int -> Int# Source #

IntBytes Int8 Source # 

Methods

ixI :: Int# -> Int8 -> Int# Source #

IntBytes Int16 Source # 

Methods

ixI :: Int# -> Int16 -> Int# Source #

IntBytes Int32 Source # 

Methods

ixI :: Int# -> Int32 -> Int# Source #

IntBytes Int64 Source # 

Methods

ixI :: Int# -> Int64 -> Int# Source #

IntBytes (TT t n m) => IntBytes (Tensor t n m) Source # 

Methods

ixI :: Int# -> Tensor t n m -> Int# Source #

class WordBytes a where Source #

Primitive indexing. No checks, no safety.

Minimal complete definition

ixW

Methods

ixW :: Int# -> a -> Word# Source #

Primitive get Word# (element offset)

Instances

WordBytes Word Source # 

Methods

ixW :: Int# -> Word -> Word# Source #

WordBytes Word8 Source # 

Methods

ixW :: Int# -> Word8 -> Word# Source #

WordBytes Word16 Source # 

Methods

ixW :: Int# -> Word16 -> Word# Source #

WordBytes Word32 Source # 

Methods

ixW :: Int# -> Word32 -> Word# Source #

WordBytes Word64 Source # 

Methods

ixW :: Int# -> Word64 -> Word# Source #

WordBytes (TT t n m) => WordBytes (Tensor t n m) Source # 

Methods

ixW :: Int# -> Tensor t n m -> Word# Source #

Orphan instances

PrimBytes a => Storable a Source # 

Methods

sizeOf :: a -> Int #

alignment :: a -> Int #

peekElemOff :: Ptr a -> Int -> IO a #

pokeElemOff :: Ptr a -> Int -> a -> IO () #

peekByteOff :: Ptr b -> Int -> IO a #

pokeByteOff :: Ptr b -> Int -> a -> IO () #

peek :: Ptr a -> IO a #

poke :: Ptr a -> a -> IO () #