func NewStandard(c mat.Vec, A *mat.Dense, b mat.Vec) *Problem { m, n := A.Dims() if len(c) != n || len(b) != m { panic("linprog: dimension mismatch") } return &Problem{ C: c, B: b, A: A, } }
func NewQuadratic(A *mat.Dense, b mat.Vec, c float64) *Quadratic { m, n := A.Dims() if m != n { panic("matrix has to be quadratic") } if n != len(b) { panic("dimension mismatch between A and b") } return &Quadratic{ A: A, B: b, C: c, temp: mat.NewVec(n), } }