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
//! The crate provides basic functionalities to create 2d matrices and apply basic algebra operations.
//! This is intended to be a toy implementation and not suitable for production.
//!
//!
//! ## Examples
//!
//! Create an identity matrix
//!
//! ```
//! use rmat::Matrix;
//! let s = 3; // size of identity matrix
//! let x = Matrix::id(s);
//! x.show();
//! ```
//!
//! Create a matrix of random numbers between 0.0 and 1.0
//!
//! ```
//! use rmat::Matrix;
//! let r = 3; // number of rows
//! let c = 5; // number of columns
//! let x = Matrix::rand(r,c);
//! x.show();
//! ```
//!
//! Create two matrices and calculate the dot product
//!
//! ```
//! use rmat::Matrix;
//! let r1 = 3; // matrix 1 number of rows
//! let c1 = 5; // matrix 1 number of columns
//! let m1 = Matrix::rand(r1,c1);
//! let r2 = 5; // matrix 2 number of rows - NOTE: c1 and r2 are equal
//! let c2 = 2; // matrix 2 number of columns
//! let m2 = Matrix::rand(r2,c2);
//! let mdot = m1.dot(&m2);
//! mdot.show();
//! ```
pub use crateMatrix;