massiv-1.0.4.0: Massiv (Массив) is an Array Library.
Copyright(c) Alexey Kuleshevich 2019-2022
LicenseBSD3
MaintainerAlexey Kuleshevich <lehins@yandex.ru>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Massiv.Core.Operations

Description

 

Documentation

class (Size r, Num e) => FoldNumeric r e where Source #

Minimal complete definition

foldArray, powerSumArray, unsafeDotProduct

Methods

sumArray :: Index ix => Array r ix e -> e Source #

Compute sum of all elements in the array

Since: 0.5.6

productArray :: Index ix => Array r ix e -> e Source #

Compute product of all elements in the array

Since: 0.5.6

powerSumArray :: Index ix => Array r ix e -> Int -> e Source #

Raise each element in the array to some non-negative power and sum the results

Since: 0.5.7

unsafeDotProduct :: Index ix => Array r ix e -> Array r ix e -> e Source #

Compute dot product without any extraneous checks

Since: 0.5.6

foldArray :: Index ix => (e -> e -> e) -> e -> Array r ix e -> e Source #

Fold over an array

Since: 0.5.6

Instances

Instances details
Num e => FoldNumeric D e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Pull

Methods

sumArray :: Index ix => Array D ix e -> e Source #

productArray :: Index ix => Array D ix e -> e Source #

powerSumArray :: Index ix => Array D ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array D ix e -> Array D ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array D ix e -> e Source #

Num e => FoldNumeric B e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

sumArray :: Index ix => Array B ix e -> e Source #

productArray :: Index ix => Array B ix e -> e Source #

powerSumArray :: Index ix => Array B ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array B ix e -> Array B ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array B ix e -> e Source #

Num e => FoldNumeric BL e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

sumArray :: Index ix => Array BL ix e -> e Source #

productArray :: Index ix => Array BL ix e -> e Source #

powerSumArray :: Index ix => Array BL ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array BL ix e -> Array BL ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array BL ix e -> e Source #

(NFData e, Num e) => FoldNumeric BN e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

sumArray :: Index ix => Array BN ix e -> e Source #

productArray :: Index ix => Array BN ix e -> e Source #

powerSumArray :: Index ix => Array BN ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array BN ix e -> Array BN ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array BN ix e -> e Source #

(Prim e, Num e) => FoldNumeric P e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

sumArray :: Index ix => Array P ix e -> e Source #

productArray :: Index ix => Array P ix e -> e Source #

powerSumArray :: Index ix => Array P ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array P ix e -> Array P ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array P ix e -> e Source #

(Storable e, Num e) => FoldNumeric S e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

sumArray :: Index ix => Array S ix e -> e Source #

productArray :: Index ix => Array S ix e -> e Source #

powerSumArray :: Index ix => Array S ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array S ix e -> Array S ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array S ix e -> e Source #

(Unbox e, Num e) => FoldNumeric U e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

sumArray :: Index ix => Array U ix e -> e Source #

productArray :: Index ix => Array U ix e -> e Source #

powerSumArray :: Index ix => Array U ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array U ix e -> Array U ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array U ix e -> e Source #

defaultPowerSumArray :: (Index ix, Source r e, Num e) => Array r ix e -> Int -> e Source #

defaultUnsafeDotProduct :: (Num e, Index ix, Source r e) => Array r ix e -> Array r ix e -> e Source #

defaultFoldArray :: (Index ix, Source r e) => (e -> e -> e) -> e -> Array r ix e -> e Source #

class FoldNumeric r e => Numeric r e where Source #

Minimal complete definition

unsafeLiftArray, unsafeLiftArray2

Methods

plusScalar :: Index ix => Array r ix e -> e -> Array r ix e Source #

minusScalar :: Index ix => Array r ix e -> e -> Array r ix e Source #

scalarMinus :: Index ix => e -> Array r ix e -> Array r ix e Source #

multiplyScalar :: Index ix => Array r ix e -> e -> Array r ix e Source #

absPointwise :: Index ix => Array r ix e -> Array r ix e Source #

additionPointwise :: Index ix => Array r ix e -> Array r ix e -> Array r ix e Source #

subtractionPointwise :: Index ix => Array r ix e -> Array r ix e -> Array r ix e Source #

multiplicationPointwise :: Index ix => Array r ix e -> Array r ix e -> Array r ix e Source #

powerPointwise :: Index ix => Array r ix e -> Int -> Array r ix e Source #

Raise each element of the array to the power

unsafeLiftArray :: Index ix => (e -> e) -> Array r ix e -> Array r ix e Source #

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array r ix e -> Array r ix e -> Array r ix e Source #

Instances

Instances details
Num e => Numeric D e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Pull

Methods

plusScalar :: Index ix => Array D ix e -> e -> Array D ix e Source #

