Documentation
¶
Overview ¶
`lpgen` package provides functions for generating linear programming models.
Index ¶
- type LPModel
- func (lp *LPModel) AddBinaryVar(varName string) *LPModel
- func (lp *LPModel) AddBound(bound string) *LPModel
- func (lp *LPModel) AddConstraint(constr string) *LPModel
- func (lp *LPModel) AddIntegerVar(varName string) *LPModel
- func (lp *LPModel) GenerateLPFile(filename string)
- func (lp *LPModel) SetObjective(objType, obj string) *LPModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LPModel ¶
type LPModel struct {
Objective string // 目標函數
ObjectiveType string // 目標函數類型(Maximize or Minimize)
Constraints []string // 約束條件
Bounds []string // 變數邊界
BinaryVars []string // 二進制變數
IntegerVars []string // 整數變數
}
func NewLPModel ¶
func NewLPModel() *LPModel
func ParseLingoModel_str ¶ added in v0.0.15
ParseLingoModel_str parse lingo model from string. It turns LINGO model to standard lp model. Go to `LINGO > Generate > Display Model` in LINGO to get the model.
func ParseLingoModel_txt ¶ added in v0.0.15
ParseLingoModel_txt parse lingo model from txt file. It turns LINGO model to standard lp model. Go to `LINGO > Generate > Display Model` in LINGO to get the model.
func (*LPModel) AddBinaryVar ¶
add binary var
func (*LPModel) AddConstraint ¶
add constraint
func (*LPModel) AddIntegerVar ¶
add integer var
func (*LPModel) GenerateLPFile ¶
generate lp file
func (*LPModel) SetObjective ¶
set objective
Click to show internal directories.
Click to hide internal directories.