lasprs/src/config.rs

32 lines
793 B
Rust
Raw Normal View History

//! Configuration of module. Here, we can choose to compile for 32-bits or 64-bit floating point values
//! as basic data storage and computation size. Default is f64.
//!
2023-11-22 13:40:16 +00:00
cfg_if::cfg_if! {
if #[cfg(feature="f64")] {
pub type Flt = f64;
pub const pi: Flt = std::f64::consts::PI;
}
else if #[cfg(feature="f32")] {
pub type Flt = f32;
pub const pi: Flt = std::f32::consts::PI;
}
else {
std::compile_error!("feature should be f32 or f64");
}
}
2023-11-22 13:40:16 +00:00
use num::complex::*;
/// Complex number floating point
2023-11-22 13:40:16 +00:00
pub type Cflt = Complex<Flt>;
use ndarray::{Array1, Array2};
2023-11-22 13:40:16 +00:00
pub type Vd = Vec<Flt>;
pub type Vc = Vec<Cflt>;
pub type Dcol = Array1<Flt>;
pub type Ccol = Array1<Cflt>;
2023-11-22 13:40:16 +00:00
pub type Dmat = Array2<Flt>;
pub type Cmat = Array2<Cflt>;