solver

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package solver provides a high-level interface for solving linear programming problems using the revised simplex method.

It exposes a configurable Solver type and related options that allow users to control how problems are solved, including tolerances, iteration limits, and output handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSolverConfig

func NewSolverConfig(opts ...SolverOption) *common.SolverConfig

NewSolverConfig builds a SolverConfig applying all options on defaults.

func Solve

func Solve(prog *lp.LinearProgram, opts ...SolverOption) *lp.LinearProgram

Solve takes a linear program and an optional configuration, and attempts to solve it using the revised simplex method.

Types

type SolverMethod

type SolverMethod = common.SolverMethod
const (
	SimplexMethod SolverMethod = common.SimplexMethod
)

Re-export constants

type SolverOption

type SolverOption func(*common.SolverConfig)

SolverOption defines a function that modifies SolverConfig.

func WithGapSensitivity

func WithGapSensitivity(gap float64) SolverOption

WithGapSensitivity sets the gap sensitivity.

func WithLogging

func WithLogging(enabled bool) SolverOption

WithLogging enables or disables logging.

func WithMaxIterations

func WithMaxIterations(max int) SolverOption

WithMaxIterations sets the maximum number of iterations.

func WithRandomSeed

func WithRandomSeed(seed int) SolverOption

WithRandomSeed sets the random seed.

func WithSolverMethod

func WithSolverMethod(m common.SolverMethod) SolverOption

WithSolverMethod sets the solver method.

func WithThreads

func WithThreads(n int) SolverOption

WithThreads sets the number of threads to use.

func WithTolerance

func WithTolerance(t float64) SolverOption

WithTolerance sets the tolerance.

Jump to

Keyboard shortcuts

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