Skip to content

Commit

Permalink
Take variable declaration outside of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
yfnaji committed Apr 25, 2024
1 parent 508f9a7 commit a5105b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/instruments/options/finite_difference_pricer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ impl FiniteDifferencePricer {
fn matrix_multiply_vector(&self, A: &[Vec<f64>], v: Vec<f64>) -> Vec<f64> {

let mut Av: Vec<f64> = Vec::new();
let mut value: f64;

match A[0].len() {
n if n == v.len() => {
for row in A {
let mut value: f64 = 0.0;
value = 0.0;
for (a, b) in row.iter().zip(&v) {
value += a * b;
}
Expand Down

0 comments on commit a5105b6

Please sign in to comment.