Linearly spaced elements.
| 68 | |
| 69 | /// Linearly spaced elements. |
| 70 | pub trait Linspace <T> { |
| 71 | |
| 72 | /// Returns a vector with `n` linearly separated elements |
| 73 | /// between `self` and `limit` (including `self` and |
| 74 | /// `limit`). |
| 75 | /// |
| 76 | /// # Example |
| 77 | /// |
| 78 | /// ``` |
| 79 | /// use rustml::vectors::*; |
| 80 | /// |
| 81 | /// assert_eq!(1.0.linspace(5.0, 3), vec![1.0, 3.0, 5.0]); |
| 82 | /// ``` |
| 83 | fn linspace(&self, limit: T, n: usize) -> Vec<T>; |
| 84 | } |
| 85 | |
| 86 | impl Linspace<f64> for f64 { |
| 87 |
nothing calls this directly
no outgoing calls
no test coverage detected