# HG changeset patch # User John W. Eaton # Date 1295625921 18000 # Node ID a9cf422ed849ac6f4efe4b9cec03b3ec7e2a51fd # Parent 5ec6aa05638dd34b09a4ec4bb32803a0d6e2b583 avoid apparent bug in ATLAS versions of CHERK/ZHERK diff --git a/liboctave/CMatrix.cc b/liboctave/CMatrix.cc --- a/liboctave/CMatrix.cc +++ b/liboctave/CMatrix.cc @@ -3754,7 +3754,12 @@ { octave_idx_type lda = a.rows (); - retval = ComplexMatrix (a_nr, b_nc); + // FIXME -- looking at the reference BLAS, it appears that it + // should not be necessary to initialize the output matrix if + // BETA is 0 in the call to ZHERK, but ATLAS appears to + // use the result matrix before zeroing the elements. + + retval = ComplexMatrix (a_nr, b_nc, 0.0); Complex *c = retval.fortran_vec (); const char ctra = get_blas_trans_arg (tra, cja); diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2011-01-21 John W. Eaton + + * CMatrix.cc (xgemm): Initialize output matrix for call to ZHERK. + * fCMatrix.cc (xgemm): Initialize output matrix for call to CHERK. + 2011-01-20 John W. Eaton * Array-b.cc, Array-d.cc, Array-f.cc, Array-util.cc, diff --git a/liboctave/fCMatrix.cc b/liboctave/fCMatrix.cc --- a/liboctave/fCMatrix.cc +++ b/liboctave/fCMatrix.cc @@ -3750,7 +3750,12 @@ { octave_idx_type lda = a.rows (); - retval = FloatComplexMatrix (a_nr, b_nc); + // FIXME -- looking at the reference BLAS, it appears that it + // should not be necessary to initialize the output matrix if + // BETA is 0 in the call to CHERK, but ATLAS appears to + // use the result matrix before zeroing the elements. + + retval = FloatComplexMatrix (a_nr, b_nc, 0.0); FloatComplex *c = retval.fortran_vec (); const char ctra = get_blas_trans_arg (tra, cja);