Skip to content

Commit 47091d4

Browse files
committed
chore: fmt
1 parent 1ec80c3 commit 47091d4

1 file changed

Lines changed: 26 additions & 25 deletions

File tree

test/Linear/Simplex/Solver/TwoPhaseSpec.hs

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2693,50 +2693,50 @@ spec = do
26932693
\(coeff :: Rational) (oldRHS :: Rational) (shiftBy :: Rational) ->
26942694
coeff
26952695
/= 0
2696-
==> let constraint = LEQ (M.fromList [(1, coeff)]) oldRHS
2697-
LEQ _ newRHS = applyShiftToConstraint 1 10 shiftBy constraint
2698-
in newRHS == oldRHS - coeff * shiftBy
2696+
==> let constraint = LEQ (M.fromList [(1, coeff)]) oldRHS
2697+
LEQ _ newRHS = applyShiftToConstraint 1 10 shiftBy constraint
2698+
in newRHS == oldRHS - coeff * shiftBy
26992699

27002700
it "preserves constraint type (LEQ stays LEQ)" $
27012701
property $
27022702
\(coeff :: Rational) (rhs :: Rational) (shiftBy :: Rational) ->
27032703
coeff
27042704
/= 0
2705-
==> let constraint = LEQ (M.fromList [(1, coeff)]) rhs
2706-
in case applyShiftToConstraint 1 10 shiftBy constraint of
2707-
LEQ {} -> True
2708-
_ -> False
2705+
==> let constraint = LEQ (M.fromList [(1, coeff)]) rhs
2706+
in case applyShiftToConstraint 1 10 shiftBy constraint of
2707+
LEQ {} -> True
2708+
_ -> False
27092709

27102710
it "preserves constraint type (GEQ stays GEQ)" $
27112711
property $
27122712
\(coeff :: Rational) (rhs :: Rational) (shiftBy :: Rational) ->
27132713
coeff
27142714
/= 0
2715-
==> let constraint = GEQ (M.fromList [(1, coeff)]) rhs
2716-
in case applyShiftToConstraint 1 10 shiftBy constraint of
2717-
GEQ {} -> True
2718-
_ -> False
2715+
==> let constraint = GEQ (M.fromList [(1, coeff)]) rhs
2716+
in case applyShiftToConstraint 1 10 shiftBy constraint of
2717+
GEQ {} -> True
2718+
_ -> False
27192719

27202720
describe "applySplitToConstraint properties" $ do
27212721
it "preserves RHS value" $
27222722
property $
27232723
\(coeff :: Rational) (rhs :: Rational) ->
27242724
coeff
27252725
/= 0
2726-
==> let constraint = LEQ (M.fromList [(1, coeff)]) rhs
2727-
LEQ _ newRHS = applySplitToConstraint 1 10 11 constraint
2728-
in newRHS == rhs
2726+
==> let constraint = LEQ (M.fromList [(1, coeff)]) rhs
2727+
LEQ _ newRHS = applySplitToConstraint 1 10 11 constraint
2728+
in newRHS == rhs
27292729

27302730
it "negVar coefficient is negation of posVar coefficient" $
27312731
property $
27322732
\(coeff :: Rational) (rhs :: Rational) ->
27332733
coeff
27342734
/= 0
2735-
==> let constraint = LEQ (M.fromList [(1, coeff)]) rhs
2736-
LEQ m _ = applySplitToConstraint 1 10 11 constraint
2737-
posCoeff = M.findWithDefault 0 10 m
2738-
negCoeff = M.findWithDefault 0 11 m
2739-
in negCoeff == negate posCoeff
2735+
==> let constraint = LEQ (M.fromList [(1, coeff)]) rhs
2736+
LEQ m _ = applySplitToConstraint 1 10 11 constraint
2737+
posCoeff = M.findWithDefault 0 10 m
2738+
negCoeff = M.findWithDefault 0 11 m
2739+
in negCoeff == negate posCoeff
27402740

27412741
describe "unapplyTransformToVarMap Shift properties" $ do
27422742
it "recovers originalVar = shiftedVar + shiftBy" $
@@ -2779,12 +2779,13 @@ spec = do
27792779
\(origVal :: Rational) (shiftBy :: Rational) ->
27802780
shiftBy
27812781
< 0
2782-
==> let shiftedVal -- Only negative shifts are valid
2783-
= origVal - shiftBy -- shiftedVar = originalVar - shiftBy
2784-
varMap = M.fromList [(5, 100), (10, shiftedVal)]
2785-
transform = Shift 1 10 shiftBy
2786-
newVarMap = unapplyTransformToVarMap transform varMap
2787-
in M.lookup 1 newVarMap == Just origVal
2782+
==> let shiftedVal -- Only negative shifts are valid
2783+
=
2784+
origVal - shiftBy -- shiftedVar = originalVar - shiftBy
2785+
varMap = M.fromList [(5, 100), (10, shiftedVal)]
2786+
transform = Shift 1 10 shiftBy
2787+
newVarMap = unapplyTransformToVarMap transform varMap
2788+
in M.lookup 1 newVarMap == Just origVal
27882789

27892790
it "Split with posVal=origVal and negVal=0 gives correct value for positive origVal" $
27902791
property $

0 commit comments

Comments
 (0)