lapack icon indicating copy to clipboard operation
lapack copied to clipboard

gbmv leaves result uninitialized for zero column matrix

Open amigalemming opened this issue 7 years ago • 2 comments

SGBMV(TRANS='N',M=5,N=0,KL=0,KU=0,ALPHA=1,A,LDA=1,X,INCX=1,BETA=0,Y,INCY=1)

This should fill Y with zeros but actually it leaves it uninitialized. Encountered in BLAS-3.6.0.

amigalemming avatar Apr 24 '18 06:04 amigalemming

Per specification, if N=0, the SGBMV routine exits immediately without referencing their vector or matrix arguments. So if N=0, you should not expect Y to be filled with zeros. More information at: http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=5&t=4196&p=10026

langou avatar Apr 24 '18 12:04 langou

It seems that the documentation is contradictory in this respect. The parameter description of sgbmv says:

When BETA is supplied as zero then Y need not be set on input.

and

On exit, Y is overwritten by the updated vector y.

amigalemming avatar Apr 24 '18 13:04 amigalemming