scalanlp / breeze

Breeze is/was a numerical processing library for Scala.
https://www.scalanlp.org
Apache License 2.0
3.45k stars 692 forks source link

breeze-718: remove hard coded "maximize" in LinearProgram.Problem.toString #781

Closed qxzzxq closed 4 years ago

qxzzxq commented 4 years ago

Description

This PR should close #718

Example

val lp = new LinearProgram()
import lp._

val x0 = Real()
val x1 = Real()

val min = minimize(x0 + x1)
  .subjectTo(x0 >= 20)
  .subjectTo(x1 >= 30)

println(min.toString)
// minimize    x_0 + x_1
// subject to  x_0 >= 20.0
//             x_1 >= 30.0

min.solve  // this equals to minimize(min)

maximize(min)  // this will throw an exception