mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 04:00:01 +00:00
Refactor Axis enum definition: move to appropriate location and remove duplicate
This commit is contained in:
parent
6804e7ca5a
commit
9b96dad956
@ -192,6 +192,16 @@ impl<'a, T> MatrixRow<'a, T> {
|
|||||||
(0..self.matrix.cols).map(move |c| &self.matrix[(self.row, c)])
|
(0..self.matrix.cols).map(move |c| &self.matrix[(self.row, c)])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Specifies the axis along which to perform a reduction operation.
|
||||||
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||||
|
pub enum Axis {
|
||||||
|
/// Apply reduction along columns (vertical axis).
|
||||||
|
Col,
|
||||||
|
/// Apply reduction along rows (horizontal axis).
|
||||||
|
Row,
|
||||||
|
}
|
||||||
|
|
||||||
/// A trait to turn either a Matrix<T> or a scalar T into a Vec<T> of
|
/// A trait to turn either a Matrix<T> or a scalar T into a Vec<T> of
|
||||||
/// length rows*cols (broadcasting the scalar).
|
/// length rows*cols (broadcasting the scalar).
|
||||||
pub trait Broadcastable<T> {
|
pub trait Broadcastable<T> {
|
||||||
@ -335,14 +345,6 @@ impl Not for Matrix<bool> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Specifies the axis along which to perform a reduction operation.
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
|
||||||
pub enum Axis {
|
|
||||||
/// Apply reduction along columns (vertical axis).
|
|
||||||
Col,
|
|
||||||
/// Apply reduction along rows (horizontal axis).
|
|
||||||
Row,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user