[package]
name = "fynch"
version = "0.3.1"
authors = ["Arc <attobop@gmail.com>"]
edition = "2021"
description = "Differentiable sorting and ranking: PAVA, Fenchel-Young losses, and O(n log n) FastSoftSort"
license = "MIT OR Apache-2.0"
repository = "https://github.com/arclabs561/fynch"
homepage = "https://github.com/arclabs561/fynch"
documentation = "https://docs.rs/fynch"
keywords = ["sorting", "ranking", "differentiable", "fenchel-young", "fastsoftsort"]
categories = ["algorithms", "science", "mathematics"]
publish = true

[features]
default = []
# Gumbel-Softmax for stochastic top-k
gumbel = ["dep:drawset", "dep:rand"]
# Implement logp::BregmanGenerator for exact Fenchel-Young/Bregman overlaps.
logp = ["dep:logp"]

[dependencies]
thiserror = "2.0"
serde = { version = "1.0", features = ["derive"] }
rand = { version = "0.9", optional = true }
logp = { version = "0.2", optional = true }

# Optional: SIMD primitives
# Optional: Stochastic sampling
drawset = { version = "0.1.0", optional = true }

[dev-dependencies]
approx = "0.5"
criterion = { version = "0.5", features = ["html_reports"] }
proptest = "1.5"
rand = "0.9"
rankit = { version = "0.1", features = ["losses"] }
serde_json = "1.0"

[[bench]]
name = "fy_bench"
harness = false

[[bench]]
name = "sinkhorn_bench"
harness = false
