quantizer-0.3.0.2: Library to provide the behaviour similar to quantum states superposition.
Copyright(c) OleksandrZhabenko 2023
LicenseMIT
Maintaineroleksandr.zhabenko@yahoo.com
StabilityExperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

ListQuantizer

Description

A module to provide the extended variants to convert a list with some values to another one with the values from the pre-defined another list. Similar to the measurement of the quantum state observables with the discrete spectrum. Contrary to TwoQuantizer module, the results in every function here depend not just on the two values, which the point is located in between, but on the whole list. Defined for just positive real numbers of Double type.

Synopsis

Documentation

round2GL Source #

Arguments

:: Ord a 
=> Bool

If True then the function rounds the result in the ambiguous situation to the greater value. The ambigous situation is defined by the second argument.

-> ([a] -> a -> Ordering) 
-> [a] 
-> a 
-> Maybe a

The a value (in Just case) can be equal just to the one of the two first a arguments.

A better suited variant for round2G for lists.

foldableQuantizerGL Source #

Arguments

:: (Ord a, Floating a) 
=> Bool

If True then the function rounds the result in the ambiguous situation to the greater value. The ambigous situation is defined by the second argument.

-> ([a] -> a -> Ordering) 
-> [a] 
-> [a] 
-> [a] 

round2GML Source #

Arguments

:: (Ord a, Monad m) 
=> Bool

If True then the function rounds the result in the ambiguous situation to the greater value. The ambigous situation is defined by the second argument.

-> ([a] -> a -> m Ordering) 
-> [a] 
-> a 
-> m (Maybe a) 

foldableQuantizerGML Source #

Arguments

:: (Ord a, Floating a, Monad m) 
=> Bool

If True then the function rounds the result in the ambiguous situation to the greater value. The ambigous situation is defined by the second argument.

-> ([a] -> a -> m Ordering) 
-> [a] 
-> [a] 
-> m [a]