ortoolslp

package module
v0.0.0-...-694a6b8 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

README

ortoolslp

Go package to use the 'linear_solver' component of Google OR-Tools on Windows 10.

It enables you to solve linear programming models with GLOP, CLP, CBC, SCIP, GLPK, CPLEX and Gurobi solvers via the Google OR-Tools API on Windows. It was tested on Windows 10 with x86_64 architecture. The compilation process is quite complex because it involves C++, SWIG, C and many tools more. To simplify the use of the library, this repository only contains the minimum binaries and Go-files you need to run and develop applications with ortoolslp.

The original code stems from github.com/google/or-tools and was forked to github.com/baobabsoluciones/or-tools to work on an API that can be used with Go.

Requirements

- Go
- MinGW64 C and C++ compiler

Go is not compatible with Microsoft compilers. If you don't have a MinGW64 C and C++ compiler installed already, we recommend the "TDM64 bundle". Download the "TDM64 bundle" here or via the official website.

Installation

Install the ortoolslp package by running

go get -u github.com/baobabsoluciones/ortoolslp

This command will install ortoolslp in your GOPATH and you can use it in your Go program by writing

import "github.com/baobabsoluciones/ortoolslp"

Now you can compile any program that uses the package. Running it requires one more step. In the repository, now in your GOPATH, there is a DLL that the program needs to start. On your system you can probably find it under

C:\Users\YourUserName\go\src\github.com\baobabsoluciones\ortoolslp\_gowraplp.dll

This DLL contains all the code to solve models with GLOP, CBC and CLP. Additionally in the same directory you will find a DLL named glpk*.dll where the star is a version number. You need this DLL aswell if you intend to use the GLPK solver. The necessary DLLs for CPLEX, Gurobi and SCIP are not included because those are proprietary and require a license. This version of ortoolslp was linked to cplex1290.dll, gurobi81.dll, scip.dll and glpk_4_65.dll. Since they are only delay-loaded you don't need these DLLs as long as you don't try to use the respective solvers.

You need to put at least _gowraplp.dll in a place where Windows can find it. Windows searches your system in all directories given in the Path environment variable and in the directory where you placed your programs EXE file. It is up to you where you copy the DLLs you need, it doesn't matter. The installers of Gurobi, CPLEX and SCIP update your Path automatically. If you install your compiled program on a customers system, you can put the EXE and the DLLs in the same directory. This will work with all solvers except Gurobi, it has a more complicated licensing mechanism and it is recommended to use th installer on every system you need Gurobi. On your own development system, maybe you have multiple programs that need these DLLs, then you only want to copy it into one place that is in your Path. A good place is

C:\Users\YourUserName\go\bin

Editing system environment variables on Windows is explained here.

Examples

After the installation you may run the examples in the directory examples.

Troubleshooting

_gowraplp.dll, cplex1290.dll, scip.dll and gurobi81.dll depend on DLLs that are commonly included on most Windows installations today.

If you get errors that mention ucrtbase.dll or MSVCP140.dll you should either update your Windows system or install "Microsoft Visual C++ 2015 Redistributable Update 3 RC".

Documentation

Overview

This file adds all the necessary cgo directives that enable the user to build and run the linear_solver package without modifying his environment variables etc.

Index

Constants

This section is empty.

Variables

View Source
var Swig_escape_always_false bool
View Source
var Swig_escape_val interface{}

Functions

func DeleteConstraint

func DeleteConstraint(arg1 Constraint)

func DeleteFloat32Vector

func DeleteFloat32Vector(arg1 Float32Vector)

func DeleteFloat64Vector

func DeleteFloat64Vector(arg1 Float64Vector)

func DeleteIntVector

func DeleteIntVector(arg1 IntVector)

func DeleteMPSolverParameters

func DeleteMPSolverParameters(arg1 MPSolverParameters)

func DeleteModelExportOptions

func DeleteModelExportOptions(arg1 ModelExportOptions)

func DeleteObjective

func DeleteObjective(arg1 Objective)

func DeleteSolver

func DeleteSolver(arg1 Solver)

func DeleteStringVector

func DeleteStringVector(arg1 StringVector)

func DeleteVariable

func DeleteVariable(arg1 Variable)

func ExportModelAsLpFormat

func ExportModelAsLpFormat(a ...interface{}) string

func ExportModelAsLpFormat__SWIG_0

func ExportModelAsLpFormat__SWIG_0(arg1 Operations_research_MPModelProto, arg2 ModelExportOptions) (_swig_ret string)

func ExportModelAsLpFormat__SWIG_1

func ExportModelAsLpFormat__SWIG_1(arg1 Operations_research_MPModelProto) (_swig_ret string)

func ExportModelAsMpsFormat

func ExportModelAsMpsFormat(a ...interface{}) string

func ExportModelAsMpsFormat__SWIG_0

func ExportModelAsMpsFormat__SWIG_0(arg1 Operations_research_MPModelProto, arg2 ModelExportOptions) (_swig_ret string)

func ExportModelAsMpsFormat__SWIG_1

func ExportModelAsMpsFormat__SWIG_1(arg1 Operations_research_MPModelProto) (_swig_ret string)

func GetMPSolverParametersKDefaultDualTolerance

func GetMPSolverParametersKDefaultDualTolerance() (_swig_ret float64)

func GetMPSolverParametersKDefaultPrimalTolerance

