Moved floatFromDist to Fn only
This commit is contained in:
parent
c002100461
commit
c57cc3144e
|
@ -11,8 +11,6 @@ let rec toString: node => string =
|
||||||
| `VerticalScaling(scaleOp, t, scaleBy) =>
|
| `VerticalScaling(scaleOp, t, scaleBy) =>
|
||||||
Operation.Scale.format(scaleOp, toString(t), toString(scaleBy))
|
Operation.Scale.format(scaleOp, toString(t), toString(scaleBy))
|
||||||
| `Normalize(t) => "normalize(k" ++ toString(t) ++ ")"
|
| `Normalize(t) => "normalize(k" ++ toString(t) ++ ")"
|
||||||
| `FloatFromDist(floatFromDistOp, t) =>
|
|
||||||
Operation.DistToFloat.format(floatFromDistOp, toString(t))
|
|
||||||
| `Truncate(lc, rc, t) =>
|
| `Truncate(lc, rc, t) =>
|
||||||
Operation.T.truncateToString(lc, rc, toString(t))
|
Operation.T.truncateToString(lc, rc, toString(t))
|
||||||
| `Render(t) => toString(t)
|
| `Render(t) => toString(t)
|
||||||
|
|
|
@ -244,26 +244,6 @@ module Normalize = {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
module FloatFromDist = {
|
|
||||||
let rec operationToLeaf =
|
|
||||||
(evaluationParams, distToFloatOp: distToFloatOperation, t: node)
|
|
||||||
: result(node, string) => {
|
|
||||||
switch (t) {
|
|
||||||
| `SymbolicDist(s) =>
|
|
||||||
SymbolicDist.T.operate(distToFloatOp, s)
|
|
||||||
|> E.R.bind(_, v => Ok(`SymbolicDist(`Float(v))))
|
|
||||||
| `RenderedDist(rs) =>
|
|
||||||
Shape.operate(distToFloatOp, rs)
|
|
||||||
|> (v => Ok(`SymbolicDist(`Float(v))))
|
|
||||||
| _ =>
|
|
||||||
t
|
|
||||||
|> evaluateAndRetry(evaluationParams, r =>
|
|
||||||
operationToLeaf(r, distToFloatOp)
|
|
||||||
)
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO: This forces things to be floats
|
// TODO: This forces things to be floats
|
||||||
let callableFunction = (evaluationParams, name, args) => {
|
let callableFunction = (evaluationParams, name, args) => {
|
||||||
args
|
args
|
||||||
|
@ -333,8 +313,6 @@ let rec toLeaf =
|
||||||
VerticalScaling.operationToLeaf(evaluationParams, scaleOp, t, scaleBy)
|
VerticalScaling.operationToLeaf(evaluationParams, scaleOp, t, scaleBy)
|
||||||
| `Truncate(leftCutoff, rightCutoff, t) =>
|
| `Truncate(leftCutoff, rightCutoff, t) =>
|
||||||
Truncate.operationToLeaf(evaluationParams, leftCutoff, rightCutoff, t)
|
Truncate.operationToLeaf(evaluationParams, leftCutoff, rightCutoff, t)
|
||||||
| `FloatFromDist(distToFloatOp, t) =>
|
|
||||||
FloatFromDist.operationToLeaf(evaluationParams, distToFloatOp, t)
|
|
||||||
| `Normalize(t) => Normalize.operationToLeaf(evaluationParams, t)
|
| `Normalize(t) => Normalize.operationToLeaf(evaluationParams, t)
|
||||||
| `Render(t) => Render.operationToLeaf(evaluationParams, t)
|
| `Render(t) => Render.operationToLeaf(evaluationParams, t)
|
||||||
| `Hash(t) =>
|
| `Hash(t) =>
|
||||||
|
|
|
@ -29,7 +29,6 @@ module ExpressionTree = {
|
||||||
| `Normalize(node)
|
| `Normalize(node)
|
||||||
| `Render(node)
|
| `Render(node)
|
||||||
| `Truncate(option(float), option(float), node)
|
| `Truncate(option(float), option(float), node)
|
||||||
| `FloatFromDist(distToFloatOperation, node)
|
|
||||||
| `FunctionCall(string, array(node))
|
| `FunctionCall(string, array(node))
|
||||||
| `MultiModal(array((node, float)))
|
| `MultiModal(array((node, float)))
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user