feat: refactors dataset

This commit is contained in:
Volodymyr Orlov
2020-09-14 13:36:40 -07:00
parent d28f13d849
commit 7c013ddc35
10 changed files with 145 additions and 6617 deletions
+11
View File
@@ -32,6 +32,9 @@ pub trait RealNumber: Float + FromPrimitive + Debug + Display + Copy + Sum + Pro
fn square(self) -> Self {
self * self
}
/// Raw transmutation to u64
fn to_f32_bits(self) -> u32;
}
impl RealNumber for f64 {
@@ -69,6 +72,10 @@ impl RealNumber for f64 {
fn half() -> Self {
0.5f64
}
fn to_f32_bits(self) -> u32 {
self.to_bits() as u32
}
}
impl RealNumber for f32 {
@@ -106,6 +113,10 @@ impl RealNumber for f32 {
fn half() -> Self {
0.5f32
}
fn to_f32_bits(self) -> u32 {
self.to_bits()
}
}
#[cfg(test)]