Map Module

Module to strore specialised computations on maps

Functions and values

Function or value Description

merge mapA mapB

Full Usage: merge mapA mapB

Parameters:
    mapA : Map<'key, 'value> - Frequency map A
    mapB : Map<'key, 'value> - Frequency map B

Returns: Map<'key, 'value> New frequency map that results from merged maps mapA and mapB.

Merges two maps into a single map. If a key exists in both maps, the value in mapA is superseded by the value in mapB.

When applied to continuous data the bandwidths must be equal!This function is not commutative! (merge a b) is not equal to (merge b a)

mapA : Map<'key, 'value>

Frequency map A

mapB : Map<'key, 'value>

Frequency map B

Returns: Map<'key, 'value>

New frequency map that results from merged maps mapA and mapB.

mergeAdd mapA mapB

Full Usage: mergeAdd mapA mapB

Parameters:
    mapA : Map<'key, ^value> - Frequency map A
    mapB : Map<'key, ^value> - Frequency map B

Returns: Map<'key, ^value> New frequency map that results from merged maps mapA and mapB. Values from keys that are present in both maps are handled by f
Modifiers: inline
Type parameters: 'key, ^value

Merges two maps into a single map. If a key exists in both maps, the value from mapB is added to the value of mapA.

When applied to continuous data the bandwidths must be equal!This function is not commutative! (add a b) is not equal to (add b a)

mapA : Map<'key, ^value>

Frequency map A

mapB : Map<'key, ^value>

Frequency map B

Returns: Map<'key, ^value>

New frequency map that results from merged maps mapA and mapB. Values from keys that are present in both maps are handled by f

mergeBy f mapA mapB

Full Usage: mergeBy f mapA mapB

Parameters:
    f : 'value -> 'value -> 'value - Function to transform values if key is present in both maps. `mapA-value → mapB-value → newValue`
    mapA : Map<'key, 'value> - Frequency map A
    mapB : Map<'key, 'value> - Frequency map B

Returns: Map<'key, 'value> New frequency map that results from merged maps mapA and mapB. Values from keys that are present in both maps are handled by f

Merges two maps into a single map. If a key exists in both maps, the value is determined by f with the first value being from mapA and the second originating from mapB.

When applied to continuous data the bandwidths must be equal!This function is not commutative! (mergeBy f a b) is not equal to (mergeBy f b a)

f : 'value -> 'value -> 'value

Function to transform values if key is present in both maps. `mapA-value → mapB-value → newValue`

mapA : Map<'key, 'value>

Frequency map A

mapB : Map<'key, 'value>

Frequency map B

Returns: Map<'key, 'value>

New frequency map that results from merged maps mapA and mapB. Values from keys that are present in both maps are handled by f

mergeSubtract mapA mapB

Full Usage: mergeSubtract mapA mapB

Parameters:
    mapA : Map<'key, ^value> - Frequency map A
    mapB : Map<'key, ^value> - Frequency map B

Returns: Map<'key, ^value>
Modifiers: inline
Type parameters: 'key, ^value

Merges two maps into a single map. If a key exists in both maps, the value from mapB is subtracted from the value of mapA.

When applied to continuous data the bandwidths must be equal!This function is not commutative! (subtract a b) is not equal to (subtract b a)

mapA : Map<'key, ^value>

Frequency map A

mapB : Map<'key, ^value>

Frequency map B

Returns: Map<'key, ^value>