Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
vanilla-extracts committed Nov 17, 2023
1 parent b9c3696 commit c4ddaef
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,21 @@ You can use vectors!
- added the `norm` function to compute the norm
- dot product between two vectors ( * operator)

Functions added:
- norm

![](docs/assets/vector.png)

## Matrices !

As of 2.7.0 matrix algebra is implemented (using lup reduction)

- you can add matrices
- multiply compatible matrices

functions added
- transpose
- invert
- det

![](docs/assets/matrix.png)
Binary file added docs/assets/matrix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/interpreting/stdlib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ pub fn det_matrix(
None => Parameters::Identifier("This variable is not initialized yet".to_string()),
Some(ref t) => match t.get(s.as_str()) {
None => Parameters::Null,
Some(t) => transpose_matrices(&vec![t.clone()], ram),
Some(t) => det_matrix(&vec![t.clone()], ram),
},
},
_ => Parameters::Null,
Expand Down Expand Up @@ -1017,7 +1017,7 @@ pub fn inverse_matrix(
None => Parameters::Identifier("This variable is not initialized yet".to_string()),
Some(ref t) => match t.get(s.as_str()) {
None => Parameters::Null,
Some(t) => transpose_matrices(&vec![t.clone()], ram),
Some(t) => inverse_matrix(&vec![t.clone()], ram),
},
},
_ => Parameters::Null,
Expand Down

0 comments on commit c4ddaef

Please sign in to comment.