parent
75dfb724ec
commit
2b8545ad04
|
@ -14,4 +14,16 @@ describe("Combining Continuous and Discrete Distributions", () => {
|
|||
), // Multiply distribution by -1
|
||||
true,
|
||||
)
|
||||
makeTest(
|
||||
"keep order of xs when first number is discrete and adding",
|
||||
AlgebraicShapeCombination.isOrdered(
|
||||
AlgebraicShapeCombination.combineShapesContinuousDiscrete(
|
||||
#Add,
|
||||
{xs: [0., 1.], ys: [1., 1.]},
|
||||
{xs: [1.], ys: [1.]},
|
||||
~discretePosition=First,
|
||||
),
|
||||
), // 1 + distribution
|
||||
true,
|
||||
)
|
||||
})
|
||||
|
|
|
@ -214,7 +214,7 @@ let combineShapesContinuousDiscrete = (
|
|||
// When this operation is flipped (like 1 - normal(5, 2)) then the
|
||||
// x axis coordinates would all come out the wrong order. So we need
|
||||
// to fill them out in the opposite direction
|
||||
let index = discretePosition == First ? t1n - 1 - i : i
|
||||
let index = discretePosition == First && op == #Subtract ? t1n - 1 - i : i
|
||||
Belt.Array.set(
|
||||
dxyShape,
|
||||
index,
|
||||
|
|
Loading…
Reference in New Issue
Block a user