Mercurial > hg > octave-terminal
changeset 12000:a9d20c890190 release-3-2-x
avoid useless zero initialization when doing matrix multiply
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 18 Jun 2009 09:31:47 +0200 |
parents | 49affc56fac2 |
children | 21f9ff16c49a |
files | liboctave/CMatrix.cc liboctave/ChangeLog liboctave/dMatrix.cc liboctave/fCMatrix.cc liboctave/fMatrix.cc |
diffstat | 5 files changed, 24 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/CMatrix.cc +++ b/liboctave/CMatrix.cc @@ -2903,7 +2903,7 @@ { octave_idx_type a_len = a.length (); - retval.resize (len, a_len); + retval = ComplexMatrix (len, a_len); Complex *c = retval.fortran_vec (); F77_XFCN (zgemm, ZGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), @@ -3788,12 +3788,12 @@ else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) - retval.resize (a_nr, b_nc, 0.0); + retval = ComplexMatrix (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); - retval.resize (a_nr, b_nc); + retval = ComplexMatrix (a_nr, b_nc); Complex *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa, conja); @@ -3829,7 +3829,7 @@ octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); - retval.resize (a_nr, b_nc); + retval = ComplexMatrix (a_nr, b_nc); Complex *c = retval.fortran_vec (); if (b_nc == 1 && a_nr == 1)
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,11 @@ +2009-06-18 Jaroslav Hajek <highegg@gmail.com> + + * dMatrix.cc (xgemm): Replace resize() with uninitialized allocations + where appropriate. + * fMatrix.cc (xgemm): Ditto. + * CMatrix.cc (xgemm): Ditto. + * fCMatrix.cc (xgemm): Ditto. + 2009-06-09 Jaroslav Hajek <highegg@gmail.com> * cmd-edit.cc (command_editor::force_default_editor): New static
--- a/liboctave/dMatrix.cc +++ b/liboctave/dMatrix.cc @@ -2592,7 +2592,7 @@ { octave_idx_type a_len = a.length (); - retval.resize (len, a_len); + retval = Matrix (len, a_len); double *c = retval.fortran_vec (); F77_XFCN (dgemm, DGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), @@ -3188,12 +3188,12 @@ else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) - retval.resize (a_nr, b_nc, 0.0); + retval = Matrix (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); - retval.resize (a_nr, b_nc); + retval = Matrix (a_nr, b_nc); double *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa); @@ -3213,7 +3213,7 @@ octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); - retval.resize (a_nr, b_nc); + retval = Matrix (a_nr, b_nc); double *c = retval.fortran_vec (); if (b_nc == 1)
--- a/liboctave/fCMatrix.cc +++ b/liboctave/fCMatrix.cc @@ -2896,7 +2896,7 @@ { octave_idx_type a_len = a.length (); - retval.resize (len, a_len); + retval = FloatComplexMatrix (len, a_len); FloatComplex *c = retval.fortran_vec (); F77_XFCN (cgemm, CGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), @@ -3781,12 +3781,12 @@ else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) - retval.resize (a_nr, b_nc, 0.0); + retval = FloatComplexMatrix (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); - retval.resize (a_nr, b_nc); + retval = FloatComplexMatrix (a_nr, b_nc); FloatComplex *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa, conja); @@ -3822,7 +3822,7 @@ octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); - retval.resize (a_nr, b_nc); + retval = FloatComplexMatrix (a_nr, b_nc); FloatComplex *c = retval.fortran_vec (); if (b_nc == 1 && a_nr == 1)
--- a/liboctave/fMatrix.cc +++ b/liboctave/fMatrix.cc @@ -2591,7 +2591,7 @@ { octave_idx_type a_len = a.length (); - retval.resize (len, a_len); + retval = FloatMatrix (len, a_len); float *c = retval.fortran_vec (); F77_XFCN (sgemm, SGEMM, (F77_CONST_CHAR_ARG2 ("N", 1), @@ -3187,12 +3187,12 @@ else { if (a_nr == 0 || a_nc == 0 || b_nc == 0) - retval.resize (a_nr, b_nc, 0.0); + retval = FloatMatrix (a_nr, b_nc, 0.0); else if (a.data () == b.data () && a_nr == b_nc && transa != transb) { octave_idx_type lda = a.rows (); - retval.resize (a_nr, b_nc); + retval = FloatMatrix (a_nr, b_nc); float *c = retval.fortran_vec (); const char *ctransa = get_blas_trans_arg (transa); @@ -3212,7 +3212,7 @@ octave_idx_type lda = a.rows (), tda = a.cols (); octave_idx_type ldb = b.rows (), tdb = b.cols (); - retval.resize (a_nr, b_nc); + retval = FloatMatrix (a_nr, b_nc); float *c = retval.fortran_vec (); if (b_nc == 1)