Normalize after trunctae

This commit is contained in:
Ozzie Gooen 2022-06-14 16:54:59 -07:00
parent 906878f19f
commit 7ceae18611
2 changed files with 2 additions and 1 deletions

View File

@ -80,6 +80,7 @@ describe("eval on distribution functions", () => {
testEval("truncateLeft(normal(5,2), 3)", "Ok(Point Set Distribution)") testEval("truncateLeft(normal(5,2), 3)", "Ok(Point Set Distribution)")
testEval("truncateRight(normal(5,2), 3)", "Ok(Point Set Distribution)") testEval("truncateRight(normal(5,2), 3)", "Ok(Point Set Distribution)")
testEval("truncate(normal(5,2), 3, 8)", "Ok(Point Set Distribution)") testEval("truncate(normal(5,2), 3, 8)", "Ok(Point Set Distribution)")
testEval("isNormalized(truncate(normal(5,2), 3, 8))", "Ok(true)")
}) })
describe("exp", () => { describe("exp", () => {

View File

@ -214,7 +214,7 @@ module Truncate = {
| Some(r) => Ok(r) | Some(r) => Ok(r)
| None => | None =>
toPointSetFn(t)->E.R2.fmap(t => { toPointSetFn(t)->E.R2.fmap(t => {
DistributionTypes.PointSet(PointSetDist.T.truncate(leftCutoff, rightCutoff, t)) DistributionTypes.PointSet(PointSetDist.T.truncate(leftCutoff, rightCutoff, t)->PointSetDist.T.normalize)
}) })
} }
} }