func GetMPSolverParametersKDefaultPrimalTolerance() (_swig_ret float64)

func GetMPSolverParametersKDefaultRelativeMipGap

func GetMPSolverParametersKDefaultRelativeMipGap() (_swig_ret float64)

func SolverInfinity

func SolverInfinity() (_swig_ret float64)

func SolverSupportsProblemType

func SolverSupportsProblemType(arg1 Operations_researchMPSolverOptimizationProblemType) (_swig_ret bool)

func Swig_free

func Swig_free(arg1 uintptr)

func Swig_malloc

func Swig_malloc(arg1 int) (_swig_ret uintptr)

Types

type Constraint

type Constraint interface {
	Swigcptr() uintptr
	SwigIsConstraint()
	Name() (_swig_ret string)
	SetCoefficient(arg2 Variable, arg3 float64)
	GetCoefficient(arg2 Variable) (_swig_ret float64)
	Lb() (_swig_ret float64)
	Ub() (_swig_ret float64)
	SetBounds(arg2 float64, arg3 float64)
	Set_is_lazy(arg2 bool)
	Index() (_swig_ret int)
	Dual_value() (_swig_ret float64)
	Basis_status() (_swig_ret Operations_researchMPSolverBasisStatus)
}

type Float32Vector

type Float32Vector interface {
	Swigcptr() uintptr
	SwigIsFloat32Vector()
	Size() (_swig_ret int64)
	Capacity() (_swig_ret int64)
	Reserve(arg2 int64)
	IsEmpty() (_swig_ret bool)
	Clear()
	Add(arg2 float32)
	Get(arg2 int) (_swig_ret float32)
	Set(arg2 int, arg3 float32)
}

func NewFloat32Vector

func NewFloat32Vector(a ...interface{}) Float32Vector

func NewFloat32Vector__SWIG_0

func NewFloat32Vector__SWIG_0() (_swig_ret Float32Vector)

func NewFloat32Vector__SWIG_1

func NewFloat32Vector__SWIG_1(arg1 int64) (_swig_ret Float32Vector)

func NewFloat32Vector__SWIG_2

func NewFloat32Vector__SWIG_2(arg1 Float32Vector) (_swig_ret Float32Vector)

type Float64Vector

type Float64Vector interface {
	Swigcptr() uintptr
	SwigIsFloat64Vector()
	Size() (_swig_ret int64)
	Capacity() (_swig_ret int64)
	Reserve(arg2 int64)
	IsEmpty() (_swig_ret bool)
	Clear()
	Add(arg2 float64)
	Get(arg2 int) (_swig_ret float64)
	Set(arg2 int, arg3 float64)
}

func NewFloat64Vector

func NewFloat64Vector(a ...interface{}) Float64Vector

func NewFloat64Vector__SWIG_0

func NewFloat64Vector__SWIG_0() (_swig_ret Float64Vector)

func NewFloat64Vector__SWIG_1

func NewFloat64Vector__SWIG_1(arg1 int64) (_swig_ret Float64Vector)

func NewFloat64Vector__SWIG_2

func NewFloat64Vector__SWIG_2(arg1 Float64Vector) (_swig_ret Float64Vector)

type IntVector

type IntVector interface {
	Swigcptr() uintptr
	SwigIsIntVector()
	Size() (_swig_ret int64)
	Capacity() (_swig_ret int64)
	Reserve(arg2 int64)
	IsEmpty() (_swig_ret bool)
	Clear()
	Add(arg2 int)
	Get(arg2 int) (_swig_ret int)
	Set(arg2 int, arg3 int)
}

func NewIntVector

func NewIntVector(a ...interface{}) IntVector

func NewIntVector__SWIG_0

func NewIntVector__SWIG_0() (_swig_ret IntVector)

func NewIntVector__SWIG_1

func NewIntVector__SWIG_1(arg1 int64) (_swig_ret IntVector)

func NewIntVector__SWIG_2

func NewIntVector__SWIG_2(arg1 IntVector) (_swig_ret IntVector)

type MPSolverParameters

type MPSolverParameters interface {
	Swigcptr() uintptr
	SwigIsMPSolverParameters()
	SetDoubleParam(arg2 Operations_researchMPSolverParametersDoubleParam, arg3 float64)
	SetIntegerParam(arg2 Operations_researchMPSolverParametersIntegerParam, arg3 int)
	GetDoubleParam(arg2 Operations_researchMPSolverParametersDoubleParam) (_swig_ret float64)
	GetIntegerParam(arg2 Operations_researchMPSolverParametersIntegerParam) (_swig_ret int)
}

func NewMPSolverParameters

func NewMPSolverParameters() (_swig_ret MPSolverParameters)

type ModelExportOptions

type ModelExportOptions interface {
	Swigcptr() uintptr
	SwigIsModelExportOptions()
}

func NewModelExportOptions

func NewModelExportOptions() (_swig_ret ModelExportOptions)

type Objective

type Objective interface {
	Swigcptr() uintptr
	SwigIsObjective()
	Clear()
	SetCoefficient(arg2 Variable, arg3 float64)
	GetCoefficient(arg2 Variable) (_swig_ret float64)
	SetOffset(arg2 float64)
	Offset() (_swig_ret float64)
	SetOptimizationDirection(arg2 bool)
	SetMinimization()
	SetMaximization()
	Maximization() (_swig_ret bool)
	Minimization() (_swig_ret bool)
	Value() (_swig_ret float64)
	BestBound() (_swig_ret float64)
}