minusScalar :: Index ix => Array D ix e -> e -> Array D ix e Source #

scalarMinus :: Index ix => e -> Array D ix e -> Array D ix e Source #

multiplyScalar :: Index ix => Array D ix e -> e -> Array D ix e Source #

absPointwise :: Index ix => Array D ix e -> Array D ix e Source #

additionPointwise :: Index ix => Array D ix e -> Array D ix e -> Array D ix e Source #

subtractionPointwise :: Index ix => Array D ix e -> Array D ix e -> Array D ix e Source #

multiplicationPointwise :: Index ix => Array D ix e -> Array D ix e -> Array D ix e Source #

powerPointwise :: Index ix => Array D ix e -> Int -> Array D ix e Source #

unsafeLiftArray :: Index ix => (e -> e) -> Array D ix e -> Array D ix e Source #

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array D ix e -> Array D ix e -> Array D ix e Source #

Num e => Numeric B e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

plusScalar :: Index ix => Array B ix e -> e -> Array B ix e Source #

minusScalar :: Index ix => Array B ix e -> e -> Array B ix e Source #

scalarMinus :: Index ix => e -> Array B ix e -> Array B ix e Source #

multiplyScalar :: Index ix => Array B ix e -> e -> Array B ix e Source #

absPointwise :: Index ix => Array B ix e -> Array B ix e Source #

additionPointwise :: Index ix => Array B ix e -> Array B ix e -> Array B ix e Source #

subtractionPointwise :: Index ix => Array B ix e -> Array B ix e -> Array B ix e Source #

multiplicationPointwise :: Index ix => Array B ix e -> Array B ix e -> Array B ix e Source #

powerPointwise :: Index ix => Array B ix e -> Int -> Array B ix e Source #

unsafeLiftArray :: Index ix => (e -> e) -> Array B ix e -> Array B ix e Source #

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array B ix e -> Array B ix e -> Array B ix e Source #

Num e => Numeric BL e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

plusScalar :: Index ix => Array BL ix e -> e -> Array BL ix e Source #

minusScalar :: Index ix => Array BL ix e -> e -> Array BL ix e Source #

scalarMinus :: Index ix => e -> Array BL ix e -> Array BL ix e Source #

multiplyScalar :: Index ix => Array BL ix e -> e -> Array BL ix e Source #

absPointwise :: Index ix => Array BL ix e -> Array BL ix e Source #

additionPointwise :: Index ix => Array BL ix e -> Array BL ix e -> Array BL ix e Source #

subtractionPointwise :: Index ix => Array BL ix e -> Array BL ix e -> Array BL ix e Source #

multiplicationPointwise :: Index ix => Array BL ix e -> Array BL ix e -> Array BL ix e Source #

powerPointwise :: Index ix => Array BL ix e -> Int -> Array BL ix e Source #

unsafeLiftArray :: Index ix => (e -> e) -> Array BL ix e -> Array BL ix e Source #

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array BL ix e -> Array BL ix e -> Array BL ix e Source #

(NFData e, Num e) => Numeric BN e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

plusScalar :: Index ix => Array BN ix e -> e -> Array BN ix e Source #

minusScalar :: Index ix => Array BN ix e -> e -> Array BN ix e Source #

scalarMinus :: Index ix => e -> Array BN ix e -> Array BN ix e Source #

multiplyScalar :: Index ix => Array BN ix e -> e -> Array BN ix e Source #

absPointwise :: Index ix => Array BN ix e -> Array BN ix e Source #

additionPointwise :: Index ix => Array BN ix e -> Array BN ix e -> Array BN ix e Source #

subtractionPointwise :: Index ix => Array BN ix e -> Array BN ix e -> Array BN ix e Source #

multiplicationPointwise :: Index ix => Array BN ix e -> Array BN ix e -> Array BN ix e Source #

powerPointwise :: Index ix => Array BN ix e -> Int -> Array BN ix e Source #

unsafeLiftArray :: Index ix => (e -> e) -> Array BN ix e -> Array BN ix e Source #

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array BN ix e -> Array BN ix e -> Array BN ix e Source #

(Prim e, Num e) => Numeric P e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

plusScalar :: Index ix => Array P ix e -> e -> Array P ix e Source #

minusScalar :: Index ix => Array P ix e -> e -> Array P ix e Source #

scalarMinus :: Index ix => e -> Array P ix e -> Array P ix e Source #

multiplyScalar :: Index ix => Array P ix e -> e -> Array P ix e Source #

absPointwise :: Index ix => Array P ix e -> Array P ix e Source #

additionPointwise :: Index ix => Array P ix e -> Array P ix e -> Array P ix e Source #

subtractionPointwise :: Index ix => Array P ix e -> Array P ix e -> Array P ix e Source #

