Compare commits
23 Commits
main
...
artiq-zynq
Author | SHA1 | Date |
---|---|---|
abdul124 | dd00f9b460 | |
Sébastien Crozet | 64e97c85d5 | |
Sébastien Crozet | f8cb672280 | |
Sébastien Crozet | 6b7305337f | |
Sébastien Crozet | 440d4a4681 | |
Vollkornaffe | dd44414a8a | |
Vollkornaffe | 4decc8003d | |
Sébastien Crozet | 4a5855a1c4 | |
Sébastien Crozet | e726b65fd7 | |
Sébastien Crozet | 980dd68e68 | |
Sébastien Crozet | d8ed277243 | |
Sébastien Crozet | 2adb4f0b26 | |
Sébastien Crozet | 6eea643277 | |
Sébastien Crozet | b7d7b69777 | |
Sébastien Crozet | 7b6f4c6547 | |
Sébastien Crozet | e48169e234 | |
Sébastien Crozet | fef43a6146 | |
Sébastien Crozet | 944afe24e8 | |
Sébastien Crozet | c04b087388 | |
Sébastien Crozet | 156f292917 | |
Sébastien Crozet | e9535d5cb5 | |
Sébastien Crozet | e8fb1ab215 | |
Sébastien Crozet | 39ef8b43cf |
640
CHANGELOG.md
640
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
84
Cargo.toml
84
Cargo.toml
|
@ -1,15 +1,15 @@
|
|||
[package]
|
||||
name = "nalgebra"
|
||||
version = "0.32.3"
|
||||
authors = [ "Sébastien Crozet <developer@crozet.re>" ]
|
||||
version = "0.32.6"
|
||||
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.org/docs"
|
||||
homepage = "https://nalgebra.org"
|
||||
repository = "https://github.com/dimforge/nalgebra"
|
||||
readme = "README.md"
|
||||
categories = [ "science", "mathematics", "wasm", "no-std" ]
|
||||
keywords = [ "linear", "algebra", "matrix", "vector", "math" ]
|
||||
categories = ["science", "mathematics", "wasm", "no-std"]
|
||||
keywords = ["linear", "algebra", "matrix", "vector", "math"]
|
||||
license = "BSD-3-Clause"
|
||||
edition = "2018"
|
||||
exclude = ["/ci/*", "/.travis.yml", "/Makefile"]
|
||||
|
@ -22,55 +22,57 @@ name = "nalgebra"
|
|||
path = "src/lib.rs"
|
||||
|
||||
[features]
|
||||
default = [ "std", "macros" ]
|
||||
std = [ "matrixmultiply", "simba/std" ]
|
||||
sparse = [ ]
|
||||
debug = [ "approx/num-complex", "rand" ]
|
||||
alloc = [ ]
|
||||
io = [ "pest", "pest_derive" ]
|
||||
compare = [ "matrixcompare-core" ]
|
||||
libm = [ "simba/libm" ]
|
||||
libm-force = [ "simba/libm_force" ]
|
||||
macros = [ "nalgebra-macros" ]
|
||||
cuda = [ "cust_core", "simba/cuda" ]
|
||||
default = ["std", "macros"]
|
||||
std = ["matrixmultiply", "simba/std"]
|
||||
sparse = []
|
||||
debug = ["approx/num-complex", "rand"]
|
||||
alloc = []
|
||||
io = ["pest", "pest_derive"]
|
||||
compare = ["matrixcompare-core"]
|
||||
libm = ["simba/libm"]
|
||||
libm-force = ["simba/libm_force"]
|
||||
macros = ["nalgebra-macros"]
|
||||
cuda = ["cust_core", "simba/cuda"]
|
||||
|
||||
|
||||
# Conversion
|
||||
convert-mint = [ "mint" ]
|
||||
convert-bytemuck = [ "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-mint = ["mint"]
|
||||
convert-bytemuck = ["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"]
|
||||
|
||||
# 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" ]
|
||||
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_distr" ]
|
||||
rand-no-std = ["rand-package"]
|
||||
rand = ["rand-no-std", "rand-package/std", "rand-package/std_rng", "rand_distr"]
|
||||
|
||||
# Tests
|
||||
arbitrary = [ "quickcheck" ]
|
||||
proptest-support = [ "proptest" ]
|
||||
arbitrary = ["quickcheck"]
|
||||
proptest-support = ["proptest"]
|
||||
slow-tests = []
|
||||
rkyv-safe-deser = [ "rkyv-serialize", "rkyv/validation" ]
|
||||
rkyv-safe-deser = ["rkyv-serialize", "rkyv/validation"]
|
||||
|
||||
[dependencies]
|
||||
nalgebra-macros = { version = "0.2.1", path = "nalgebra-macros", optional = true }
|
||||
|
@ -84,7 +86,7 @@ simba = { version = "0.8", default-features = false }
|
|||
alga = { version = "0.9", default-features = false, optional = true }
|
||||
rand_distr = { version = "0.4", default-features = false, 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 }
|
||||
mint = { version = "0.5", optional = true }
|
||||
quickcheck = { version = "1", optional = true }
|
||||
|
@ -104,6 +106,8 @@ glam021 = { package = "glam", version = "0.21", optional = true }
|
|||
glam022 = { package = "glam", version = "0.22", optional = true }
|
||||
glam023 = { package = "glam", version = "0.23", optional = true }
|
||||
glam024 = { package = "glam", version = "0.24", optional = true }
|
||||
glam025 = { package = "glam", version = "0.25", optional = true }
|
||||
glam027 = { package = "glam", version = "0.27", optional = true }
|
||||
cust_core = { version = "0.1", optional = true }
|
||||
rayon = { version = "1.6", optional = true }
|
||||
|
||||
|
@ -112,14 +116,14 @@ serde_json = "1.0"
|
|||
rand_xorshift = "0.3"
|
||||
rand_isaac = "0.3"
|
||||
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
|
||||
matrixcompare = "0.3.0"
|
||||
itertools = "0.10"
|
||||
|
||||
[workspace]
|
||||
members = [ "nalgebra-lapack", "nalgebra-glm", "nalgebra-sparse", "nalgebra-macros" ]
|
||||
members = ["nalgebra-lapack", "nalgebra-glm", "nalgebra-sparse", "nalgebra-macros"]
|
||||
resolver = "2"
|
||||
|
||||
[[example]]
|
||||
|
|
|
@ -94,6 +94,7 @@ an optimized set of tools for computer graphics and physics. Those features incl
|
|||
html_root_url = "https://docs.rs/nalgebra/0.25.0"
|
||||
)]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![feature(const_fn, extended_key_value_attributes, array_methods)]
|
||||
|
||||
/// Generates an appropriate deprecation note with a suggestion for replacement.
|
||||
///
|
||||
|
|
|
@ -34,6 +34,17 @@ pub fn reflection_axis_mut<T: ComplexField, D: Dim, S: StorageMut<T, D>>(
|
|||
|
||||
if !factor.is_zero() {
|
||||
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)
|
||||
} else {
|
||||
// TODO: not sure why we don't have a - sign here.
|
||||
|
|
|
@ -20,3 +20,7 @@ mod v022;
|
|||
mod v023;
|
||||
#[cfg(feature = "glam024")]
|
||||
mod v024;
|
||||
#[cfg(feature = "glam025")]
|
||||
mod v025;
|
||||
#[cfg(feature = "glam027")]
|
||||
mod v027;
|
||||
|
|
|
@ -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;
|
|
@ -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")]
|
||||
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")]
|
||||
// quickcheck! {
|
||||
// TODO: full eigendecomposition is not implemented yet because of its complexity when some
|
||||
|
|
Loading…
Reference in New Issue