clpwrapper

package module
v0.0.0-...-2259099 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

clpwrapper

GoDoc Go Report BuildStatus codecov

This is a small package that provides interoperability among:

  • clp for solving linear programs
  • Gonum mat for general matrices
  • sparse for sparse matrices

clp's "natural" matrix type comes from CoinUtils and is fine in that limited context. But it is hardly ideal for interacting with the larger go ecosystem.

Install

clpwrapper requires all three packages listed above, including their dependencies (clp's in particular are non-trivial). Then run:

go get github.com/jonreiter/clpwrapper

Documentation

Overview

Package clpwrapper contains simple wrappers to help with lanl/clp once go has an approximately-standard sparse matrix package this code can go into the clp itself

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAboveBounds

func BuildAboveBounds(boundsVec []float64) []clp.Bounds

BuildAboveBounds returns a vector of v->math.Inf(1) bounds

func BuildAllNegativeBounds

func BuildAllNegativeBounds(nv int) []clp.Bounds

BuildAllNegativeBounds returns a vector of math.Inf(-1)->0 bounds

func BuildAllPositiveBounds

func BuildAllPositiveBounds(nv int) []clp.Bounds

BuildAllPositiveBounds returns a vector of 0->math.Inf(1) bounds

func BuildBelowBounds

func BuildBelowBounds(boundsVec []float64) []clp.Bounds

BuildBelowBounds returns a vector of math.Inf(-1)->v bounds

func BuildEqualityBounds

func BuildEqualityBounds(boundsVec []float64) []clp.Bounds

BuildEqualityBounds returns a vector of v<->v bounds

func COOToCLPPackedMatrix

func COOToCLPPackedMatrix(matrix *sparse.COO) *clp.PackedMatrix

COOToCLPPackedMatrix converts a sparse.COO into a CoinPackedMatrix

func CSCToCLPPackedMatrix

func CSCToCLPPackedMatrix(matrix *sparse.CSC) *clp.PackedMatrix

CSCToCLPPackedMatrix converts a sparse.CSC into a CoinPackedMatrix

func ConvertBounds

func ConvertBounds(varBounds mat.Matrix) ([]clp.Bounds, error)

ConvertBounds from a gonum mat into clp bounds

func GoNumMatrixToCLPPackedMatrix

func GoNumMatrixToCLPPackedMatrix(matrix mat.Matrix) *clp.PackedMatrix

GoNumMatrixToCLPPackedMatrix converts a likely-sparse mat.Matrix into a CoinPackedMatrix

func GoNumMatrixToCLPPackedMatrixAtTolerance

func GoNumMatrixToCLPPackedMatrixAtTolerance(matrix mat.Matrix, tolerance float64) *clp.PackedMatrix

GoNumMatrixToCLPPackedMatrixAtTolerance converts a likely-sparse mat.Matrix into a CoinPackedMatrix entries with absolute value less than tolerance are dropped

func LoadSparseProblem

func LoadSparseProblem(simp *clp.Simplex, C []float64,
	varBounds, ubBounds []clp.Bounds, eqBoundsVec []float64,
	AEQ, AUB *sparse.COO)

LoadSparseProblem loads from sparse constraint matrices

Types

This section is empty.

Jump to

Keyboard shortcuts

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