type Operations_researchMPSolverBasisStatus

type Operations_researchMPSolverBasisStatus int
var SolverAT_LOWER_BOUND Operations_researchMPSolverBasisStatus = _swig_getSolver_AT_LOWER_BOUND_Solver()
var SolverAT_UPPER_BOUND Operations_researchMPSolverBasisStatus = _swig_getSolver_AT_UPPER_BOUND_Solver()
var SolverBASIC Operations_researchMPSolverBasisStatus = _swig_getSolver_BASIC_Solver()
var SolverFIXED_VALUE Operations_researchMPSolverBasisStatus = _swig_getSolver_FIXED_VALUE_Solver()
var SolverFREE Operations_researchMPSolverBasisStatus = _swig_getSolver_FREE_Solver()

type Operations_researchMPSolverOptimizationProblemType

type Operations_researchMPSolverOptimizationProblemType int
var SolverBOP_INTEGER_PROGRAMMING Operations_researchMPSolverOptimizationProblemType = _swig_getSolver_BOP_INTEGER_PROGRAMMING_Solver()
var SolverCBC_MIXED_INTEGER_PROGRAMMING Operations_researchMPSolverOptimizationProblemType = _swig_getSolver_CBC_MIXED_INTEGER_PROGRAMMING_Solver()
var SolverCLP_LINEAR_PROGRAMMING Operations_researchMPSolverOptimizationProblemType = _swig_getSolver_CLP_LINEAR_PROGRAMMING_Solver()
var SolverCPLEX_LINEAR_PROGRAMMING Operations_researchMPSolverOptimizationProblemType = _swig_getSolver_CPLEX_LINEAR_PROGRAMMING_Solver()
var SolverCPLEX_MIXED_INTEGER_PROGRAMMING Operations_researchMPSolverOptimizationProblemType = _swig_getSolver_CPLEX_MIXED_INTEGER_PROGRAMMING_Solver()
var SolverGLOP_LINEAR_PROGRAMMING Operations_researchMPSolverOptimizationProblemType = _swig_getSolver_GLOP_LINEAR_PROGRAMMING_Solver()
var SolverGLPK_LINEAR_PROGRAMMING Operations_researchMPSolverOptimizationProblemType = _swig_getSolver_GLPK_LINEAR_PROGRAMMING_Solver()
var SolverGLPK_MIXED_INTEGER_PROGRAMMING Operations_researchMPSolverOptimizationProblemType = _swig_getSolver_GLPK_MIXED_INTEGER_PROGRAMMING_Solver()
var SolverGUROBI_LINEAR_PROGRAMMING Operations_researchMPSolverOptimizationProblemType = _swig_getSolver_GUROBI_LINEAR_PROGRAMMING_Solver()
var SolverGUROBI_MIXED_INTEGER_PROGRAMMING Operations_researchMPSolverOptimizationProblemType = _swig_getSolver_GUROBI_MIXED_INTEGER_PROGRAMMING_Solver()
var SolverSCIP_MIXED_INTEGER_PROGRAMMING Operations_researchMPSolverOptimizationProblemType = _swig_getSolver_SCIP_MIXED_INTEGER_PROGRAMMING_Solver()

type Operations_researchMPSolverParametersDoubleParam

type Operations_researchMPSolverParametersDoubleParam int
var MPSolverParametersDUAL_TOLERANCE Operations_researchMPSolverParametersDoubleParam = _swig_getMPSolverParameters_DUAL_TOLERANCE_MPSolverParameters()
var MPSolverParametersPRIMAL_TOLERANCE Operations_researchMPSolverParametersDoubleParam = _swig_getMPSolverParameters_PRIMAL_TOLERANCE_MPSolverParameters()
var MPSolverParametersRELATIVE_MIP_GAP Operations_researchMPSolverParametersDoubleParam = _swig_getMPSolverParameters_RELATIVE_MIP_GAP_MPSolverParameters()

type Operations_researchMPSolverParametersIncrementalityValues

type Operations_researchMPSolverParametersIncrementalityValues int
var MPSolverParametersINCREMENTALITY_OFF Operations_researchMPSolverParametersIncrementalityValues = _swig_getMPSolverParameters_INCREMENTALITY_OFF_MPSolverParameters()
var MPSolverParametersINCREMENTALITY_ON Operations_researchMPSolverParametersIncrementalityValues = _swig_getMPSolverParameters_INCREMENTALITY_ON_MPSolverParameters()

func GetMPSolverParametersKDefaultIncrementality

func GetMPSolverParametersKDefaultIncrementality() (_swig_ret Operations_researchMPSolverParametersIncrementalityValues)

type Operations_researchMPSolverParametersIntegerParam

type Operations_researchMPSolverParametersIntegerParam int
var MPSolverParametersINCREMENTALITY Operations_researchMPSolverParametersIntegerParam = _swig_getMPSolverParameters_INCREMENTALITY_MPSolverParameters()
var MPSolverParametersLP_ALGORITHM Operations_researchMPSolverParametersIntegerParam = _swig_getMPSolverParameters_LP_ALGORITHM_MPSolverParameters()
var MPSolverParametersPRESOLVE Operations_researchMPSolverParametersIntegerParam = _swig_getMPSolverParameters_PRESOLVE_MPSolverParameters()
var MPSolverParametersSCALING Operations_researchMPSolverParametersIntegerParam = _swig_getMPSolverParameters_SCALING_MPSolverParameters()

