forked from M-Labs/nalgebra
Compare commits
22 Commits
main
...
dev-0.32.x
Author | SHA1 | Date | |
---|---|---|---|
|
64e97c85d5 | ||
|
f8cb672280 | ||
|
6b7305337f | ||
|
440d4a4681 | ||
|
dd44414a8a | ||
|
4decc8003d | ||
|
4a5855a1c4 | ||
|
e726b65fd7 | ||
|
980dd68e68 | ||
|
d8ed277243 | ||
|
2adb4f0b26 | ||
|
6eea643277 | ||
|
b7d7b69777 | ||
|
7b6f4c6547 | ||
|
e48169e234 | ||
|
fef43a6146 | ||
|
944afe24e8 | ||
|
c04b087388 | ||
|
156f292917 | ||
|
e9535d5cb5 | ||
|
e8fb1ab215 | ||
|
39ef8b43cf |
868
CHANGELOG.md
868
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
146
Cargo.toml
146
Cargo.toml
@ -1,15 +1,15 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "nalgebra"
|
name = "nalgebra"
|
||||||
version = "0.32.3"
|
version = "0.32.6"
|
||||||
authors = [ "Sébastien Crozet <developer@crozet.re>" ]
|
authors = ["Sébastien Crozet <developer@crozet.re>"]
|
||||||
|
|
||||||
description = "General-purpose linear algebra library with transformations and statically-sized or dynamically-sized matrices."
|
description = "General-purpose linear algebra library with transformations and statically-sized or dynamically-sized matrices."
|
||||||
documentation = "https://www.nalgebra.org/docs"
|
documentation = "https://www.nalgebra.org/docs"
|
||||||
homepage = "https://nalgebra.org"
|
homepage = "https://nalgebra.org"
|
||||||
repository = "https://github.com/dimforge/nalgebra"
|
repository = "https://github.com/dimforge/nalgebra"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
categories = [ "science", "mathematics", "wasm", "no-std" ]
|
categories = ["science", "mathematics", "wasm", "no-std"]
|
||||||
keywords = [ "linear", "algebra", "matrix", "vector", "math" ]
|
keywords = ["linear", "algebra", "matrix", "vector", "math"]
|
||||||
license = "BSD-3-Clause"
|
license = "BSD-3-Clause"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
exclude = ["/ci/*", "/.travis.yml", "/Makefile"]
|
exclude = ["/ci/*", "/.travis.yml", "/Makefile"]
|
||||||
@ -22,104 +22,108 @@ name = "nalgebra"
|
|||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "std", "macros" ]
|
default = ["std", "macros"]
|
||||||
std = [ "matrixmultiply", "simba/std" ]
|
std = ["matrixmultiply", "simba/std"]
|
||||||
sparse = [ ]
|
sparse = []
|
||||||
debug = [ "approx/num-complex", "rand" ]
|
debug = ["approx/num-complex", "rand"]
|
||||||
alloc = [ ]
|
alloc = []
|
||||||
io = [ "pest", "pest_derive" ]
|
io = ["pest", "pest_derive"]
|
||||||
compare = [ "matrixcompare-core" ]
|
compare = ["matrixcompare-core"]
|
||||||
libm = [ "simba/libm" ]
|
libm = ["simba/libm"]
|
||||||
libm-force = [ "simba/libm_force" ]
|
libm-force = ["simba/libm_force"]
|
||||||
macros = [ "nalgebra-macros" ]
|
macros = ["nalgebra-macros"]
|
||||||
cuda = [ "cust_core", "simba/cuda" ]
|
cuda = ["cust_core", "simba/cuda"]
|
||||||
|
|
||||||
|
|
||||||
# Conversion
|
# Conversion
|
||||||
convert-mint = [ "mint" ]
|
convert-mint = ["mint"]
|
||||||
convert-bytemuck = [ "bytemuck" ]
|
convert-bytemuck = ["bytemuck"]
|
||||||
convert-glam014 = [ "glam014" ]
|
convert-glam014 = ["glam014"]
|
||||||
convert-glam015 = [ "glam015" ]
|
convert-glam015 = ["glam015"]
|
||||||
convert-glam016 = [ "glam016" ]
|
convert-glam016 = ["glam016"]
|
||||||
convert-glam017 = [ "glam017" ]
|
convert-glam017 = ["glam017"]
|
||||||
convert-glam018 = [ "glam018" ]
|
convert-glam018 = ["glam018"]
|
||||||
convert-glam019 = [ "glam019" ]
|
convert-glam019 = ["glam019"]
|
||||||
convert-glam020 = [ "glam020" ]
|
convert-glam020 = ["glam020"]
|
||||||
convert-glam021 = [ "glam021" ]
|
convert-glam021 = ["glam021"]
|
||||||
convert-glam022 = [ "glam022" ]
|
convert-glam022 = ["glam022"]
|
||||||
convert-glam023 = [ "glam023" ]
|
convert-glam023 = ["glam023"]
|
||||||
convert-glam024 = [ "glam024" ]
|
convert-glam024 = ["glam024"]
|
||||||
|
convert-glam025 = ["glam025"]
|
||||||
|
convert-glam027 = ["glam027"]
|
||||||
|
|
||||||
# Serialization
|
# Serialization
|
||||||
## To use serde in a #[no-std] environment, enable the
|
## To use serde in a #[no-std] environment, enable the
|
||||||
## `serde-serialize-no-std` feature instead of `serde-serialize`.
|
## `serde-serialize-no-std` feature instead of `serde-serialize`.
|
||||||
## Serialization of dynamically-sized matrices/vectors require
|
## Serialization of dynamically-sized matrices/vectors require
|
||||||
## `serde-serialize`.
|
## `serde-serialize`.
|
||||||
serde-serialize-no-std = [ "serde", "num-complex/serde" ]
|
serde-serialize-no-std = ["serde", "num-complex/serde"]
|
||||||
serde-serialize = [ "serde-serialize-no-std", "serde/std" ]
|
serde-serialize = ["serde-serialize-no-std", "serde/std"]
|
||||||
rkyv-serialize-no-std = [ "rkyv/size_32" ]
|
rkyv-serialize-no-std = ["rkyv/size_32"]
|
||||||
rkyv-serialize = [ "rkyv-serialize-no-std", "rkyv/std", "rkyv/validation" ]
|
rkyv-serialize = ["rkyv-serialize-no-std", "rkyv/std", "rkyv/validation"]
|
||||||
|
|
||||||
# Randomness
|
# Randomness
|
||||||
## To use rand in a #[no-std] environment, enable the
|
## To use rand in a #[no-std] environment, enable the
|
||||||
## `rand-no-std` feature instead of `rand`.
|
## `rand-no-std` feature instead of `rand`.
|
||||||
rand-no-std = [ "rand-package" ]
|
rand-no-std = ["rand-package"]
|
||||||
rand = [ "rand-no-std", "rand-package/std", "rand-package/std_rng", "rand_distr" ]
|
rand = ["rand-no-std", "rand-package/std", "rand-package/std_rng", "rand_distr"]
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
arbitrary = [ "quickcheck" ]
|
arbitrary = ["quickcheck"]
|
||||||
proptest-support = [ "proptest" ]
|
proptest-support = ["proptest"]
|
||||||
slow-tests = []
|
slow-tests = []
|
||||||
rkyv-safe-deser = [ "rkyv-serialize", "rkyv/validation" ]
|
rkyv-safe-deser = ["rkyv-serialize", "rkyv/validation"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nalgebra-macros = { version = "0.2.1", path = "nalgebra-macros", optional = true }
|
nalgebra-macros = { version = "0.2.1", path = "nalgebra-macros", optional = true }
|
||||||
typenum = "1.12"
|
typenum = "1.12"
|
||||||
rand-package = { package = "rand", version = "0.8", optional = true, default-features = false }
|
rand-package = { package = "rand", version = "0.8", optional = true, default-features = false }
|
||||||
num-traits = { version = "0.2", default-features = false }
|
num-traits = { version = "0.2", default-features = false }
|
||||||
num-complex = { version = "0.4", default-features = false }
|
num-complex = { version = "0.4", default-features = false }
|
||||||
num-rational = { version = "0.4", default-features = false }
|
num-rational = { version = "0.4", default-features = false }
|
||||||
approx = { version = "0.5", default-features = false }
|
approx = { version = "0.5", default-features = false }
|
||||||
simba = { version = "0.8", default-features = false }
|
simba = { version = "0.8", default-features = false }
|
||||||
alga = { version = "0.9", default-features = false, optional = true }
|
alga = { version = "0.9", default-features = false, optional = true }
|
||||||
rand_distr = { version = "0.4", default-features = false, optional = true }
|
rand_distr = { version = "0.4", default-features = false, optional = true }
|
||||||
matrixmultiply = { version = "0.3", optional = true }
|
matrixmultiply = { version = "0.3", optional = true }
|
||||||
serde = { version = "1.0", default-features = false, features = [ "derive" ], optional = true }
|
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
|
||||||
rkyv = { version = "0.7.41", default-features = false, optional = true }
|
rkyv = { version = "0.7.41", default-features = false, optional = true }
|
||||||
mint = { version = "0.5", optional = true }
|
mint = { version = "0.5", optional = true }
|
||||||
quickcheck = { version = "1", optional = true }
|
quickcheck = { version = "1", optional = true }
|
||||||
pest = { version = "2", optional = true }
|
pest = { version = "2", optional = true }
|
||||||
pest_derive = { version = "2", optional = true }
|
pest_derive = { version = "2", optional = true }
|
||||||
bytemuck = { version = "1.5", optional = true }
|
bytemuck = { version = "1.5", optional = true }
|
||||||
matrixcompare-core = { version = "0.1", optional = true }
|
matrixcompare-core = { version = "0.1", optional = true }
|
||||||
proptest = { version = "1", optional = true, default-features = false, features = ["std"] }
|
proptest = { version = "1", optional = true, default-features = false, features = ["std"] }
|
||||||
glam014 = { package = "glam", version = "0.14", optional = true }
|
glam014 = { package = "glam", version = "0.14", optional = true }
|
||||||
glam015 = { package = "glam", version = "0.15", optional = true }
|
glam015 = { package = "glam", version = "0.15", optional = true }
|
||||||
glam016 = { package = "glam", version = "0.16", optional = true }
|
glam016 = { package = "glam", version = "0.16", optional = true }
|
||||||
glam017 = { package = "glam", version = "0.17", optional = true }
|
glam017 = { package = "glam", version = "0.17", optional = true }
|
||||||
glam018 = { package = "glam", version = "0.18", optional = true }
|
glam018 = { package = "glam", version = "0.18", optional = true }
|
||||||
glam019 = { package = "glam", version = "0.19", optional = true }
|
glam019 = { package = "glam", version = "0.19", optional = true }
|
||||||
glam020 = { package = "glam", version = "0.20", optional = true }
|
glam020 = { package = "glam", version = "0.20", optional = true }
|
||||||
glam021 = { package = "glam", version = "0.21", optional = true }
|
glam021 = { package = "glam", version = "0.21", optional = true }
|
||||||
glam022 = { package = "glam", version = "0.22", optional = true }
|
glam022 = { package = "glam", version = "0.22", optional = true }
|
||||||
glam023 = { package = "glam", version = "0.23", optional = true }
|
glam023 = { package = "glam", version = "0.23", optional = true }
|
||||||
glam024 = { package = "glam", version = "0.24", optional = true }
|
glam024 = { package = "glam", version = "0.24", optional = true }
|
||||||
cust_core = { version = "0.1", optional = true }
|
glam025 = { package = "glam", version = "0.25", optional = true }
|
||||||
rayon = { version = "1.6", optional = true }
|
glam027 = { package = "glam", version = "0.27", optional = true }
|
||||||
|
cust_core = { version = "0.1", optional = true }
|
||||||
|
rayon = { version = "1.6", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
rand_xorshift = "0.3"
|
rand_xorshift = "0.3"
|
||||||
rand_isaac = "0.3"
|
rand_isaac = "0.3"
|
||||||
criterion = { version = "0.4", features = ["html_reports"] }
|
criterion = { version = "0.4", features = ["html_reports"] }
|
||||||
nalgebra = { path = ".", features = ["debug", "compare", "rand", "macros"]}
|
nalgebra = { path = ".", features = ["debug", "compare", "rand", "macros"] }
|
||||||
|
|
||||||
# For matrix comparison macro
|
# For matrix comparison macro
|
||||||
matrixcompare = "0.3.0"
|
matrixcompare = "0.3.0"
|
||||||
itertools = "0.10"
|
itertools = "0.10"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [ "nalgebra-lapack", "nalgebra-glm", "nalgebra-sparse", "nalgebra-macros" ]
|
members = ["nalgebra-lapack", "nalgebra-glm", "nalgebra-sparse", "nalgebra-macros"]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
|
@ -34,6 +34,17 @@ pub fn reflection_axis_mut<T: ComplexField, D: Dim, S: StorageMut<T, D>>(
|
|||||||
|
|
||||||
if !factor.is_zero() {
|
if !factor.is_zero() {
|
||||||
column.unscale_mut(factor.sqrt());
|
column.unscale_mut(factor.sqrt());
|
||||||
|
|
||||||
|
// Normalize again, making sure the vector is unit-sized.
|
||||||
|
// If `factor` had a very small value, the first normalization
|
||||||
|
// (dividing by `factor.sqrt()`) might end up with a slightly
|
||||||
|
// non-unit vector (especially when using 32-bits float).
|
||||||
|
// Decompositions strongly rely on that unit-vector property,
|
||||||
|
// so we run a second normalization (that is much more numerically
|
||||||
|
// stable since the norm is close to 1) to ensure it has a unit
|
||||||
|
// size.
|
||||||
|
let _ = column.normalize_mut();
|
||||||
|
|
||||||
(-signed_norm, true)
|
(-signed_norm, true)
|
||||||
} else {
|
} else {
|
||||||
// TODO: not sure why we don't have a - sign here.
|
// TODO: not sure why we don't have a - sign here.
|
||||||
|
4
src/third_party/glam/mod.rs
vendored
4
src/third_party/glam/mod.rs
vendored
@ -20,3 +20,7 @@ mod v022;
|
|||||||
mod v023;
|
mod v023;
|
||||||
#[cfg(feature = "glam024")]
|
#[cfg(feature = "glam024")]
|
||||||
mod v024;
|
mod v024;
|
||||||
|
#[cfg(feature = "glam025")]
|
||||||
|
mod v025;
|
||||||
|
#[cfg(feature = "glam027")]
|
||||||
|
mod v027;
|
||||||
|
18
src/third_party/glam/v025/mod.rs
vendored
Normal file
18
src/third_party/glam/v025/mod.rs
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#[path = "../common/glam_isometry.rs"]
|
||||||
|
mod glam_isometry;
|
||||||
|
#[path = "../common/glam_matrix.rs"]
|
||||||
|
mod glam_matrix;
|
||||||
|
#[path = "../common/glam_point.rs"]
|
||||||
|
mod glam_point;
|
||||||
|
#[path = "../common/glam_quaternion.rs"]
|
||||||
|
mod glam_quaternion;
|
||||||
|
#[path = "../common/glam_rotation.rs"]
|
||||||
|
mod glam_rotation;
|
||||||
|
#[path = "../common/glam_similarity.rs"]
|
||||||
|
mod glam_similarity;
|
||||||
|
#[path = "../common/glam_translation.rs"]
|
||||||
|
mod glam_translation;
|
||||||
|
#[path = "../common/glam_unit_complex.rs"]
|
||||||
|
mod glam_unit_complex;
|
||||||
|
|
||||||
|
pub(self) use glam025 as glam;
|
18
src/third_party/glam/v027/mod.rs
vendored
Normal file
18
src/third_party/glam/v027/mod.rs
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#[path = "../common/glam_isometry.rs"]
|
||||||
|
mod glam_isometry;
|
||||||
|
#[path = "../common/glam_matrix.rs"]
|
||||||
|
mod glam_matrix;
|
||||||
|
#[path = "../common/glam_point.rs"]
|
||||||
|
mod glam_point;
|
||||||
|
#[path = "../common/glam_quaternion.rs"]
|
||||||
|
mod glam_quaternion;
|
||||||
|
#[path = "../common/glam_rotation.rs"]
|
||||||
|
mod glam_rotation;
|
||||||
|
#[path = "../common/glam_similarity.rs"]
|
||||||
|
mod glam_similarity;
|
||||||
|
#[path = "../common/glam_translation.rs"]
|
||||||
|
mod glam_translation;
|
||||||
|
#[path = "../common/glam_unit_complex.rs"]
|
||||||
|
mod glam_unit_complex;
|
||||||
|
|
||||||
|
pub(self) use glam027 as glam;
|
@ -1,4 +1,4 @@
|
|||||||
use na::DMatrix;
|
use na::{DMatrix, Matrix3};
|
||||||
|
|
||||||
#[cfg(feature = "proptest-support")]
|
#[cfg(feature = "proptest-support")]
|
||||||
mod proptest_tests {
|
mod proptest_tests {
|
||||||
@ -116,6 +116,31 @@ fn symmetric_eigen_singular_24x24() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test for #1368
|
||||||
|
#[test]
|
||||||
|
fn very_small_deviation_from_identity() {
|
||||||
|
let m = Matrix3::<f32>::new(
|
||||||
|
1.0,
|
||||||
|
3.1575704e-23,
|
||||||
|
8.1146196e-23,
|
||||||
|
3.1575704e-23,
|
||||||
|
1.0,
|
||||||
|
1.7471054e-22,
|
||||||
|
8.1146196e-23,
|
||||||
|
1.7471054e-22,
|
||||||
|
1.0,
|
||||||
|
);
|
||||||
|
|
||||||
|
for v in m
|
||||||
|
.try_symmetric_eigen(f32::EPSILON, 0)
|
||||||
|
.unwrap()
|
||||||
|
.eigenvalues
|
||||||
|
.into_iter()
|
||||||
|
{
|
||||||
|
assert_relative_eq!(*v, 1.);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// #[cfg(feature = "arbitrary")]
|
// #[cfg(feature = "arbitrary")]
|
||||||
// quickcheck! {
|
// quickcheck! {
|
||||||
// TODO: full eigendecomposition is not implemented yet because of its complexity when some
|
// TODO: full eigendecomposition is not implemented yet because of its complexity when some
|
||||||
|
Loading…
Reference in New Issue
Block a user