Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garg3133/matrix-ops-basic
https://github.com/garg3133/matrix-ops-basic
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/garg3133/matrix-ops-basic
- Owner: garg3133
- Created: 2024-06-30T18:26:08.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-31T06:44:49.000Z (4 months ago)
- Last Synced: 2024-10-14T09:41:54.895Z (about 1 month ago)
- Language: Rust
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# matrix-ops
## Usage
### 1. Create a matrix
**Usage:** `cargo run --bin create [] [] [--out ]`
```sh
# create and output a matrix to 'matrix.txt' file.
# program will ask for matrix size.
cargo run --bin create# output a square matrix of size 8 to 'matrix.txt' file.
cargo run --bin create 8# output a matrix of size 8x10 to 'matrix.txt' file.
cargo run --bin create 8 10# output a square matrix of size 10 to 'new_matrix.txt' file.
cargo run --bin create 10 --out new_matrix.txt# output a matrix of size 10x5 to 'brand_new_matrix.txt' file.
cargo run --bin create 10 5 --out brand_new_matrix.txt# output a matrix to 'matrix_2.txt' file.
# program will ask for matrix size.
#
# if the first argument is a flag, it should be preceded by a `--`.
cargo run --bin create -- --out matrix_2.txt
```### 2. Calculate determinant of a square matrix
**Usage:** `cargo run --bin determinant `
```sh
# calculate determinant of the square matrix
# present in file `matrix1.txt`.
cargo run --bin determinant matrix1.txt# calculate determinant of the square matrix
# present in file `matrix.txt` (default).
cargo run --bin determinant
```### 3. Multiply two matrices
**Usage:** `cargo run --bin multiply `
```sh
# multiply the matrices present in files `matrix1.txt`
# and `matrix2.txt` in the same order.
cargo run --bin multiply matrix1.txt matrix2.txt
```**Note:** For the multiplication to work, the no. of columns in the first matrix
should be equal to the number of rows in the second.