Fixed implementation

Value: [0.4 to 2]
This commit is contained in:
Quinn Dougherty 2022-04-25 21:04:11 -04:00
parent 3367b82eef
commit 5ef8cf5dde

View File

@ -244,9 +244,13 @@ module AlgebraicCombination = {
~t2: t,
): result<t, error> => {
let algebraicResult = run'(t1, ~toPointSetFn, ~toSampleSetFn, ~arithmeticOperation, ~t2)
switch mode {
| Some(_) => algebraicResult
| None => Error(RequestedModeInvalidError)
switch (mode, algebraicResult) {
| (None, _)
| (Some(AsSymbolic), Ok(Symbolic(_)))
| (Some(AsMontecarlo), Ok(DistributionTypes.SampleSet(_)))
| (Some(AsConvolution), Ok(DistributionTypes.PointSet(_)))
| (Some(_), Error(_)) => algebraicResult
| (Some(_), Ok(_)) => Error(RequestedModeInvalidError)
}
}
}