Skip to content

Commit

Permalink
Refactor dgetrf function to use blocked algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Apr 28, 2024
1 parent e82bda8 commit 88776da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
File renamed without changes.
10 changes: 9 additions & 1 deletion lapack/lapack64/dgetrf.v
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,15 @@ pub fn dgetrf(m int, n int, mut a []f64, lda int, ipiv []int) {
// apply interchanges to columns 1..j-1.
mut slice := unsafe { a[j + jb..] }
dlaswp(j, mut slice, lda, j, j + jb, ipiv[..j + jb], 1)
//

blas.dtstrf(.left, .lower, .notrans, .unit, jb, n - j - jb, 1, a[j * lda + j..],
lda, a[j * lda + j + jb..], lda)

if j + jb < m {
blas.dgemm(.notrans, .notrans, m - j - jb, n - j - jb, jb, -1, a[(j + jb) * lda + j..],
lda, a[j * lda + j + jb..], lda, 1, a[(j + jb) * lda + j + jb..],
lda)
}
}
}
}
2 changes: 1 addition & 1 deletion ml/knn.v
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub struct PredictConfig {
pub:
max_iter int
k int
to_pred []f64
to_pred []f64
}

// predict will find the `k` points nearest to the specified `to_pred`.
Expand Down

0 comments on commit 88776da

Please sign in to comment.