type Operations_researchMPSolverParametersLpAlgorithmValues

type Operations_researchMPSolverParametersLpAlgorithmValues int
var MPSolverParametersBARRIER Operations_researchMPSolverParametersLpAlgorithmValues = _swig_getMPSolverParameters_BARRIER_MPSolverParameters()
var MPSolverParametersDUAL Operations_researchMPSolverParametersLpAlgorithmValues = _swig_getMPSolverParameters_DUAL_MPSolverParameters()
var MPSolverParametersPRIMAL Operations_researchMPSolverParametersLpAlgorithmValues = _swig_getMPSolverParameters_PRIMAL_MPSolverParameters()

type Operations_researchMPSolverParametersPresolveValues

type Operations_researchMPSolverParametersPresolveValues int
var MPSolverParametersPRESOLVE_OFF Operations_researchMPSolverParametersPresolveValues = _swig_getMPSolverParameters_PRESOLVE_OFF_MPSolverParameters()
var MPSolverParametersPRESOLVE_ON Operations_researchMPSolverParametersPresolveValues = _swig_getMPSolverParameters_PRESOLVE_ON_MPSolverParameters()

func GetMPSolverParametersKDefaultPresolve

func GetMPSolverParametersKDefaultPresolve() (_swig_ret Operations_researchMPSolverParametersPresolveValues)

type Operations_researchMPSolverParametersScalingValues

type Operations_researchMPSolverParametersScalingValues int
var MPSolverParametersSCALING_OFF Operations_researchMPSolverParametersScalingValues = _swig_getMPSolverParameters_SCALING_OFF_MPSolverParameters()
var MPSolverParametersSCALING_ON Operations_researchMPSolverParametersScalingValues = _swig_getMPSolverParameters_SCALING_ON_MPSolverParameters()

type Operations_researchMPSolverResultStatus

type Operations_researchMPSolverResultStatus int
var SolverABNORMAL Operations_researchMPSolverResultStatus = _swig_getSolver_ABNORMAL_Solver()
var SolverFEASIBLE Operations_researchMPSolverResultStatus = _swig_getSolver_FEASIBLE_Solver()
var SolverINFEASIBLE Operations_researchMPSolverResultStatus = _swig_getSolver_INFEASIBLE_Solver()
var SolverNOT_SOLVED Operations_researchMPSolverResultStatus = _swig_getSolver_NOT_SOLVED_Solver()
var SolverOPTIMAL Operations_researchMPSolverResultStatus = _swig_getSolver_OPTIMAL_Solver()
var SolverUNBOUNDED Operations_researchMPSolverResultStatus = _swig_getSolver_UNBOUNDED_Solver()

type Operations_research_MPModelProto

type Operations_research_MPModelProto interface {
	Swigcptr() uintptr
}

type Operations_research_MPModelRequest

type Operations_research_MPModelRequest interface {
	Swigcptr() uintptr
}

type Operations_research_MPSolutionResponse

type Operations_research_MPSolutionResponse interface {
	Swigcptr() uintptr
}

type Solver

type Solver interface {
	Swigcptr() uintptr
	SwigIsSolver()
	Clear()
	NumVariables() (_swig_ret int)
	Variables() (_swig_ret Std_vector_Sl_operations_research_MPVariable_Sm__Sg_)
	LookupVariable(arg2 string) (_swig_ret Variable)
	Var(arg2 float64, arg3 float64, arg4 bool, arg5 string) (_swig_ret Variable)
	NumVar(arg2 float64, arg3 float64, arg4 string) (_swig_ret Variable)
	IntVar(arg2 float64, arg3 float64, arg4 string) (_swig_ret Variable)
	BoolVar(arg2 string) (_swig_ret Variable)
	NumConstraints() (_swig_ret int)
	Constraints() (_swig_ret Std_vector_Sl_operations_research_MPConstraint_Sm__Sg_)
	LookupConstraint(arg2 string) (_swig_ret Constraint)
	Constraint(a ...interface{}) Constraint
	Objective() (_swig_ret Objective)
	Solve(a ...interface{}) Operations_researchMPSolverResultStatus
	ComputeConstraintActivities() (_swig_ret Float64Vector)
	VerifySolution(arg2 float64, arg3 bool) (_swig_ret bool)
	InterruptSolve() (_swig_ret bool)
	FillSolutionResponseProto(arg2 Operations_research_MPSolutionResponse)
	ExportModelToProto(arg2 Operations_research_MPModelProto)
	LoadSolutionFromProto(a ...interface{}) Util_Status
	SetSolverSpecificParametersAsString(arg2 string) (_swig_ret bool)
	EnableOutput()
	SuppressOutput()
	Iterations() (_swig_ret int64)
	Nodes() (_swig_ret int64)
	ComputeExactConditionNumber() (_swig_ret float64)
	NextSolution() (_swig_ret bool)
	Set_time_limit(arg2 int64)
	Wall_time() (_swig_ret int64)
}

func NewSolver

func NewSolver(arg1 string, arg2 Operations_researchMPSolverOptimizationProblemType) (_swig_ret Solver)

