[package]
name = "nalgebra"
version = "0.34.2"
authors = ["Sébastien Crozet <developer@crozet.re>"]

description = "General-purpose linear algebra library with transformations and statically-sized or dynamically-sized matrices."
documentation = "https://www.nalgebra.rs/docs"
homepage = "https://nalgebra.rs"
repository = "https://github.com/dimforge/nalgebra"
readme = "README.md"
categories = ["science", "mathematics", "wasm", "no-std"]
keywords = ["linear", "algebra", "matrix", "vector", "math"]
license = "Apache-2.0"
edition = "2024"
rust-version = "1.87.0"
exclude = ["/ci/*", "/.travis.yml", "/Makefile"]

[badges]
maintenance = { status = "actively-developed" }

[lib]
name = "nalgebra"
path = "src/lib.rs"

[features]
default = ["std", "macros"]
std = [
    "matrixmultiply",
    "num-traits/std",
    "num-complex/std",
    "num-rational/std",
    "approx/std",
    "simba/std",
    "glam014?/std",
    "glam015?/std",
    "glam016?/std",
    "glam017?/std",
    "glam018?/std",
    "glam019?/std",
    "glam020?/std",
    "glam021?/std",
    "glam022?/std",
    "glam023?/std",
    "glam024?/std",
    "glam025?/std",
    "glam027?/std",
    "glam028?/std",
    "glam029?/std",
    "glam030?/std",
    "glam031?/std",
    "glam032?/std",
]
sparse = []
debug = ["approx/num-complex", "rand"]
alloc = []
io = ["pest", "pest_derive"]
compare = ["matrixcompare-core"]
libm = [
    "simba/libm",
    "glam014?/libm",
    "glam015?/libm",
    "glam016?/libm",
    "glam017?/libm",
    "glam018?/libm",
    "glam019?/libm",
    "glam020?/libm",
    "glam021?/libm",
    "glam022?/libm",
    "glam023?/libm",
    "glam024?/libm",
    "glam025?/libm",
    "glam027?/libm",
    "glam028?/libm",
    "glam029?/libm",
    "glam030?/libm",
    "glam031?/libm",
    "glam032?/libm",
]
libm-force = ["simba/libm_force"]
macros = ["nalgebra-macros"]

# Conversion
convert-mint = ["mint"]
convert-bytemuck = ["bytemuck", "num-complex/bytemuck"]
convert-glam014 = ["glam014"]
convert-glam015 = ["glam015"]
convert-glam016 = ["glam016"]
convert-glam017 = ["glam017"]
convert-glam018 = ["glam018"]
convert-glam019 = ["glam019"]
convert-glam020 = ["glam020"]
convert-glam021 = ["glam021"]
convert-glam022 = ["glam022"]
convert-glam023 = ["glam023"]
convert-glam024 = ["glam024"]
convert-glam025 = ["glam025"]
convert-glam027 = ["glam027"]
convert-glam028 = ["glam028"]
convert-glam029 = ["glam029"]
convert-glam030 = ["glam030"]
convert-glam031 = ["glam031"]
convert-glam032 = ["glam032"]

# Serialization
## To use serde in a #[no-std] environment, enable the
## `serde-serialize-no-std` feature instead of `serde-serialize`.
## Serialization of dynamically-sized matrices/vectors require
## `serde-serialize`.
serde-serialize-no-std = ["serde", "num-complex/serde"]
serde-serialize = ["serde-serialize-no-std", "serde/std"]
rkyv-serialize-no-std = ["rkyv/size_32"]
rkyv-serialize = ["rkyv-serialize-no-std", "rkyv/std", "rkyv/validation"]

# Randomness
## To use rand in a #[no-std] environment, enable the
## `rand-no-std` feature instead of `rand`.
rand-no-std = ["rand-package"]
rand = ["rand-no-std", "rand-package/std", "rand-package/std_rng", "rand-package/thread_rng", "rand_distr"]

