tweak: minor code org

This commit is contained in:
NunoSempere 2022-04-20 13:25:13 -04:00
parent c8a505dcf0
commit cfc1fd2239

View File

@ -1,6 +1,17 @@
// Types
let emptyXYShape: PointSetTypes.xyShape = {xs: [], ys: []}
exception LogicallyInconsistent(string)
// Helpers
let getArithmeticComplementOfDistributionForSubstraction = (
dist: PointSetTypes.xyShape,
): PointSetTypes.xyShape => {
let newXs = Belt.Array.map(dist.xs, x => -.x)
{xs: newXs, ys: dist.ys}
}
let getApproximatePdfOfContinuousDistributionAtPoint = (
dist: PointSetTypes.xyShape,
point: float,
@ -39,6 +50,8 @@ let getApproximatePdfOfContinuousDistributionAtPoint = (
result
}
// Inner functions
let addContinuousContinuous = (
s1: PointSetTypes.xyShape,
s2: PointSetTypes.xyShape,
@ -87,12 +100,7 @@ let addContinuousContinuous = (
{xs: newXs, ys: newYs}
}
let getArithmeticComplementOfDistributionForSubstraction = (
dist: PointSetTypes.xyShape,
): PointSetTypes.xyShape => {
let newXs = Belt.Array.map(dist.xs, x => -.x)
{xs: newXs, ys: dist.ys}
}
// Main function
let combineShapesContinuousContinuous = (
op: Operation.algebraicOperation,