type Std_vector_Sl_operations_research_MPConstraint_Sm__Sg_

type Std_vector_Sl_operations_research_MPConstraint_Sm__Sg_ interface {
	Swigcptr() uintptr
}

type Std_vector_Sl_operations_research_MPVariable_Sm__Sg_

type Std_vector_Sl_operations_research_MPVariable_Sm__Sg_ interface {
	Swigcptr() uintptr
}

type StringVector

type StringVector interface {
	Swigcptr() uintptr
	SwigIsStringVector()
	Size() (_swig_ret int64)
	Capacity() (_swig_ret int64)
	Reserve(arg2 int64)
	IsEmpty() (_swig_ret bool)
	Clear()
	Add(arg2 string)
	Get(arg2 int) (_swig_ret string)
	Set(arg2 int, arg3 string)
}

func NewStringVector

func NewStringVector(a ...interface{}) StringVector

func NewStringVector__SWIG_0

func NewStringVector__SWIG_0() (_swig_ret StringVector)

func NewStringVector__SWIG_1

func NewStringVector__SWIG_1(arg1 int64) (_swig_ret StringVector)

func NewStringVector__SWIG_2

func NewStringVector__SWIG_2(arg1 StringVector) (_swig_ret StringVector)

type SwigcptrConstraint

type SwigcptrConstraint uintptr

func (SwigcptrConstraint) Basis_status

func (arg1 SwigcptrConstraint) Basis_status() (_swig_ret Operations_researchMPSolverBasisStatus)

func (SwigcptrConstraint) Dual_value

func (arg1 SwigcptrConstraint) Dual_value() (_swig_ret float64)

func (SwigcptrConstraint) GetCoefficient

func (arg1 SwigcptrConstraint) GetCoefficient(arg2 Variable) (_swig_ret float64)

func (SwigcptrConstraint) Index

func (arg1 SwigcptrConstraint) Index() (_swig_ret int)

func (SwigcptrConstraint) Lb

func (arg1 SwigcptrConstraint) Lb() (_swig_ret float64)

func (SwigcptrConstraint) Name

func (arg1 SwigcptrConstraint) Name() (_swig_ret string)

func (SwigcptrConstraint) SetBounds

func (arg1 SwigcptrConstraint) SetBounds(arg2 float64, arg3 float64)

func (SwigcptrConstraint) SetCoefficient

func (arg1 SwigcptrConstraint) SetCoefficient(arg2 Variable, arg3 float64)

func (SwigcptrConstraint) Set_is_lazy

func (arg1 SwigcptrConstraint) Set_is_lazy(arg2 bool)

func (SwigcptrConstraint) SwigIsConstraint

func (p SwigcptrConstraint) SwigIsConstraint()

func (SwigcptrConstraint) Swigcptr

func (p SwigcptrConstraint) Swigcptr() uintptr

func (SwigcptrConstraint) Ub

func (arg1 SwigcptrConstraint) Ub() (_swig_ret float64)

type SwigcptrFloat32Vector

type SwigcptrFloat32Vector uintptr

func (SwigcptrFloat32Vector) Add

func (arg1 SwigcptrFloat32Vector) Add(arg2 float32)

func (SwigcptrFloat32Vector) Capacity

func (arg1 SwigcptrFloat32Vector) Capacity() (_swig_ret int64)

func (SwigcptrFloat32Vector) Clear

func (arg1 SwigcptrFloat32Vector) Clear()

func (SwigcptrFloat32Vector) Get

func (arg1 SwigcptrFloat32Vector) Get(arg2 int) (_swig_ret float32)

func (SwigcptrFloat32Vector) IsEmpty

func (arg1 SwigcptrFloat32Vector) IsEmpty() (_swig_ret bool)

func (SwigcptrFloat32Vector) Reserve

func (arg1 SwigcptrFloat32Vector) Reserve(arg2 int64)

func (SwigcptrFloat32Vector) Set

func (arg1 SwigcptrFloat32Vector) Set(arg2 int, arg3 float32)

func (SwigcptrFloat32Vector) Size

func (arg1 SwigcptrFloat32Vector) Size() (_swig_ret int64)

func (SwigcptrFloat32Vector) SwigIsFloat32Vector

func (p SwigcptrFloat32Vector) SwigIsFloat32Vector()

func (SwigcptrFloat32Vector) Swigcptr

func (p SwigcptrFloat32Vector) Swigcptr() uintptr

type SwigcptrFloat64Vector

type SwigcptrFloat64Vector uintptr

func (SwigcptrFloat64Vector) Add

func (arg1 SwigcptrFloat64Vector) Add(arg2 float64)

func (SwigcptrFloat64Vector) Capacity

func (arg1 SwigcptrFloat64Vector) Capacity() (_swig_ret int64)

func (SwigcptrFloat64Vector) Clear

func (arg1 SwigcptrFloat64Vector) Clear()

func (SwigcptrFloat64Vector) Get

func (arg1 SwigcptrFloat64Vector) Get(arg2 int) (_swig_ret float64)

func (SwigcptrFloat64Vector) IsEmpty

func (arg1 SwigcptrFloat64Vector) IsEmpty() (_swig_ret bool)

func (SwigcptrFloat64Vector) Reserve

func (arg1 SwigcptrFloat64Vector) Reserve(arg2 int64)

