$ show jump-dev/MathOptInterface.jl
MathOptInterface.jl is a Julia library providing a standardized abstraction layer for mathematical optimization. It defines a common interface for formulating optimization problems (variables, constraints, objectives) and communicating with solvers. The architecture is highly modular, with core types for functions and sets, a powerful bridge system that automatically transforms constraints into solver-supported forms, file format readers/writers (MPS, LP, NL, SDPA, CBF, MOF), and utilities for model management, copying, and automatic differentiation of nonlinear expressions. The package serves as the foundation for higher-level modeling systems like JuMP and is used by dozens of optimization solvers in Julia.
The LLM identified 4 files worth highlighting for reuse:
Efficient dictionary implementation for sequential integer indices with sparse deletions. Provides O(1) amortized insertion and lookup, and gracefully degrades to OrderedDict when deletions occur. Reusable for any scenario requiring integer-keyed storage with frequent deletions.
Type-stable nested dictionary keyed by pairs of types (e.g., (F, S) for function and set types). Enables fast lookup of constraint-specific attributes without dynamic dispatch. Reusable for any system requiring multi-key type-indexed storage.
Defines an abstract interface for non-standard inner products in cone optimization. Provides set_dot and dot_coefficients functions that allow different cone types to define their own dot product, crucial for dual computation and algorithmic correctness. Reusable for any library needing custom inner products over mathematical sets.
Implements acyclic graph coloring for computing sparse Hessian matrices in reverse-mode automatic differentiation. Uses a disjoint-set data structure and topological sort to efficiently recover Hessians. Provides a reusable algorithm for any AD system needing structural analysis of sparsity.