i think there is a small bug in the syrk implementation.
code in question:
you are passing a.rows() as argument 4 whereas the blas documentation specifies argument 4 as the order of c. the order of c is c.rows() or alternatively c.cols() since c.rows() == c.cols().
N Order of matrix C.
you are passing a.cols() as argument 5 whereas the blas documentation specifies argument 5 as (translated to rust in the context of that function):
match trans {
Transpose::NoTrans => a.cols(),
Transpose::Trans => a.rows(),
Transpose::ConjTrans => a.rows(),
}
Number of columns in matrix A (or number of rows if matrix A is transposed).
On entry with TRANS = 'N' or 'n', K specifies the number of columns of the matrix A, and on entry with TRANS = 'T' or 't' or 'C' or 'c', K specifies the number of rows of the matrix A. K must be at least zero.
sources:
https://developer.apple.com/library/mac/documentation/Accelerate/Reference/BLAS_Ref/index.html#//apple_ref/c/func/cblas_ssyrk
http://www.netlib.org/lapack/explore-html/db/dc9/group__single__blas__level3.html#gae953a93420ca237670f5c67bbde9d9ff
https://software.intel.com/en-us/node/468490
this bug prevents me from using syrk in any meaningful way: i always get an error from blas.
i'd be happy to fix this, write tests and do a PR.
let me know.
i'd also go over the other implementations (syr2k, etc) and audit the arguments.
i think there is a small bug in the
syrkimplementation.code in question:
rust-blas/src/matrix/ops.rs
Line 203 in 849c703
you are passing
a.rows()as argument 4 whereas the blas documentation specifies argument 4 as the order of c. the order of c isc.rows()or alternativelyc.cols()sincec.rows() == c.cols().you are passing
a.cols()as argument 5 whereas the blas documentation specifies argument 5 as (translated to rust in the context of that function):sources:
https://developer.apple.com/library/mac/documentation/Accelerate/Reference/BLAS_Ref/index.html#//apple_ref/c/func/cblas_ssyrk
http://www.netlib.org/lapack/explore-html/db/dc9/group__single__blas__level3.html#gae953a93420ca237670f5c67bbde9d9ff
https://software.intel.com/en-us/node/468490
this bug prevents me from using
syrkin any meaningful way: i always get an error from blas.i'd be happy to fix this, write tests and do a PR.
let me know.
i'd also go over the other implementations (
syr2k, etc) and audit the arguments.