func (SwigcptrFloat64Vector) Set

func (arg1 SwigcptrFloat64Vector) Set(arg2 int, arg3 float64)

func (SwigcptrFloat64Vector) Size

func (arg1 SwigcptrFloat64Vector) Size() (_swig_ret int64)

func (SwigcptrFloat64Vector) SwigIsFloat64Vector

func (p SwigcptrFloat64Vector) SwigIsFloat64Vector()

func (SwigcptrFloat64Vector) Swigcptr

func (p SwigcptrFloat64Vector) Swigcptr() uintptr

type SwigcptrIntVector

type SwigcptrIntVector uintptr

func (SwigcptrIntVector) Add

func (arg1 SwigcptrIntVector) Add(arg2 int)

func (SwigcptrIntVector) Capacity

func (arg1 SwigcptrIntVector) Capacity() (_swig_ret int64)

func (SwigcptrIntVector) Clear

func (arg1 SwigcptrIntVector) Clear()

func (SwigcptrIntVector) Get

func (arg1 SwigcptrIntVector) Get(arg2 int) (_swig_ret int)

func (SwigcptrIntVector) IsEmpty

func (arg1 SwigcptrIntVector) IsEmpty() (_swig_ret bool)

func (SwigcptrIntVector) Reserve

func (arg1 SwigcptrIntVector) Reserve(arg2 int64)

func (SwigcptrIntVector) Set

func (arg1 SwigcptrIntVector) Set(arg2 int, arg3 int)

func (SwigcptrIntVector) Size

func (arg1 SwigcptrIntVector) Size() (_swig_ret int64)

func (SwigcptrIntVector) SwigIsIntVector

func (p SwigcptrIntVector) SwigIsIntVector()

func (SwigcptrIntVector) Swigcptr

func (p SwigcptrIntVector) Swigcptr() uintptr

type SwigcptrMPSolverParameters

type SwigcptrMPSolverParameters uintptr

func (SwigcptrMPSolverParameters) GetDoubleParam

func (SwigcptrMPSolverParameters) GetIntegerParam

func (SwigcptrMPSolverParameters) SetDoubleParam

func (SwigcptrMPSolverParameters) SetIntegerParam

func (SwigcptrMPSolverParameters) SwigIsMPSolverParameters

func (p SwigcptrMPSolverParameters) SwigIsMPSolverParameters()

func (SwigcptrMPSolverParameters) Swigcptr

func (p SwigcptrMPSolverParameters) Swigcptr() uintptr

type SwigcptrModelExportOptions

type SwigcptrModelExportOptions uintptr

func (SwigcptrModelExportOptions) SwigIsModelExportOptions

func (p SwigcptrModelExportOptions) SwigIsModelExportOptions()

func (SwigcptrModelExportOptions) Swigcptr

func (p SwigcptrModelExportOptions) Swigcptr() uintptr

type SwigcptrObjective

type SwigcptrObjective uintptr

func (SwigcptrObjective) BestBound

func (arg1 SwigcptrObjective) BestBound() (_swig_ret float64)

func (SwigcptrObjective) Clear

func (arg1 SwigcptrObjective) Clear()

func (SwigcptrObjective) GetCoefficient

func (arg1 SwigcptrObjective) GetCoefficient(arg2 Variable) (_swig_ret float64)

func (SwigcptrObjective) Maximization

func (arg1 SwigcptrObjective) Maximization() (_swig_ret bool)

func (SwigcptrObjective) Minimization

func (arg1 SwigcptrObjective) Minimization() (_swig_ret bool)

func (SwigcptrObjective) Offset

func (arg1 SwigcptrObjective) Offset() (_swig_ret float64)

func (SwigcptrObjective) SetCoefficient

func (arg1 SwigcptrObjective) SetCoefficient(arg2 Variable, arg3 float64)

func (SwigcptrObjective) SetMaximization

func (arg1 SwigcptrObjective) SetMaximization()

func (SwigcptrObjective) SetMinimization

func (arg1 SwigcptrObjective) SetMinimization()

func (SwigcptrObjective) SetOffset

func (arg1 SwigcptrObjective) SetOffset(arg2 float64)

func (SwigcptrObjective) SetOptimizationDirection

func (arg1 SwigcptrObjective) SetOptimizationDirection(arg2 bool)

func (SwigcptrObjective) SwigIsObjective

func (p SwigcptrObjective) SwigIsObjective()

func (SwigcptrObjective) Swigcptr

func (p SwigcptrObjective) Swigcptr() uintptr

func (SwigcptrObjective) Value

func (arg1 SwigcptrObjective) Value() (_swig_ret float64)

type SwigcptrOperations_research_MPModelProto

type SwigcptrOperations_research_MPModelProto uintptr

func (SwigcptrOperations_research_MPModelProto) Swigcptr

type SwigcptrOperations_research_MPModelRequest

type SwigcptrOperations_research_MPModelRequest uintptr

func (SwigcptrOperations_research_MPModelRequest) Swigcptr

type SwigcptrOperations_research_MPSolutionResponse

type SwigcptrOperations_research_MPSolutionResponse uintptr

func (SwigcptrOperations_research_MPSolutionResponse) Swigcptr

type SwigcptrSolver

type SwigcptrSolver uintptr

func (SwigcptrSolver) BoolVar

