Skip to main content

eindir_core/
lib.rs

1#![warn(missing_docs)]
2//! eindir-core: typed primitives for ND objective functions.
3//!
4//! This crate ships the typed primitives (FPair, Bounds, Objective trait,
5//! gradients, surrogates, point sets, and builtin objective implementations)
6//! consumed by `anneal-core`.
7
8/// Separable rank-1 surrogate and its tempered independence sampler.
9pub mod additive;
10/// Box bounds on N-dimensional points.
11pub mod bounds;
12/// Error types shared by all fallible operations in `eindir-core`.
13pub mod error;
14/// Box geometry features and compensated ΔE.
15pub mod features;
16/// C ABI surface, gated behind the `capi` Cargo feature.
17#[cfg(feature = "capi")]
18#[allow(non_camel_case_types)]
19pub mod ffi;
20/// Position-value pairs.
21pub mod fpair;
22/// Generalized Langevin equation colored-noise thermostat (optimal sampling).
23pub mod gle;
24/// Gradient trait and adapters (Analytic / FiniteDiff) plus
25/// `DifferentiableObjective`.  "Native" gradients when the caller can
26/// supply them (Ceres-style); explicit central differences otherwise.
27pub mod gradient;
28/// The `Objective` trait: typed `S -> R` map with bounds and optional known minimum.
29pub mod objective;
30/// Builtin objective-function implementations for benchmarking and tests.
31pub mod objectives;
32/// Low-discrepancy point sets for bounded numerical objectives.
33pub mod pointset;
34/// Adapter wrapping a Python callable into the Rust `Objective<f64>` trait.
35#[cfg(any(feature = "python", feature = "py-objective"))]
36pub mod py_objective;
37/// pyo3 bindings for `eindir._core`, gated behind the `python` Cargo feature.
38#[cfg(feature = "python")]
39pub mod python;
40/// Dimension-collapse and Chebyshev surrogate `Obj`-transforms.
41pub mod reduced;
42/// Shared algebra-facing type definitions.
43pub mod types;
44
45pub use additive::AdditiveSurrogate;
46pub use bounds::Bounds;
47pub use error::Error;
48pub use features::{BoxGeometry, box_geometry, compensated_delta, isotropic_proposal_scale};
49pub use fpair::FPair;
50pub use gle::{GleThermostat, OPTIMAL_SAMPLING_NS, ldl_sqrt, matrix_exp, optimal_sampling_drift};
51pub use gradient::{AnalyticGradient, DifferentiableObjective, FiniteDiffGradient, Gradient};
52pub use objective::{EVAL_BATCH_PARALLEL_MIN, Objective, eval_batch_parallel};
53pub use objectives::{Ackley, Rastrigin, Rosenbrock, StybTang2D};
54pub use pointset::{
55    boundary_anchored_low_discrepancy_points, halton_points, halton_unit, low_discrepancy_points,
56    radical_inverse, shifted_halton_points, shifted_low_discrepancy_points,
57};
58pub use reduced::{ChebyshevSurrogate, ReducedObjective};
59
60#[cfg(feature = "capi")]
61pub use ffi::{
62    EindirEvalFn, EindirFreeFn, EindirGradFn, EindirObjectiveWrapper, eindir_objective_t,
63};