save_lp¶
- save_lp(model: Model, filename: str | os.PathLike, allow_constant: bool = True) None¶
Save a model to an LP file.
- パラメータ:
model (Model) -- Model to write.
filename (str | os.PathLike) -- Output file path.
allow_constant (bool) -- Whether to allow a constant term in the objective function. Defaults to
True.
- 例外:
RuntimeError -- If the model is invalid for the LP format (e.g., contains degree 3 or higher, or has invalid variable names / constraint labels).