func (arg1 SwigcptrSolver) BoolVar(arg2 string) (_swig_ret Variable)

func (SwigcptrSolver) Clear

func (arg1 SwigcptrSolver) Clear()

func (SwigcptrSolver) ComputeConstraintActivities

func (arg1 SwigcptrSolver) ComputeConstraintActivities() (_swig_ret Float64Vector)

func (SwigcptrSolver) ComputeExactConditionNumber

func (arg1 SwigcptrSolver) ComputeExactConditionNumber() (_swig_ret float64)

func (SwigcptrSolver) Constraint

func (p SwigcptrSolver) Constraint(a ...interface{}) Constraint

func (SwigcptrSolver) Constraint__SWIG_0

func (arg1 SwigcptrSolver) Constraint__SWIG_0(arg2 float64, arg3 float64) (_swig_ret Constraint)

func (SwigcptrSolver) Constraint__SWIG_1

func (arg1 SwigcptrSolver) Constraint__SWIG_1() (_swig_ret Constraint)

func (SwigcptrSolver) Constraint__SWIG_2

func (arg1 SwigcptrSolver) Constraint__SWIG_2(arg2 float64, arg3 float64, arg4 string) (_swig_ret Constraint)

func (SwigcptrSolver) Constraint__SWIG_3

func (arg1 SwigcptrSolver) Constraint__SWIG_3(arg2 string) (_swig_ret Constraint)

func (SwigcptrSolver) Constraints

func (SwigcptrSolver) EnableOutput

func (arg1 SwigcptrSolver) EnableOutput()

func (SwigcptrSolver) ExportModelToProto

func (arg1 SwigcptrSolver) ExportModelToProto(arg2 Operations_research_MPModelProto)

func (SwigcptrSolver) FillSolutionResponseProto

func (arg1 SwigcptrSolver) FillSolutionResponseProto(arg2 Operations_research_MPSolutionResponse)

func (SwigcptrSolver) IntVar

func (arg1 SwigcptrSolver) IntVar(arg2 float64, arg3 float64, arg4 string) (_swig_ret Variable)

func (SwigcptrSolver) InterruptSolve

func (arg1 SwigcptrSolver) InterruptSolve() (_swig_ret bool)

func (SwigcptrSolver) Iterations

func (arg1 SwigcptrSolver) Iterations() (_swig_ret int64)

func (SwigcptrSolver) LoadSolutionFromProto

func (p SwigcptrSolver) LoadSolutionFromProto(a ...interface{}) Util_Status

func (SwigcptrSolver) LoadSolutionFromProto__SWIG_0

func (arg1 SwigcptrSolver) LoadSolutionFromProto__SWIG_0(arg2 Operations_research_MPSolutionResponse, arg3 float64) (_swig_ret Util_Status)

func (SwigcptrSolver) LoadSolutionFromProto__SWIG_1

func (arg1 SwigcptrSolver) LoadSolutionFromProto__SWIG_1(arg2 Operations_research_MPSolutionResponse) (_swig_ret Util_Status)

func (SwigcptrSolver) LookupConstraint

func (arg1 SwigcptrSolver) LookupConstraint(arg2 string) (_swig_ret Constraint)

func (SwigcptrSolver) LookupVariable

func (arg1 SwigcptrSolver) LookupVariable(arg2 string) (_swig_ret Variable)

func (SwigcptrSolver) NextSolution

func (arg1 SwigcptrSolver) NextSolution() (_swig_ret bool)

func (SwigcptrSolver) Nodes

func (arg1 SwigcptrSolver) Nodes() (_swig_ret int64)

func (SwigcptrSolver) NumConstraints

func (arg1 SwigcptrSolver) NumConstraints() (_swig_ret int)

func (SwigcptrSolver) NumVar

func (arg1 SwigcptrSolver) NumVar(arg2 float64, arg3 float64, arg4 string) (_swig_ret Variable)

func (SwigcptrSolver) NumVariables

func (arg1 SwigcptrSolver) NumVariables() (_swig_ret int)

func (SwigcptrSolver) Objective

func (arg1 SwigcptrSolver) Objective() (_swig_ret Objective)

func (SwigcptrSolver) SetSolverSpecificParametersAsString

func (arg1 SwigcptrSolver) SetSolverSpecificParametersAsString(arg2 string) (_swig_ret bool)

func (SwigcptrSolver) Set_time_limit

func (arg1 SwigcptrSolver) Set_time_limit(arg2 int64)

func (SwigcptrSolver) Solve

func (p SwigcptrSolver) Solve(a ...interface{}) Operations_researchMPSolverResultStatus

func (SwigcptrSolver) Solve__SWIG_0

func (arg1 SwigcptrSolver) Solve__SWIG_0() (_swig_ret Operations_researchMPSolverResultStatus)

func (SwigcptrSolver) Solve__SWIG_1

func (arg1 SwigcptrSolver) Solve__SWIG_1(arg2 MPSolverParameters) (_swig_ret Operations_researchMPSolverResultStatus)

func (SwigcptrSolver) SuppressOutput

func (arg1 SwigcptrSolver) SuppressOutput()

func (SwigcptrSolver) SwigIsSolver

func (p SwigcptrSolver) SwigIsSolver()

func (SwigcptrSolver) Swigcptr

func (p SwigcptrSolver) Swigcptr() uintptr

func (SwigcptrSolver) Var