# Tests
arbitrary = ["quickcheck"]
proptest-support = ["proptest"]
slow-tests = []
rkyv-safe-deser = ["rkyv-serialize", "rkyv/validation"]

[dependencies]
nalgebra-macros = { version = "0.3.0", path = "nalgebra-macros", optional = true }
typenum = "1.12"
rand-package = { package = "rand", version = "0.9", optional = true, default-features = false }
num-traits = { version = "0.2", default-features = false }
num-complex = { version = "0.4", default-features = false }
num-rational = { version = "0.4", default-features = false }
approx = { version = "0.5", default-features = false }
simba = { version = "0.9", default-features = false }
alga = { version = "0.9", default-features = false, optional = true }
rand_distr = { version = "0.5", default-features = false, optional = true }
matrixmultiply = { version = "0.3", optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
# TODO: once rkyv is updated to 0.8, we could consider removing the `allow(unsafe_op_in_unsafe_fn)`.
rkyv = { version = "0.7.41", default-features = false, optional = true }
mint = { version = "0.5", optional = true }
quickcheck = { version = "1", optional = true }
pest = { version = "2", optional = true }
pest_derive = { version = "2", optional = true }
bytemuck = { version = "1.5", optional = true }
matrixcompare-core = { version = "0.1", optional = true }
proptest = { version = "1", optional = true, default-features = false, features = ["std"] }
glam014 = { package = "glam", version = "0.14", optional = true, default-features = false }
glam015 = { package = "glam", version = "0.15", optional = true, default-features = false }
glam016 = { package = "glam", version = "0.16", optional = true, default-features = false }
glam017 = { package = "glam", version = "0.17", optional = true, default-features = false }
glam018 = { package = "glam", version = "0.18", optional = true, default-features = false }
glam019 = { package = "glam", version = "0.19", optional = true, default-features = false }
glam020 = { package = "glam", version = "0.20", optional = true, default-features = false }
glam021 = { package = "glam", version = "0.21", optional = true, default-features = false }
glam022 = { package = "glam", version = "0.22", optional = true, default-features = false }
glam023 = { package = "glam", version = "0.23", optional = true, default-features = false }
glam024 = { package = "glam", version = "0.24", optional = true, default-features = false }
glam025 = { package = "glam", version = "0.25", optional = true, default-features = false }
glam027 = { package = "glam", version = "0.27", optional = true, default-features = false }
glam028 = { package = "glam", version = "0.28", optional = true, default-features = false }
glam029 = { package = "glam", version = "0.29", optional = true, default-features = false }
glam030 = { package = "glam", version = "0.30", optional = true, default-features = false }
glam031 = { package = "glam", version = "0.31", optional = true, default-features = false }
glam032 = { package = "glam", version = "0.32", optional = true, default-features = false }
rayon = { version = "1.6", optional = true }
defmt = { version = "1.0.1", optional = true }
encase = { version = "0.12", optional = true }

[dev-dependencies]
serde_json = "1.0"
rand_xorshift = "0.4"
rand_isaac = "0.4"
criterion = { version = "0.7", features = ["html_reports"] }
nalgebra = { path = ".", features = ["debug", "compare", "rand", "macros"] }

# For matrix comparison macro
matrixcompare = "0.3.0"
itertools = "0.13"

# For macro testing
trybuild = "1.0.90"

cool_asserts = "2.0.3"

[workspace]
members = ["nalgebra-lapack", "nalgebra-glm", "nalgebra-sparse", "nalgebra-macros"]
resolver = "2"

[[example]]
name = "matrixcompare"
required-features = ["compare"]

[[bench]]
name = "nalgebra_bench"
harness = false
path = "benches/lib.rs"
required-features = ["rand"]

#[profile.bench]
#opt-level = 0
#lto = false

[profile.bench]
lto = true
codegen-units = 1

[package.metadata.docs.rs]
# Enable all the features when building the docs on docs.rs
all-features = true
# define the configuration attribute `docsrs`
rustdoc-args = ["--cfg", "docsrs"]
