File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ pub trait BaseVector<T: RealNumber>: Clone + Debug {
166
166
/// ```
167
167
fn unique ( & self ) -> Vec < T > ;
168
168
169
- /// Compute the arithmetic mean.
169
+ /// Computes the arithmetic mean.
170
170
fn mean ( & self ) -> T {
171
171
let n = self . len ( ) ;
172
172
let mut mean = T :: zero ( ) ;
@@ -176,7 +176,7 @@ pub trait BaseVector<T: RealNumber>: Clone + Debug {
176
176
}
177
177
mean / T :: from_usize ( n) . unwrap ( )
178
178
}
179
- /// Compute the standard deviation.
179
+ /// Computes the standard deviation.
180
180
fn std ( & self ) -> T {
181
181
let n = self . len ( ) ;
182
182
Original file line number Diff line number Diff line change 1
1
//! # Various Statistical Methods
2
2
//!
3
- //!
3
+ //! This module provides reference implementations for various statistical functions.
4
+ //! Concrete implementations of the `BaseMatrix` trait are free to override these methods for better performance.
4
5
5
6
use crate :: linalg:: BaseMatrix ;
6
7
use crate :: math:: num:: RealNumber ;
7
8
8
9
/// Defines baseline implementations for various statistical functions
9
10
pub trait MatrixStats < T : RealNumber > : BaseMatrix < T > {
10
- /// Compute the arithmetic mean along the specified axis.
11
+ /// Computes the arithmetic mean along the specified axis.
11
12
fn mean ( & self , axis : u8 ) -> Vec < T > {
12
13
let ( n, m) = match axis {
13
14
0 => {
@@ -34,7 +35,7 @@ pub trait MatrixStats<T: RealNumber>: BaseMatrix<T> {
34
35
x
35
36
}
36
37
37
- /// Compute the standard deviation along the specified axis.
38
+ /// Computes the standard deviation along the specified axis.
38
39
fn std ( & self , axis : u8 ) -> Vec < T > {
39
40
let ( n, m) = match axis {
40
41
0 => {
You can’t perform that action at this time.
0 commit comments