2021-05-03 19:50:48 +08:00
|
|
|
#[cfg(not(all(
|
|
|
|
feature = "debug",
|
|
|
|
feature = "compare",
|
|
|
|
feature = "rand",
|
|
|
|
feature = "macros"
|
|
|
|
)))]
|
2020-11-12 18:50:32 +08:00
|
|
|
compile_error!(
|
2021-04-30 23:06:59 +08:00
|
|
|
"Please enable the `debug`, `compare`, `rand` and `macros` features in order to compile and run the tests.
|
|
|
|
Example: `cargo test --features debug,compare,rand,macros`"
|
2020-11-12 18:50:32 +08:00
|
|
|
);
|
|
|
|
|
2021-04-10 11:48:58 +08:00
|
|
|
#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))]
|
2018-02-02 19:26:35 +08:00
|
|
|
#[macro_use]
|
|
|
|
extern crate approx;
|
2017-08-03 01:37:44 +08:00
|
|
|
extern crate nalgebra as na;
|
2018-02-02 19:26:35 +08:00
|
|
|
extern crate num_traits as num;
|
2021-04-10 11:48:58 +08:00
|
|
|
#[cfg(feature = "rand")]
|
2021-03-02 19:37:00 +08:00
|
|
|
extern crate rand_package as rand;
|
2017-08-03 01:37:44 +08:00
|
|
|
|
2021-04-10 11:48:58 +08:00
|
|
|
#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))]
|
2017-08-03 01:37:44 +08:00
|
|
|
mod core;
|
2021-04-10 11:48:58 +08:00
|
|
|
#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))]
|
2018-02-03 17:44:32 +08:00
|
|
|
mod geometry;
|
2021-04-10 11:48:58 +08:00
|
|
|
#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))]
|
2018-10-21 04:26:44 +08:00
|
|
|
mod linalg;
|
2020-11-10 21:46:33 +08:00
|
|
|
|
2021-04-10 11:48:58 +08:00
|
|
|
#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))]
|
2021-01-26 15:47:47 +08:00
|
|
|
#[cfg(feature = "proptest-support")]
|
2020-11-10 21:46:33 +08:00
|
|
|
mod proptest;
|
|
|
|
|
2021-04-10 11:48:58 +08:00
|
|
|
//#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))]
|
2019-03-03 02:33:49 +08:00
|
|
|
//#[cfg(feature = "sparse")]
|
|
|
|
//mod sparse;
|
2021-12-09 20:32:01 +08:00
|
|
|
|
|
|
|
mod utils {
|
|
|
|
/// Checks if a slice is sorted in descending order.
|
|
|
|
pub fn is_sorted_descending<T: PartialOrd>(slice: &[T]) -> bool {
|
|
|
|
slice.windows(2).all(|elts| elts[0] >= elts[1])
|
|
|
|
}
|
|
|
|
}
|