multiplicationPointwise :: Index ix => Array P ix e -> Array P ix e -> Array P ix e Source #

powerPointwise :: Index ix => Array P ix e -> Int -> Array P ix e Source #

unsafeLiftArray :: Index ix => (e -> e) -> Array P ix e -> Array P ix e Source #

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array P ix e -> Array P ix e -> Array P ix e Source #

(Storable e, Num e) => Numeric S e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

plusScalar :: Index ix => Array S ix e -> e -> Array S ix e Source #

minusScalar :: Index ix => Array S ix e -> e -> Array S ix e Source #

scalarMinus :: Index ix => e -> Array S ix e -> Array S ix e Source #

multiplyScalar :: Index ix => Array S ix e -> e -> Array S ix e Source #

absPointwise :: Index ix => Array S ix e -> Array S ix e Source #

additionPointwise :: Index ix => Array S ix e -> Array S ix e -> Array S ix e Source #

subtractionPointwise :: Index ix => Array S ix e -> Array S ix e -> Array S ix e Source #

multiplicationPointwise :: Index ix => Array S ix e -> Array S ix e -> Array S ix e Source #

powerPointwise :: Index ix => Array S ix e -> Int -> Array S ix e Source #

unsafeLiftArray :: Index ix => (e -> e) -> Array S ix e -> Array S ix e Source #

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array S ix e -> Array S ix e -> Array S ix e Source #

(Unbox e, Num e) => Numeric U e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

plusScalar :: Index ix => Array U ix e -> e -> Array U ix e Source #

minusScalar :: Index ix => Array U ix e -> e -> Array U ix e Source #

scalarMinus :: Index ix => e -> Array U ix e -> Array U ix e Source #

multiplyScalar :: Index ix => Array U ix e -> e -> Array U ix e Source #

absPointwise :: Index ix => Array U ix e -> Array U ix e Source #

additionPointwise :: Index ix => Array U ix e -> Array U ix e -> Array U ix e Source #

subtractionPointwise :: Index ix => Array U ix e -> Array U ix e -> Array U ix e Source #

multiplicationPointwise :: Index ix => Array U ix e -> Array U ix e -> Array U ix e Source #

powerPointwise :: Index ix => Array U ix e -> Int -> Array U ix e Source #

unsafeLiftArray :: Index ix => (e -> e) -> Array U ix e -> Array U ix e Source #

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array U ix e -> Array U ix e -> Array U ix e Source #

defaultUnsafeLiftArray :: (Load r ix e, Source r e) => (e -> e) -> Array r ix e -> Array r ix e Source #

defaultUnsafeLiftArray2 :: (Load r ix e, Source r e) => (e -> e -> e) -> Array r ix e -> Array r ix e -> Array r ix e Source #

class (Numeric r e, Floating e) => NumericFloat r e where Source #

Minimal complete definition

Nothing

Methods

divideScalar :: Index ix => Array r ix e -> e -> Array r ix e Source #

scalarDivide :: Index ix => e -> Array r ix e -> Array r ix e Source #

divisionPointwise :: Index ix => Array r ix e -> Array r ix e -> Array r ix e Source #

recipPointwise :: Index ix => Array r ix e -> Array r ix e Source #

sqrtPointwise :: Index ix => Array r ix e -> Array r ix e Source #

Instances

Instances details
Floating e => NumericFloat D e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Pull

Methods

divideScalar :: Index ix => Array D ix e -> e -> Array D ix e Source #

scalarDivide :: Index ix => e -> Array D ix e -> Array D ix e Source #

divisionPointwise :: Index ix => Array D ix e -> Array D ix e -> Array D ix e Source #

recipPointwise :: Index ix => Array D ix e -> Array D ix e Source #

sqrtPointwise :: Index ix => Array D ix e -> Array D ix e Source #

(Prim e, Floating e) => NumericFloat P e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

divideScalar :: Index ix => Array P ix e -> e -> Array P ix e Source #

scalarDivide :: Index ix => e -> Array P ix e -> Array P ix e Source #

divisionPointwise :: Index ix => Array P ix e -> Array P ix e -> Array P ix e Source #

recipPointwise :: Index ix => Array P ix e -> Array P ix e Source #

sqrtPointwise :: Index ix => Array P ix e -> Array P ix e Source #

(Storable e, Floating e) => NumericFloat S e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

divideScalar :: Index ix => Array S ix e -> e -> Array S ix e Source #

scalarDivide :: Index ix => e -> Array S ix e -> Array S ix e Source #

divisionPointwise :: Index ix => Array S ix e -> Array S ix e -> Array S ix e Source #

recipPointwise :: Index ix => Array S ix e -> Array S ix e Source #

sqrtPointwise :: Index ix => Array S ix e -> Array S ix e Source #