func (arg1 SwigcptrSolver) Var(arg2 float64, arg3 float64, arg4 bool, arg5 string) (_swig_ret Variable)

func (SwigcptrSolver) Variables

func (SwigcptrSolver) VerifySolution

func (arg1 SwigcptrSolver) VerifySolution(arg2 float64, arg3 bool) (_swig_ret bool)

func (SwigcptrSolver) Wall_time

func (arg1 SwigcptrSolver) Wall_time() (_swig_ret int64)

type SwigcptrStd_vector_Sl_operations_research_MPConstraint_Sm__Sg_

type SwigcptrStd_vector_Sl_operations_research_MPConstraint_Sm__Sg_ uintptr

func (SwigcptrStd_vector_Sl_operations_research_MPConstraint_Sm__Sg_) Swigcptr

type SwigcptrStd_vector_Sl_operations_research_MPVariable_Sm__Sg_

type SwigcptrStd_vector_Sl_operations_research_MPVariable_Sm__Sg_ uintptr

func (SwigcptrStd_vector_Sl_operations_research_MPVariable_Sm__Sg_) Swigcptr

type SwigcptrStringVector

type SwigcptrStringVector uintptr

func (SwigcptrStringVector) Add

func (arg1 SwigcptrStringVector) Add(arg2 string)

func (SwigcptrStringVector) Capacity

func (arg1 SwigcptrStringVector) Capacity() (_swig_ret int64)

func (SwigcptrStringVector) Clear

func (arg1 SwigcptrStringVector) Clear()

func (SwigcptrStringVector) Get

func (arg1 SwigcptrStringVector) Get(arg2 int) (_swig_ret string)

func (SwigcptrStringVector) IsEmpty

func (arg1 SwigcptrStringVector) IsEmpty() (_swig_ret bool)

func (SwigcptrStringVector) Reserve

func (arg1 SwigcptrStringVector) Reserve(arg2 int64)

func (SwigcptrStringVector) Set

func (arg1 SwigcptrStringVector) Set(arg2 int, arg3 string)

func (SwigcptrStringVector) Size

func (arg1 SwigcptrStringVector) Size() (_swig_ret int64)

func (SwigcptrStringVector) SwigIsStringVector

func (p SwigcptrStringVector) SwigIsStringVector()

func (SwigcptrStringVector) Swigcptr

func (p SwigcptrStringVector) Swigcptr() uintptr

type SwigcptrUtil_Status

type SwigcptrUtil_Status uintptr

func (SwigcptrUtil_Status) Swigcptr

func (p SwigcptrUtil_Status) Swigcptr() uintptr

type SwigcptrVariable

type SwigcptrVariable uintptr

func (SwigcptrVariable) Basis_status

func (arg1 SwigcptrVariable) Basis_status() (_swig_ret Operations_researchMPSolverBasisStatus)

func (SwigcptrVariable) Index

func (arg1 SwigcptrVariable) Index() (_swig_ret int)

func (SwigcptrVariable) Integer

func (arg1 SwigcptrVariable) Integer() (_swig_ret bool)

func (SwigcptrVariable) Lb

func (arg1 SwigcptrVariable) Lb() (_swig_ret float64)

func (SwigcptrVariable) Name

func (arg1 SwigcptrVariable) Name() (_swig_ret string)

func (SwigcptrVariable) Reduced_cost

func (arg1 SwigcptrVariable) Reduced_cost() (_swig_ret float64)

func (SwigcptrVariable) SetBounds

func (arg1 SwigcptrVariable) SetBounds(arg2 float64, arg3 float64)

func (SwigcptrVariable) Solution_value

func (arg1 SwigcptrVariable) Solution_value() (_swig_ret float64)

func (SwigcptrVariable) SwigIsVariable

func (p SwigcptrVariable) SwigIsVariable()

func (SwigcptrVariable) Swigcptr

func (p SwigcptrVariable) Swigcptr() uintptr

func (SwigcptrVariable) Ub

func (arg1 SwigcptrVariable) Ub() (_swig_ret float64)

type Util_Status

type Util_Status interface {
	Swigcptr() uintptr
}

type Variable

type Variable interface {
	Swigcptr() uintptr
	SwigIsVariable()
	Name() (_swig_ret string)
	Integer() (_swig_ret bool)
	Solution_value() (_swig_ret float64)
	Index() (_swig_ret int)
	Lb() (_swig_ret float64)
	Ub() (_swig_ret float64)
	SetBounds(arg2 float64, arg3 float64)
	Reduced_cost() (_swig_ret float64)
	Basis_status() (_swig_ret Operations_researchMPSolverBasisStatus)
}

Directories

Path Synopsis
examples
LP
This example is a Go replica of https://github.com/google/or-tools/blob/master/ortools/linear_solver/samples/linear_programming_example.py Linear optimization example
This example is a Go replica of https://github.com/google/or-tools/blob/master/ortools/linear_solver/samples/linear_programming_example.py Linear optimization example
MILP
This is a Go replica of https://github.com/google/or-tools/blob/master/ortools/linear_solver/samples/integer_programming_example.py Small example to illustrate solving a MIP problem.
This is a Go replica of https://github.com/google/or-tools/blob/master/ortools/linear_solver/samples/integer_programming_example.py Small example to illustrate solving a MIP problem.

Jump to

Keyboard shortcuts

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