Minor document formatting
This commit is contained in:
parent
2ddf0c02cb
commit
da52444e8e
|
@ -7,6 +7,7 @@ let toShape = (sampleCount: int, node: node) => {
|
||||||
|
|
||||||
switch (renderResult) {
|
switch (renderResult) {
|
||||||
| Ok(`RenderedDist(rs)) =>
|
| Ok(`RenderedDist(rs)) =>
|
||||||
|
// todo: Why is this here? It converts a mixed shape to a mixed shape.
|
||||||
let continuous = Distributions.Shape.T.toContinuous(rs);
|
let continuous = Distributions.Shape.T.toContinuous(rs);
|
||||||
let discrete = Distributions.Shape.T.toDiscrete(rs);
|
let discrete = Distributions.Shape.T.toDiscrete(rs);
|
||||||
let shape = MixedShapeBuilder.buildSimple(~continuous, ~discrete);
|
let shape = MixedShapeBuilder.buildSimple(~continuous, ~discrete);
|
||||||
|
|
|
@ -121,7 +121,8 @@ module Truncate = {
|
||||||
let trySimplification = (leftCutoff, rightCutoff, t): simplificationResult => {
|
let trySimplification = (leftCutoff, rightCutoff, t): simplificationResult => {
|
||||||
switch (leftCutoff, rightCutoff, t) {
|
switch (leftCutoff, rightCutoff, t) {
|
||||||
| (None, None, t) => `Solution(t)
|
| (None, None, t) => `Solution(t)
|
||||||
| (Some(lc), Some(rc), t) when lc > rc => `Error("Left truncation bound must be smaller than right bound.")
|
| (Some(lc), Some(rc), t) when lc > rc =>
|
||||||
|
`Error("Left truncation bound must be smaller than right bound.")
|
||||||
| (lc, rc, `SymbolicDist(`Uniform(u))) =>
|
| (lc, rc, `SymbolicDist(`Uniform(u))) =>
|
||||||
// just create a new Uniform distribution
|
// just create a new Uniform distribution
|
||||||
let nu: SymbolicTypes.uniform = u;
|
let nu: SymbolicTypes.uniform = u;
|
||||||
|
@ -157,10 +158,13 @@ module Truncate = {
|
||||||
: result(node, string) => {
|
: result(node, string) => {
|
||||||
t
|
t
|
||||||
|> trySimplification(leftCutoff, rightCutoff)
|
|> trySimplification(leftCutoff, rightCutoff)
|
||||||
|> fun
|
|> (
|
||||||
|
fun
|
||||||
| `Solution(t) => Ok(t)
|
| `Solution(t) => Ok(t)
|
||||||
| `Error(e) => Error(e)
|
| `Error(e) => Error(e)
|
||||||
| `NoSolution => truncateAsShape(toLeaf, renderParams, leftCutoff, rightCutoff, t);
|
| `NoSolution =>
|
||||||
|
truncateAsShape(toLeaf, renderParams, leftCutoff, rightCutoff, t)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -169,7 +173,7 @@ module Normalize = {
|
||||||
(toLeaf, renderParams, t: node): result(node, string) => {
|
(toLeaf, renderParams, t: node): result(node, string) => {
|
||||||
switch (t) {
|
switch (t) {
|
||||||
| `RenderedDist(s) =>
|
| `RenderedDist(s) =>
|
||||||
Ok(`RenderedDist(Distributions.Shape.T.normalize(s)));
|
Ok(`RenderedDist(Distributions.Shape.T.normalize(s)))
|
||||||
| `SymbolicDist(_) => Ok(t)
|
| `SymbolicDist(_) => Ok(t)
|
||||||
| _ =>
|
| _ =>
|
||||||
t
|
t
|
||||||
|
|
Loading…
Reference in New Issue
Block a user