Skip to content

Commit

Permalink
Refactor dgetrf function to use blocked algorithm and fix variable na…
Browse files Browse the repository at this point in the history
…ming
  • Loading branch information
ulises-jeremias committed Apr 28, 2024
1 parent 88776da commit b84f2ba
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lapack/lapack64/dgetrf.v
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,17 @@ pub fn dgetrf(m int, n int, mut a []f64, lda int, ipiv []int) {

if j + jb < n {
// 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)
mut slice1 := unsafe { a[j + jb..] }
dlaswp(j, mut slice1, lda, j, j + jb, ipiv[..j + jb], 1)

mut slice2 := unsafe { a[j * lda + j + jb..] }
blas.dtstrf(.left, .lower, .notrans, .unit, jb, n - j - jb, 1, a[j * lda + j..],
lda, a[j * lda + j + jb..], lda)
lda, mut slice2, lda)

if j + jb < m {
mut slice3 := unsafe { a[(j + jb) * lda + j + jb..] }
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)
lda, a[j * lda + j + jb..], lda, 1, mut slice3, lda)
}
}
}
Expand Down

0 comments on commit b84f2ba

Please sign in to comment.