1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! ## Description
//!
//! A simple library/CLI app for matrix math in Rust using Clap and thiserror.
//!
//! ### Getting started
//!
//! ```rs
//! use matrix::prelude::*;
//!
//! fn interactive_matrices_example() -> Result<(), Error> {
//! let matrix1 = matrix(1, None, None);
//!
//! // By calling matrix2 with the length parameters of matrix1 like so. Doing the operations
//! // unchecked is **SAFE**.
//! let matrix2 = matrix(2, Some(matrix1.len()), Some(matrix1[0].len()));
//!
//! let sum = matrix_operation_unchecked(MatrixOperation::Addition, &matrix1, &matrix2);
//! println!("Sum:\n{:#?}", sum);
//!
//! let diff = matrix_operation_unchecked(MatrixOperation::Subtraction, &matrix1, &matrix2);
//! println!("Difference:\n{:#?}", diff);
//!
//! let product = matrix_operation_unchecked(MatrixOperation::Multiplication, &matrix1, &matrix2);
//! println!("Product:\n{:#?}", product);
//!
//! Ok(())
//! }
//!
//! fn main() -> Result<(), Error> {
//! let args = Args::parse();
//!
//! if args.interactive {
//! interactive_matrices_example()?;
//! }
//!
//! Ok(())
//! }
//! ```
//!
//!
//!
// #![warn(missing_docs)]