2022-04-22 20:27:17 +00:00
|
|
|
type t = DistributionTypes.genericDist
|
|
|
|
type error = DistributionTypes.error
|
2022-03-28 12:39:07 +00:00
|
|
|
type toPointSetFn = t => result<PointSetTypes.pointSetDist, error>
|
2022-04-09 22:10:06 +00:00
|
|
|
type toSampleSetFn = t => result<SampleSetDist.t, error>
|
2022-03-28 12:39:07 +00:00
|
|
|
type scaleMultiplyFn = (t, float) => result<t, error>
|
|
|
|
type pointwiseAddFn = (t, t) => result<t, error>
|
|
|
|
|
2022-04-10 01:24:44 +00:00
|
|
|
let sampleN: (t, int) => array<float>
|
|
|
|
|
2022-04-09 22:10:06 +00:00
|
|
|
let toSampleSetDist: (t, int) => Belt.Result.t<QuriSquiggleLang.SampleSetDist.t, error>
|
2022-03-28 12:39:07 +00:00
|
|
|
|
|
|
|
let fromFloat: float => t
|
|
|
|
|
|
|
|
let toString: t => string
|
|
|
|
|
|
|
|
let normalize: t => t
|
|
|
|
|
2022-04-15 17:58:00 +00:00
|
|
|
let isNormalized: t => bool
|
|
|
|
|
2022-03-31 18:07:39 +00:00
|
|
|
let toFloatOperation: (
|
2022-03-31 13:19:27 +00:00
|
|
|
t,
|
|
|
|
~toPointSetFn: toPointSetFn,
|
2022-03-31 18:07:39 +00:00
|
|
|
~distToFloatOperation: Operation.distToFloatOperation,
|
2022-03-31 13:19:27 +00:00
|
|
|
) => result<float, error>
|
2022-03-28 12:39:07 +00:00
|
|
|
|
2022-04-11 06:16:29 +00:00
|
|
|
@genType
|
2022-03-31 18:07:39 +00:00
|
|
|
let toPointSet: (
|
2022-04-08 12:44:04 +00:00
|
|
|
t,
|
2022-03-31 18:07:39 +00:00
|
|
|
~xyPointLength: int,
|
|
|
|
~sampleCount: int,
|
2022-04-23 18:09:06 +00:00
|
|
|
~xSelection: DistributionTypes.DistributionOperation.pointsetXSelection=?,
|
2022-04-08 12:44:04 +00:00
|
|
|
unit,
|
2022-03-31 18:07:39 +00:00
|
|
|
) => result<PointSetTypes.pointSetDist, error>
|
2022-04-09 02:55:06 +00:00
|
|
|
let toSparkline: (t, ~sampleCount: int, ~bucketCount: int=?, unit) => result<string, error>
|
2022-03-28 12:39:07 +00:00
|
|
|
|
2022-03-31 13:19:27 +00:00
|
|
|
let truncate: (
|
|
|
|
t,
|
|
|
|
~toPointSetFn: toPointSetFn,
|
|
|
|
~leftCutoff: option<float>=?,
|
|
|
|
~rightCutoff: option<float>=?,
|
2022-04-08 12:44:04 +00:00
|
|
|
unit,
|
2022-03-31 13:19:27 +00:00
|
|
|
) => result<t, error>
|
2022-03-28 12:39:07 +00:00
|
|
|
|
|
|
|
let algebraicCombination: (
|
2022-03-29 19:47:32 +00:00
|
|
|
t,
|
2022-03-31 13:19:27 +00:00
|
|
|
~toPointSetFn: toPointSetFn,
|
|
|
|
~toSampleSetFn: toSampleSetFn,
|
2022-04-23 18:09:06 +00:00
|
|
|
~arithmeticOperation: Operation.algebraicOperation,
|
2022-03-31 13:19:27 +00:00
|
|
|
~t2: t,
|
2022-03-28 12:39:07 +00:00
|
|
|
) => result<t, error>
|
|
|
|
|
|
|
|
let pointwiseCombination: (
|
2022-03-29 19:47:32 +00:00
|
|
|
t,
|
2022-03-31 13:19:27 +00:00
|
|
|
~toPointSetFn: toPointSetFn,
|
2022-04-23 18:09:06 +00:00
|
|
|
~algebraicCombination: Operation.algebraicOperation,
|
2022-03-31 13:19:27 +00:00
|
|
|
~t2: t,
|
2022-03-28 12:39:07 +00:00
|
|
|
) => result<t, error>
|
|
|
|
|
|
|
|
let pointwiseCombinationFloat: (
|
2022-03-29 19:47:32 +00:00
|
|
|
t,
|
2022-03-31 13:19:27 +00:00
|
|
|
~toPointSetFn: toPointSetFn,
|
2022-04-23 18:09:06 +00:00
|
|
|
~algebraicCombination: Operation.algebraicOperation,
|
2022-04-22 20:27:17 +00:00
|
|
|
~f: float,
|
2022-03-28 12:39:07 +00:00
|
|
|
) => result<t, error>
|
|
|
|
|
2022-03-31 13:19:27 +00:00
|
|
|
let mixture: (
|
|
|
|
array<(t, float)>,
|
|
|
|
~scaleMultiplyFn: scaleMultiplyFn,
|
|
|
|
~pointwiseAddFn: pointwiseAddFn,
|
2022-04-08 00:17:01 +00:00
|
|
|
) => result<t, error>
|