mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 04:00:01 +00:00
Enhance documentation with usage examples for boolean and series operations
This commit is contained in:
parent
f7325a9558
commit
676f78bb1e
@ -1,3 +1,14 @@
|
|||||||
|
//! Logical reductions for boolean matrices.
|
||||||
|
//!
|
||||||
|
//! The [`BoolOps`] trait mirrors common boolean aggregations such as `any` and
|
||||||
|
//! `all` over rows or columns of a [`BoolMatrix`].
|
||||||
|
//!
|
||||||
|
//! ```
|
||||||
|
//! use rustframe::matrix::{BoolMatrix, BoolOps};
|
||||||
|
//!
|
||||||
|
//! let m = BoolMatrix::from_vec(vec![true, false], 2, 1);
|
||||||
|
//! assert!(m.any());
|
||||||
|
//! ```
|
||||||
use crate::matrix::{Axis, BoolMatrix};
|
use crate::matrix::{Axis, BoolMatrix};
|
||||||
|
|
||||||
/// Boolean operations on `Matrix<bool>`
|
/// Boolean operations on `Matrix<bool>`
|
||||||
|
@ -1,3 +1,18 @@
|
|||||||
|
//! Core matrix types and operations.
|
||||||
|
//!
|
||||||
|
//! The [`Matrix`](crate::matrix::Matrix) struct provides a simple column‑major 2D array with a
|
||||||
|
//! suite of numeric helpers. Additional traits like [`SeriesOps`](crate::matrix::SeriesOps) and
|
||||||
|
//! [`BoolOps`](crate::matrix::BoolOps) extend functionality for common statistics and logical reductions.
|
||||||
|
//!
|
||||||
|
//! # Examples
|
||||||
|
//!
|
||||||
|
//! ```
|
||||||
|
//! use rustframe::matrix::Matrix;
|
||||||
|
//!
|
||||||
|
//! let m = Matrix::from_cols(vec![vec![1, 2], vec![3, 4]]);
|
||||||
|
//! assert_eq!(m.shape(), (2, 2));
|
||||||
|
//! assert_eq!(m[(0,1)], 3);
|
||||||
|
//! ```
|
||||||
pub mod boolops;
|
pub mod boolops;
|
||||||
pub mod mat;
|
pub mod mat;
|
||||||
pub mod seriesops;
|
pub mod seriesops;
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
//! Numeric reductions and transformations over matrix axes.
|
||||||
|
//!
|
||||||
|
//! [`SeriesOps`] provides methods like [`SeriesOps::sum_vertical`] or
|
||||||
|
//! [`SeriesOps::map`] that operate on [`FloatMatrix`] values.
|
||||||
|
//!
|
||||||
|
//! ```
|
||||||
|
//! use rustframe::matrix::{Matrix, SeriesOps};
|
||||||
|
//!
|
||||||
|
//! let m = Matrix::from_cols(vec![vec![1.0, 2.0], vec![3.0, 4.0]]);
|
||||||
|
//! assert_eq!(m.sum_horizontal(), vec![4.0, 6.0]);
|
||||||
|
//! ```
|
||||||
use crate::matrix::{Axis, BoolMatrix, FloatMatrix};
|
use crate::matrix::{Axis, BoolMatrix, FloatMatrix};
|
||||||
|
|
||||||
/// "Series-like" helpers that work along a single axis.
|
/// "Series-like" helpers that work along a single axis.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user