aboutsummaryrefslogtreecommitdiff
path: root/src/statistics/math.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2018-06-13 13:17:28 +0200
committerDaniel Schadt <kingdread@gmx.de>2018-06-13 13:17:28 +0200
commit2fe671951369b8f049e8acf02e9e9750c96b4dcd (patch)
tree49e9c0cc4bcbf6d76183555ac95bc3d9504c7a05 /src/statistics/math.rs
parentfe16699205b6b40aed8cafbe95820835a7052908 (diff)
downloadevtclib-2fe671951369b8f049e8acf02e9e9750c96b4dcd.tar.gz
evtclib-2fe671951369b8f049e8acf02e9e9750c96b4dcd.tar.bz2
evtclib-2fe671951369b8f049e8acf02e9e9750c96b4dcd.zip
clean up a bit
Diffstat (limited to 'src/statistics/math.rs')
-rw-r--r--src/statistics/math.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/statistics/math.rs b/src/statistics/math.rs
index 3760ca3..6e7e666 100644
--- a/src/statistics/math.rs
+++ b/src/statistics/math.rs
@@ -45,7 +45,7 @@ struct Record<X, T, D> {
/// * `T` tag for each data point. Can be arbitrary.
/// * `D` actual data. Must be [`Monoid`](trait.Monoid.html), so that it can be
/// summed up.
-#[derive(Clone)]
+#[derive(Clone, Default)]
pub struct RecordFunc<X, T, D> {
data: Vec<Record<X, T, D>>,
}
@@ -84,6 +84,11 @@ where
self.data.len()
}
+ /// Check whether there are no records.
+ pub fn is_emtpy(&self) -> bool {
+ self.data.is_empty()
+ }
+
/// Get the absolute value at the specific point.
#[inline]
pub fn get(&self, x: &X) -> D {