@@ -15,7 +15,7 @@ import Linear.Constraint.Linear.Types (LinearEquation (..))
1515import Linear.Constraint.Simple.Types (SimpleConstraint (.. ))
1616import Linear.Expr.Types (Expr (.. ), ExprVarsOnly (.. ))
1717import Linear.SlackForm.Util
18- ( addSlackVariables
18+ ( addSlackVars
1919 , eliminateNonZeroLowerBounds
2020 , eliminateUnrestrictedLowerBounds
2121 )
@@ -145,7 +145,7 @@ spec = describe "Slack Form Transformations" $ do
145145 )
146146 (Map. toList updatedBounds)
147147 it
148- " addSlackVariables correctly transforms inequalities to equalities (wikipedia case)"
148+ " addSlackVars correctly transforms inequalities to equalities (wikipedia case)"
149149 $ do
150150 let simpleSystem =
151151 SimpleSystem
@@ -160,11 +160,11 @@ spec = describe "Slack Form Transformations" $ do
160160 2 -- -x_4 + 3x_5 + x_7 = 2
161161 ]
162162 expectedSlackVars = [6 , 7 ]
163- (slackVars, updatedSystem) = addSlackVariables simpleSystem
163+ (slackVars, updatedSystem) = addSlackVars simpleSystem
164164 updatedSystem `shouldBe` expectedSystem
165165 slackVars `shouldBe` expectedSlackVars
166166 it
167- " addSlackVariables correctly transforms inequalities to equalities (test case 1)"
167+ " addSlackVars correctly transforms inequalities to equalities (test case 1)"
168168 $ do
169169 let simpleSystem =
170170 SimpleSystem
@@ -179,11 +179,11 @@ spec = describe "Slack Form Transformations" $ do
179179 3 -- -x_3 + 2x_4 - x_6 = 3
180180 ]
181181 expectedSlackVars = [5 , 6 ]
182- (slackVars, updatedSystem) = addSlackVariables simpleSystem
182+ (slackVars, updatedSystem) = addSlackVars simpleSystem
183183 updatedSystem `shouldBe` expectedSystem
184184 slackVars `shouldBe` expectedSlackVars
185185 it
186- " addSlackVariables correctly transforms inequalities to equalities (test case 2)"
186+ " addSlackVars correctly transforms inequalities to equalities (test case 2)"
187187 $ do
188188 let simpleSystem =
189189 SimpleSystem
@@ -198,11 +198,11 @@ spec = describe "Slack Form Transformations" $ do
198198 4 -- -x_3 + 2x_4 - x_6 = 4
199199 ]
200200 expectedSlackVars = [5 , 6 ]
201- (slackVars, updatedSystem) = addSlackVariables simpleSystem
201+ (slackVars, updatedSystem) = addSlackVars simpleSystem
202202 updatedSystem `shouldBe` expectedSystem
203203 slackVars `shouldBe` expectedSlackVars
204204 it
205- " addSlackVariables correctly transforms inequalities to equalities (test case 3)"
205+ " addSlackVars correctly transforms inequalities to equalities (test case 3)"
206206 $ do
207207 let simpleSystem =
208208 SimpleSystem
@@ -215,11 +215,11 @@ spec = describe "Slack Form Transformations" $ do
215215 , LinearEquation (ExprVarsOnly (CoeffTermVO (- 1 ) 3 : [CoeffTermVO 2 4 ])) 4 -- -x_3 + 2x_4 = 4
216216 ]
217217 expectedSlackVars = [5 ]
218- (slackVars, updatedSystem) = addSlackVariables simpleSystem
218+ (slackVars, updatedSystem) = addSlackVars simpleSystem
219219 updatedSystem `shouldBe` expectedSystem
220220 slackVars `shouldBe` expectedSlackVars
221221 it
222- " addSlackVariables correctly transforms inequalities to equalities (test case 4)"
222+ " addSlackVars correctly transforms inequalities to equalities (test case 4)"
223223 $ do
224224 let simpleSystem =
225225 SimpleSystem
@@ -232,7 +232,7 @@ spec = describe "Slack Form Transformations" $ do
232232 , LinearEquation (ExprVarsOnly (CoeffTermVO (- 1 ) 3 : [CoeffTermVO 2 4 ])) 4 -- -x_3 + 2x_4 = 4
233233 ]
234234 expectedSlackVars = []
235- (slackVars, updatedSystem) = addSlackVariables simpleSystem
235+ (slackVars, updatedSystem) = addSlackVars simpleSystem
236236 updatedSystem `shouldBe` expectedSystem
237237 slackVars `shouldBe` expectedSlackVars
238238 it
@@ -245,7 +245,7 @@ spec = describe "Slack Form Transformations" $ do
245245 ]
246246 systemBounds = deriveBounds simpleSystem
247247 (eliminatedNonZeroLowerBounds, systemWithoutNonZeroLowerBounds) = eliminateNonZeroLowerBounds simpleSystem Map. empty
248- (slackVars, systemWithSlackVars) = addSlackVariables systemWithoutNonZeroLowerBounds
248+ (slackVars, systemWithSlackVars) = addSlackVars systemWithoutNonZeroLowerBounds
249249 (updatedEliminatedVarsMap, updatedSystem) =
250250 eliminateUnrestrictedLowerBounds
251251 systemWithSlackVars
@@ -276,7 +276,7 @@ spec = describe "Slack Form Transformations" $ do
276276 ]
277277 systemBounds = deriveBounds simpleSystem
278278 (eliminatedNonZeroLowerBounds, systemWithoutNonZeroLowerBounds) = eliminateNonZeroLowerBounds simpleSystem Map. empty
279- (slackVars, systemWithSlackVars) = addSlackVariables systemWithoutNonZeroLowerBounds
279+ (slackVars, systemWithSlackVars) = addSlackVars systemWithoutNonZeroLowerBounds
280280 (updatedEliminatedVarsMap, updatedSystem) =
281281 eliminateUnrestrictedLowerBounds
282282 systemWithSlackVars
@@ -314,7 +314,7 @@ spec = describe "Slack Form Transformations" $ do
314314 ]
315315 systemBounds = deriveBounds simpleSystem
316316 (eliminatedNonZeroLowerBounds, systemWithoutNonZeroLowerBounds) = eliminateNonZeroLowerBounds simpleSystem Map. empty
317- (slackVars, systemWithSlackVars) = addSlackVariables systemWithoutNonZeroLowerBounds
317+ (slackVars, systemWithSlackVars) = addSlackVars systemWithoutNonZeroLowerBounds
318318 expectedSlackVars = [4 , 5 , 6 ]
319319 (updatedEliminatedVarsMap, updatedSystem) =
320320 eliminateUnrestrictedLowerBounds
@@ -355,7 +355,7 @@ spec = describe "Slack Form Transformations" $ do
355355 ]
356356 systemBounds = deriveBounds simpleSystem
357357 (eliminatedNonZeroLowerBounds, systemWithoutNonZeroLowerBounds) = eliminateNonZeroLowerBounds simpleSystem Map. empty
358- (slackVars, systemWithSlackVars) = addSlackVariables systemWithoutNonZeroLowerBounds
358+ (slackVars, systemWithSlackVars) = addSlackVars systemWithoutNonZeroLowerBounds
359359 expectedSlackVars = [3 , 4 ]
360360 (updatedEliminatedVarsMap, updatedSystem) =
361361 eliminateUnrestrictedLowerBounds
@@ -394,7 +394,7 @@ spec = describe "Slack Form Transformations" $ do
394394 ]
395395 systemBounds = deriveBounds simpleSystem
396396 (eliminatedNonZeroLowerBounds, systemWithoutNonZeroLowerBounds) = eliminateNonZeroLowerBounds simpleSystem Map. empty
397- (slackVars, systemWithSlackVars) = addSlackVariables systemWithoutNonZeroLowerBounds
397+ (slackVars, systemWithSlackVars) = addSlackVars systemWithoutNonZeroLowerBounds
398398 expectedSlackVars = [3 , 4 ]
399399 (updatedEliminatedVarsMap, updatedSystem) =
400400 eliminateUnrestrictedLowerBounds
0 commit comments