// SetObjFn changes the objective function. Row indices are zero-based. // See http://lpsolve.sourceforge.net/5.5/set_obj_fn.htm func (l *LP) SetObjFn(row []float64) { l.SetAddRowMode(false) cRow := make([]C.double, len(row)+1) cRow[0] = 0.0 for i := 0; i < len(row); i++ { cRow[i+1] = C.double(row[i]) } C.set_obj_fn(l.ptr, &cRow[0]) }
func (l *LP) SetObjFn(row []float64) { C.set_obj_fn(l.ptr, (*C.double)(&row[0])) }