Created
March 25, 2023 16:12
-
-
Save samueleresca/f6a3e5e4b0041b397038ac3652f05d13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Returns the result of the matrix multiplication. | |
/// | |
/// # Arguments | |
/// | |
/// * `n` - The dimension of the matrix. | |
pub fn non_optimized(n: usize) -> Vec<Vec<f64>> { | |
let m1 = generate_matrix(n); | |
let m2 = m1.clone(); | |
let mut res = vec![vec![0.0; n]; n]; | |
for i in 0..n { | |
for j in 0..n { | |
for k in 0..n { | |
res[i][j] += m1[i][k] * m2[k][j]; | |
} | |
} | |
} | |
res | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment