lpgen

package
v0.2.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

`lpgen` package provides functions for generating linear programming models.

Index

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

func ParseLingoModel_str(modelStr string) *LPModel

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

func ParseLingoModel_txt(filePath string) *LPModel

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

func (lp *LPModel) AddBinaryVar(varName string) *LPModel

add binary var

func (*LPModel) AddBound

func (lp *LPModel) AddBound(bound string) *LPModel

add bound

func (*LPModel) AddConstraint

func (lp *LPModel) AddConstraint(constr string) *LPModel

add constraint

func (*LPModel) AddIntegerVar

func (lp *LPModel) AddIntegerVar(varName string) *LPModel

add integer var

func (*LPModel) GenerateLPFile

func (lp *LPModel) GenerateLPFile(filename string)

generate lp file

func (*LPModel) SetObjective

func (lp *LPModel) SetObjective(objType, obj string) *LPModel

set objective

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL