In Dtrsm, the size of a is checked assuming it is either an m x n or an n x m matrix. However, this is incorrect. If it is on the left, a is an m x m matrix, and if it is on the right, a is an n x n matrix.
Changing the lines to
if s == blas.Left {
if lda(m-1)+m > len(a) || lda < max(1, m) {
panic("cblas: index of a out of range")
}
} else {
if lda(n-1)+n > len(a) || lda < max(1, n) {
panic("cblas: index of a out of range")
}
}
In Dtrsm, the size of a is checked assuming it is either an m x n or an n x m matrix. However, this is incorrect. If it is on the left, a is an m x m matrix, and if it is on the right, a is an n x n matrix.
Changing the lines to if s == blas.Left { if lda(m-1)+m > len(a) || lda < max(1, m) { panic("cblas: index of a out of range") } } else { if lda(n-1)+n > len(a) || lda < max(1, n) { panic("cblas: index of a out of range") } }
fixes the problem.