Documentation
¶
Index ¶
- func VarTypeToGRBVType(vtype optim.VarType) (int8, error)
- type GurobiSolver
- func (gs *GurobiSolver) AddConstraint(constrIn optim.Constraint, errors ...error) error
- func (gs *GurobiSolver) AddVariable(varIn optim.Variable) error
- func (gs *GurobiSolver) AddVariables(varSliceIn []optim.Variable) error
- func (gs *GurobiSolver) CreateModel(modelName string)
- func (gs *GurobiSolver) DeleteSolver() error
- func (gs *GurobiSolver) Free()
- func (gs *GurobiSolver) FreeEnv()
- func (gs *GurobiSolver) FreeModel()
- func (gs *GurobiSolver) GetTimeLimit() (float64, error)
- func (gs *GurobiSolver) Optimize() (optim.Solution, error)
- func (gs *GurobiSolver) SetObjective(objIn optim.Objective) error
- func (gs *GurobiSolver) SetTimeLimit(limitInS float64) error
- func (gs *GurobiSolver) ShowLog(tf bool) error
- func (gs *GurobiSolver) ToGurobiLinearConstraint(constr optim.ScalarConstraint) ([]*gurobi.Var, []float64, int8, float64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GurobiSolver ¶
type GurobiSolver struct { Env *gurobi.Env CurrentModel *gurobi.Model ModelName string GoopIDToGurobiIndexMap map[uint64]int32 // Maps each Goop ID (uint64) to the idx value used for each Gurobi variable. }
func NewGurobiSolver ¶
func NewGurobiSolver(modelName string) GurobiSolver
NewGurobiSolver Description:
Create a new gurobi solver object.
func (*GurobiSolver) AddConstraint ¶
func (gs *GurobiSolver) AddConstraint(constrIn optim.Constraint, errors ...error) error
AddConstraint Description:
Adds a single constraint to the gurobi model object inside of the current GurobiSolver object.
func (*GurobiSolver) AddVariable ¶
func (gs *GurobiSolver) AddVariable(varIn optim.Variable) error
AddVariable Description:
Adds a variable to the Gurobi Model.
func (*GurobiSolver) AddVariables ¶
func (gs *GurobiSolver) AddVariables(varSliceIn []optim.Variable) error
AddVariables Description:
Adds a set of variables to the Gurobi Model.
func (*GurobiSolver) CreateModel ¶
func (gs *GurobiSolver) CreateModel(modelName string)
CreateModel Description:
func (*GurobiSolver) DeleteSolver ¶
func (gs *GurobiSolver) DeleteSolver() error
DeleteSolver Description:
Attempts to delete all info about the current solver.
func (*GurobiSolver) Free ¶
func (gs *GurobiSolver) Free()
Free Description:
Frees the Env and Model elements of the system.
func (*GurobiSolver) FreeEnv ¶
func (gs *GurobiSolver) FreeEnv()
FreeEnv Description:
Frees the Env() method. Useful after the problem is solved.
func (*GurobiSolver) FreeModel ¶
func (gs *GurobiSolver) FreeModel()
FreeModel Description
Frees the Model member. Useful after the problem is solved.
func (*GurobiSolver) GetTimeLimit ¶
func (gs *GurobiSolver) GetTimeLimit() (float64, error)
GetTimeLimit Description:
Gets the time limit of the current model in gurobi solver gs.
Input:
None
Output
limitInS = Value of time limit in seconds (float)
func (*GurobiSolver) Optimize ¶
func (gs *GurobiSolver) Optimize() (optim.Solution, error)
Optimize Description:
func (*GurobiSolver) SetObjective ¶
func (gs *GurobiSolver) SetObjective(objIn optim.Objective) error
SetObjective Description:
This algorithm should set the objective based on the value of the expression provided as input to this function.
func (*GurobiSolver) SetTimeLimit ¶
func (gs *GurobiSolver) SetTimeLimit(limitInS float64) error
SetTimeLimit Description:
Sets the time limit of the current model in gurobi solver gs.
Input:
limitInS = Value of time limit in seconds (float)
func (*GurobiSolver) ShowLog ¶
func (gs *GurobiSolver) ShowLog(tf bool) error
ShowLog Description:
Decides whether or not to print logs to the terminal?
func (*GurobiSolver) ToGurobiLinearConstraint ¶
func (gs *GurobiSolver) ToGurobiLinearConstraint(constr optim.ScalarConstraint) ( []*gurobi.Var, []float64, int8, float64, error, )
Click to show internal directories.
Click to hide internal directories.