MCPcopy Index your code
hub / github.com/datamole-ai/gomez

github.com/datamole-ai/gomez @v0.5.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.5.1 ↗ · + Follow
279 symbols 656 edges 30 files 69 documented · 25%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

gomez

Build License Cargo Documentation

gomez is a framework and implementation for mathematical optimization and solving non-linear systems of equations.

The library is written completely in Rust. Its focus is on being useful for practical problems and having API that is simple for easy cases as well as flexible for complicated ones. The name stands for global optimization & non-linear equations solving, with a few typos.

Practical problems

The main goal is to be useful for practical problems. This is manifested by the following features:

  • Derivative-free. No algorithm requires an analytical derivative (gradient, Hessian, Jacobian). Methods that use derivatives approximate it using finite difference method1.
  • Constraints support. It is possible to specify the problem domain with constraints2, which is necessary for many engineering applications.
  • Non-naive implementations. The code is not a direct translation of a textbook pseudocode. It's written with performance in mind and applies important techniques from numerical mathematics. It also tries to handle situations that hurt the methods but occur in practice.

1 There is a plan to provide ways to override this approximation with a real derivative.

2 Currently, only unconstrained and box-bounded domains are supported.

Algorithms

  • Trust region – Recommended method to be used as a default and it will just work in most cases.
  • LIPO – Global optimization algorithm useful for searching good initial guesses in combination with a numerical algorithm.
  • Steffensen – Fast and lightweight method for solving one-dimensional systems of equations.
  • Nelder-Mead – Direct search optimization method that does not use any derivatives.

This list will be extended in the future. But at the same time, having as many algorithms as possible is not the goal. Instead, the focus is on providing quality implementations of battle-tested methods.

Roadmap

Listed not in priority order.

  • Homotopy continuation method to compare the performance with the trust region method
  • Conjugate gradient method
  • Experimentation with various global optimization techniques for initial guess search
  • Evolutionary/nature-inspired algorithms
  • Bayesian optimization
  • Focus on initial guesses search and tools for analysis in general

License

Licensed under MIT.

There are gsl-wrapper and gsl-sys crates which are licensed under the GPLv3 identically as GSL itself. This code is part of the repository but is not part of the gomez library. Its purpose is solely for comparison in the benchmarks.

Extension points exported contracts — how you extend this code

TestProblem (Interface)
Extension of the [`Problem`] trait that provides additional information that is useful for testing algorithms. [7 implementers]
src/testing.rs
Problem (Interface)
The base trait for [`Function`](super::function::Function) and [`System`](super::system::System). [13 implementers]
src/core/base.rs
VectorNelderMeadExt (Interface)
(no doc) [1 implementers]
src/algo/nelder_mead.rs
Function (Interface)
(no doc) [1 implementers]
gsl-wrapper/src/function.rs
TestSystem (Interface)
Extension of the [`System`] trait that provides additional information that is useful for testing solvers. [7 implementers]
src/testing.rs
System (Interface)
Definition of a system of equations. ## Defining a system A system is any type that implements [`System`] and [`Proble [9 …
src/core/system.rs
RealFieldNelderMeadExt (Interface)
(no doc) [1 implementers]
src/algo/nelder_mead.rs
TestFunction (Interface)
Extension of the [`Function`] trait that provides additional information that is useful for testing optimizers. [1 implementers]
src/testing.rs

Core symbols most depended-on inside this repo

iter
called by 29
src/driver.rs
dim
called by 19
src/core/domain.rs
norm
called by 19
src/core/system.rs
domain
called by 16
src/driver.rs
len
called by 16
gsl-wrapper/src/vec.rs
bench_solve
called by 16
gomez-bench/benches/main.rs
apply
called by 15
src/core/function.rs
build
called by 14
src/driver.rs

Shape

Method 149
Function 62
Class 40
Enum 15
Interface 13

Languages

Rust100%

Modules by API surface

gsl-wrapper/src/vec.rs37 symbols
src/driver.rs32 symbols
src/testing.rs30 symbols
src/algo/nelder_mead.rs24 symbols
src/algo/trust_region.rs18 symbols
gsl-wrapper/src/multiroot.rs16 symbols
src/derivatives.rs15 symbols
src/algo/lipo.rs15 symbols
gomez-bench/benches/main.rs15 symbols
gsl-wrapper/src/status.rs14 symbols
src/algo/steffensen.rs13 symbols
src/core/domain.rs10 symbols

For agents

$ claude mcp add gomez \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact