[package]
name = "fdars-core"
version = "0.13.0"
edition = "2021"
authors = ["Simon Muller"]
description = "Functional Data Analysis algorithms in Rust"
license = "MIT"
repository = "https://github.com/sipemu/fdars"
homepage = "https://github.com/sipemu/fdars"
documentation = "https://docs.rs/fdars-core"
readme = "../README.md"
keywords = ["functional-data", "statistics", "fda", "depth", "clustering"]
categories = ["science", "mathematics"]
# CRAN Windows uses Rust 1.81.0, so we need compatible dependencies
rust-version = "1.81"


[features]
# Note: linalg is not in default because it requires Rust 1.84+ (faer 0.23+ dependency)
# The R package (fdars-r) uses default-features = false
default = ["parallel"]
parallel = ["rayon"]
# Ridge regression via faer/anofox-regression (requires Rust 1.84+, not WASM-compatible).
# Basic linear algebra (Cholesky, OLS) is always available in linalg.rs.
linalg = ["faer", "anofox-regression"]
# Serde serialization support for persistent workflows
serde = ["dep:serde", "dep:serde_json"]
# Enable JS features for WASM builds
js = ["getrandom/js"]

[dependencies]
rayon = { version = "1.10", optional = true }
rand = "0.8"
rand_distr = "0.4"
rustfft = "6.2"
num-complex = "0.4"
nalgebra = "0.33"
anofox-regression = { version = "0.4", optional = true }
# faer 0.23+ requires Rust 1.84.0 (linalg feature is not enabled by default)
faer = { version = "0.23", optional = true }
getrandom = { version = "0.2", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
serde_json = { version = "1", optional = true }

# WASM target configuration
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }

[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"

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

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

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

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

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

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

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

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

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

[[example]]
name = "simulation"
path = "examples/01_simulation/main.rs"

[[example]]
name = "functional_operations"
path = "examples/02_functional_operations/main.rs"

[[example]]
name = "smoothing"
path = "examples/03_smoothing/main.rs"

[[example]]
name = "basis_representation"
path = "examples/04_basis_representation/main.rs"

[[example]]
name = "depth_measures"
path = "examples/05_depth_measures/main.rs"

[[example]]
name = "distances_and_metrics"
path = "examples/06_distances_and_metrics/main.rs"

[[example]]
name = "clustering"
path = "examples/07_clustering/main.rs"

[[example]]
name = "regression"
path = "examples/08_regression/main.rs"

[[example]]
name = "outlier_detection"
path = "examples/09_outlier_detection/main.rs"

[[example]]
name = "seasonal_analysis"
path = "examples/10_seasonal_analysis/main.rs"

[[example]]
name = "detrending"
path = "examples/11_detrending/main.rs"

[[example]]
name = "streaming_depth"
path = "examples/12_streaming_depth/main.rs"

[[example]]
name = "irregular_data"
path = "examples/13_irregular_data/main.rs"

[[example]]
name = "complete_pipeline"
path = "examples/14_complete_pipeline/main.rs"

[[example]]
name = "tolerance_bands"
path = "examples/15_tolerance_bands/main.rs"

[[example]]
name = "elastic_alignment"
path = "examples/16_elastic_alignment/main.rs"

[[example]]
name = "equivalence_test"
path = "examples/17_equivalence_test/main.rs"

[[example]]
name = "landmark_registration"
path = "examples/18_landmark_registration/main.rs"

[[example]]
name = "tsrvf"
path = "examples/19_tsrvf/main.rs"

[[example]]
name = "scalar_on_function"
path = "examples/20_scalar_on_function/main.rs"

[[example]]
name = "function_on_scalar"
path = "examples/21_function_on_scalar/main.rs"

[[example]]
name = "gmm_clustering"
path = "examples/22_gmm_clustering/main.rs"

[[example]]
name = "classification"
path = "examples/23_classification/main.rs"

[[example]]
name = "mixed_effects"
path = "examples/24_mixed_effects/main.rs"

[[example]]
name = "explainability"
path = "examples/25_explainability/main.rs"

[[example]]
name = "elastic_analysis"
path = "examples/26_elastic_analysis/main.rs"

[[example]]
name = "spm"
path = "examples/27_spm/main.rs"

[[example]]
name = "berkeley_growth"
path = "examples/28_berkeley_growth/main.rs"
