From 621e1cf767d7794f4ebae01c8d3b047e1f7106af Mon Sep 17 00:00:00 2001 From: Ian Clarke Date: Sat, 6 Jul 2024 13:56:46 -0400 Subject: [PATCH] fix rustdoc --- src/pav.rs | 4 +- src/pav/isotonic_regression.rs | 94 +++++++++++++++++----------------- 2 files changed, 48 insertions(+), 50 deletions(-) diff --git a/src/pav.rs b/src/pav.rs index 1bc1154..d44671e 100644 --- a/src/pav.rs +++ b/src/pav.rs @@ -3,6 +3,4 @@ mod point; mod isotonic_regression; pub use coordinate::Coordinate; -pub use point::Point; -pub use isotonic_regression::IsotonicRegression; -pub use isotonic_regression::IsotonicRegressionError; +pub use point::Point; \ No newline at end of file diff --git a/src/pav/isotonic_regression.rs b/src/pav/isotonic_regression.rs index 9f95feb..7594759 100644 --- a/src/pav/isotonic_regression.rs +++ b/src/pav/isotonic_regression.rs @@ -65,12 +65,12 @@ impl IsotonicRegression { /// ``` /// /// let points = vec![ - /// crate::point::Point::new(0.0, 1.0), - /// crate::point::Point::new(1.0, 2.0), - /// crate::point::Point::new(2.0, 1.5), - /// crate::point::Point::new(3.0, 3.0), + /// super::point::Point::new(0.0, 1.0), + /// super::point::Point::new(1.0, 2.0), + /// super::point::Point::new(2.0, 1.5), + /// super::point::Point::new(3.0, 3.0), /// ]; - /// let regression = crate::isotonic_regression::IsotonicRegression::new_ascending(&points).unwrap(); + /// let regression = super::isotonic_regression::IsotonicRegression::new_ascending(&points).unwrap(); /// assert_eq!(regression.get_points().len(), 3); /// ``` pub fn new_ascending(points: &[Point]) -> Result, IsotonicRegressionError> { @@ -83,12 +83,12 @@ impl IsotonicRegression { /// /// ``` /// let points = vec![ - /// crate::point::Point::new(0.0, 3.0), - /// crate::point::Point::new(1.0, 2.0), - /// crate::point::Point::new(2.0, 2.5), - /// crate::point::Point::new(3.0, 1.0), + /// super::point::Point::new(0.0, 3.0), + /// super::point::Point::new(1.0, 2.0), + /// super::point::Point::new(2.0, 2.5), + /// super::point::Point::new(3.0, 1.0), /// ]; - /// let regression = crate::isotonic_regression::IsotonicRegression::new_descending(&points).unwrap(); + /// let regression = super::isotonic_regression::IsotonicRegression::new_descending(&points).unwrap(); /// assert_eq!(regression.get_points().len(), 3); /// ``` pub fn new_descending(points: &[Point]) -> Result, IsotonicRegressionError> { @@ -103,12 +103,12 @@ impl IsotonicRegression { /// /// ``` /// let points = vec![ - /// crate::point::Point::new(0.0, 1.0), - /// crate::point::Point::new(1.0, 2.0), - /// crate::point::Point::new(2.0, 1.5), - /// crate::point::Point::new(3.0, 3.0), + /// super::point::Point::new(0.0, 1.0), + /// super::point::Point::new(1.0, 2.0), + /// super::point::Point::new(2.0, 1.5), + /// super::point::Point::new(3.0, 3.0), /// ]; - /// let regression = crate::isotonic_regression::IsotonicRegression::new(&points, crate::isotonic_regression::Direction::Ascending, false).unwrap(); + /// let regression = super::isotonic_regression::IsotonicRegression::new(&points, super::isotonic_regression::Direction::Ascending, false).unwrap(); /// assert_eq!(regression.get_points().len(), 3); /// ``` fn new(points: &[Point], direction: Direction, intersect_origin: bool) -> Result, IsotonicRegressionError> { @@ -140,12 +140,12 @@ impl IsotonicRegression { /// /// ``` /// let points = vec![ - /// crate::point::Point::new(0.0, 1.0), - /// crate::point::Point::new(1.0, 2.0), - /// crate::point::Point::new(2.0, 1.5), - /// crate::point::Point::new(3.0, 3.0), + /// super::point::Point::new(0.0, 1.0), + /// super::point::Point::new(1.0, 2.0), + /// super::point::Point::new(2.0, 1.5), + /// super::point::Point::new(3.0, 3.0), /// ]; - /// let regression = crate::isotonic_regression::IsotonicRegression::new_ascending(&points).unwrap(); + /// let regression = super::isotonic_regression::IsotonicRegression::new_ascending(&points).unwrap(); /// let interpolated_y = regression.interpolate(1.5).unwrap(); /// assert_eq!(interpolated_y, 1.75); /// ``` @@ -200,12 +200,12 @@ impl IsotonicRegression { /// /// ``` /// let points = vec![ - /// crate::point::Point::new(0.0, 1.0), - /// crate::point::Point::new(1.0, 2.0), - /// crate::point::Point::new(2.0, 1.5), - /// crate::point::Point::new(3.0, 3.0), + /// super::point::Point::new(0.0, 1.0), + /// super::point::Point::new(1.0, 2.0), + /// super::point::Point::new(2.0, 1.5), + /// super::point::Point::new(3.0, 3.0), /// ]; - /// let regression = crate::isotonic_regression::IsotonicRegression::new_ascending(&points).unwrap(); + /// let regression = super::isotonic_regression::IsotonicRegression::new_ascending(&points).unwrap(); /// assert_eq!(regression.get_points().len(), 3); /// ``` pub fn get_points(&self) -> &[Point] { @@ -218,12 +218,12 @@ impl IsotonicRegression { /// /// ``` /// let points = vec![ - /// crate::point::Point::new(0.0, 1.0), - /// crate::point::Point::new(1.0, 2.0), - /// crate::point::Point::new(2.0, 1.5), - /// crate::point::Point::new(3.0, 3.0), + /// super::point::Point::new(0.0, 1.0), + /// super::point::Point::new(1.0, 2.0), + /// super::point::Point::new(2.0, 1.5), + /// super::point::Point::new(3.0, 3.0), /// ]; - /// let regression = crate::isotonic_regression::IsotonicRegression::new_ascending(&points).unwrap(); + /// let regression = super::isotonic_regression::IsotonicRegression::new_ascending(&points).unwrap(); /// let centroid = regression.get_centroid_point().unwrap(); /// assert_eq!(*centroid.x(), 1.0); /// assert_eq!(*centroid.y(), 1.875); @@ -245,11 +245,11 @@ impl IsotonicRegression { /// # Examples /// /// ``` - /// let mut regression = crate::isotonic_regression::IsotonicRegression::new_ascending(&[ - /// crate::point::Point::new(0.0, 1.0), - /// crate::point::Point::new(2.0, 2.0), + /// let mut regression = super::isotonic_regression::IsotonicRegression::new_ascending(&[ + /// super::point::Point::new(0.0, 1.0), + /// super::point::Point::new(2.0, 2.0), /// ]).unwrap(); - /// regression.add_points(&[Point::new(1.0, 1.5)]); + /// regression.add_points(&[super::Point::new(1.0, 1.5)]); /// assert_eq!(regression.get_points().len(), 3); /// ``` pub fn add_points(&mut self, points: &[Point]) { @@ -272,12 +272,12 @@ impl IsotonicRegression { /// # Examples /// /// ``` - /// let mut regression = crate::isotonic_regression::IsotonicRegression::new_ascending(&[ - /// crate::point::Point::new(0.0, 1.0), - /// crate::point::Point::new(1.0, 2.0), - /// crate::point::Point::new(2.0, 3.0), + /// let mut regression = super::isotonic_regression::IsotonicRegression::new_ascending(&[ + /// super::point::Point::new(0.0, 1.0), + /// super::point::Point::new(1.0, 2.0), + /// super::point::Point::new(2.0, 3.0), /// ]).unwrap(); - /// regression.remove_points(&[Point::new(1.0, 2.0)]); + /// regression.remove_points(&[super::Point::new(1.0, 2.0)]); /// assert_eq!(regression.get_points().len(), 2); /// ``` pub fn remove_points(&mut self, points: &[Point]) { @@ -303,16 +303,16 @@ impl IsotonicRegression { /// # Examples /// /// ``` - /// use crate::point::Point; - /// use crate::isotonic_regression::IsotonicRegression; + /// use super::point::Point; + /// use super::isotonic_regression::IsotonicRegression; /// /// let points = vec![ - /// Point::new(0.0, 1.0), - /// Point::new(1.0, 2.0), - /// Point::new(2.0, 1.5), - /// Point::new(3.0, 3.0), + /// super::Point::new(0.0, 1.0), + /// super::Point::new(1.0, 2.0), + /// super::Point::new(2.0, 1.5), + /// super::Point::new(3.0, 3.0), /// ]; - /// let regression = IsotonicRegression::new_ascending(&points).unwrap(); + /// let regression = super::IsotonicRegression::new_ascending(&points).unwrap(); /// assert_eq!(regression.len(), 4); /// ``` pub fn len(&self) -> usize { @@ -324,7 +324,7 @@ impl IsotonicRegression { /// # Examples /// /// ``` - /// let regression: crate::isotonic_regression::IsotonicRegression = crate::isotonic_regression::IsotonicRegression::new_ascending(&[]).unwrap(); + /// let regression: super::isotonic_regression::IsotonicRegression = super::isotonic_regression::IsotonicRegression::new_ascending(&[]).unwrap(); /// assert!(regression.is_empty()); /// ``` #[must_use]