Header menu logo FSharp.Data.Adaptive

AdaptiveReduction Module

Functional operators for AdaptiveReduction.

Functions and values

Function or value Description

average ()

Full Usage: average ()

Parameters:
    () : unit

Returns: AdaptiveReduction<^a, (int * ^s), ^s>
Modifiers: inline
Type parameters: ^a, ^s

A reduction returning the average of all elements.

() : unit
Returns: AdaptiveReduction<^a, (int * ^s), ^s>

count

Full Usage: count

Returns: AdaptiveReduction<'a, int, int>

A simple reduction counting all elements.

Returns: AdaptiveReduction<'a, int, int>

countNegative

Full Usage: countNegative

Returns: AdaptiveReduction<bool, int, int>

A simple reduction counting all elements that are false.

Returns: AdaptiveReduction<bool, int, int>

countPositive

Full Usage: countPositive

Returns: AdaptiveReduction<bool, int, int>

A simple reduction counting all elements that are true.

Returns: AdaptiveReduction<bool, int, int>

fold zero add

Full Usage: fold zero add

Parameters:
    zero : 's
    add : 's -> 'a -> 's

Returns: AdaptiveReduction<'a, 's, 's>

Creates a new AdaptiveReduction using the given *classical* fold function. Note the these *classical* folds are inefficient in presence of adaptivity and should be replaced by *group-like* constructs whenever possible.

zero : 's
add : 's -> 'a -> 's
Returns: AdaptiveReduction<'a, 's, 's>

group zero add sub

Full Usage: group zero add sub

Parameters:
    zero : 's
    add : 's -> 'a -> 's
    sub : 's -> 'a -> 's

Returns: AdaptiveReduction<'a, 's, 's>

Creates a new AdaptiveReduction using the given (group-like) functions. Note that the functions need to fulfill the following laws (and maybe more) * `sub (add x a) a = x` (inverse) * `add (sub x a) a = x` (inverse) * `add (add x a) b = add (add x b) a` (commutativity)

zero : 's
add : 's -> 'a -> 's
sub : 's -> 'a -> 's
Returns: AdaptiveReduction<'a, 's, 's>

halfGroup zero add sub

Full Usage: halfGroup zero add sub

Parameters:
    zero : 's
    add : 's -> 'a -> 's
    sub : 's -> 'a -> ValueOption<'s>

Returns: AdaptiveReduction<'a, 's, 's>

Creates a new AdaptiveReduction using the given (partial-group-like) functions. Note that the functions need to fulfill the following laws when sub claims success (and maybe more) * `sub (add x a) a = x` (inverse) * `add (sub x a) a = x` (inverse) * `add (add x a) b = add (add x b) a` (commutativity)

zero : 's
add : 's -> 'a -> 's
sub : 's -> 'a -> ValueOption<'s>
Returns: AdaptiveReduction<'a, 's, 's>

mapIn mapping reduction

Full Usage: mapIn mapping reduction

Parameters:
Returns: AdaptiveReduction<'a, 's, 'v>

Applies a mapping function on the input side of the given AdaptiveReduction. Note that the supplied mapping function is assumed to be very cheap.

mapping : 'a -> 'b
reduction : AdaptiveReduction<'b, 's, 'v>
Returns: AdaptiveReduction<'a, 's, 'v>

mapOut mapping reduction

Full Usage: mapOut mapping reduction

Parameters:
Returns: AdaptiveReduction<'a, 's, 'w>

Applies a mapping function on the output side of the given AdaptiveReduction. Note that the supplied mapping function is assumed to be very cheap.

mapping : 'v -> 'w
reduction : AdaptiveReduction<'a, 's, 'v>
Returns: AdaptiveReduction<'a, 's, 'w>

par left right

Full Usage: par left right

Parameters:
Returns: AdaptiveReduction<'a, ('s * 't), ('v * 'w)>

Creates a new AdaptiveReduction that simultaniously (parallel) applies two reductions by tupling the state- and result-type.

left : AdaptiveReduction<'a, 's, 'v>
right : AdaptiveReduction<'a, 't, 'w>
Returns: AdaptiveReduction<'a, ('s * 't), ('v * 'w)>

product ()

Full Usage: product ()

Parameters:
    () : unit

Returns: AdaptiveReduction<^a, ^s, ^s>
Modifiers: inline
Type parameters: ^a, ^s

A reduction returning the product of all elements.

() : unit
Returns: AdaptiveReduction<^a, ^s, ^s>

structpar left right

Full Usage: structpar left right

Parameters:
Returns: AdaptiveReduction<'a, ('s * 't), ('v * 'w)>

Creates a new AdaptiveReduction that simultaniously (parallel) applies two reductions by (struct) tupling the state- and result-type.

left : AdaptiveReduction<'a, 's, 'v>
right : AdaptiveReduction<'a, 't, 'w>
Returns: AdaptiveReduction<'a, ('s * 't), ('v * 'w)>

sum ()

Full Usage: sum ()

Parameters:
    () : unit

Returns: AdaptiveReduction<^a, ^s, ^s>
Modifiers: inline
Type parameters: ^a, ^s

A reduction returning the sum of all elements.

() : unit
Returns: AdaptiveReduction<^a, ^s, ^s>

tryMax

Full Usage: tryMax

Returns: AdaptiveReduction<'a, 'a voption, 'a voption>

A reduction getting the largest element (if any)

Returns: AdaptiveReduction<'a, 'a voption, 'a voption>

tryMin

Full Usage: tryMin

Returns: AdaptiveReduction<'a, 'a voption, 'a voption>

A reduction getting the smallest element (if any)

Returns: AdaptiveReduction<'a, 'a voption, 'a voption>

Type something to start searching.