Mercurial > octave-nkf
comparison liboctave/array/dMatrix.cc @ 18084:8e056300994b
Follow coding convention of defining and initializing only 1 variable per line in liboctave.
* liboctave/array/Array-b.cc, liboctave/array/Array-util.cc,
liboctave/array/Array.cc, liboctave/array/CDiagMatrix.cc,
liboctave/array/CMatrix.cc, liboctave/array/CSparse.cc,
liboctave/array/MDiagArray2.cc, liboctave/array/MatrixType.cc,
liboctave/array/PermMatrix.cc, liboctave/array/Sparse.cc,
liboctave/array/Sparse.h, liboctave/array/boolSparse.cc,
liboctave/array/dDiagMatrix.cc, liboctave/array/dMatrix.cc,
liboctave/array/dSparse.cc, liboctave/array/dim-vector.cc,
liboctave/array/fCDiagMatrix.cc, liboctave/array/fCMatrix.cc,
liboctave/array/fDiagMatrix.cc, liboctave/array/fMatrix.cc,
liboctave/array/idx-vector.cc, liboctave/array/idx-vector.h,
liboctave/numeric/CmplxLU.cc, liboctave/numeric/CmplxQR.cc,
liboctave/numeric/base-qr.cc, liboctave/numeric/bsxfun-defs.cc,
liboctave/numeric/bsxfun.h, liboctave/numeric/dbleLU.cc,
liboctave/numeric/dbleQR.cc, liboctave/numeric/fCmplxLU.cc,
liboctave/numeric/fCmplxQR.cc, liboctave/numeric/floatLU.cc,
liboctave/numeric/floatQR.cc, liboctave/numeric/lo-specfun.cc,
liboctave/numeric/oct-convn.cc, liboctave/numeric/oct-norm.cc,
liboctave/numeric/sparse-dmsolve.cc, liboctave/operators/mx-inlines.cc,
liboctave/operators/mx-op-defs.h, liboctave/util/caseless-str.h,
liboctave/util/kpse.cc, liboctave/util/lo-utils.cc,
liboctave/util/oct-binmap.h, liboctave/util/oct-cmplx.h,
liboctave/util/oct-inttypes.cc, liboctave/util/oct-inttypes.h,
liboctave/util/oct-sort.cc:
Follow coding convention of defining and initializing only 1 variable per line in liboctave.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 04 Dec 2013 22:13:18 -0800 |
parents | 938f01339043 |
children | cb37b17b6091 b314efd58072 |
comparison
equal
deleted
inserted
replaced
18083:938f01339043 | 18084:8e056300994b |
---|---|
2010 } | 2010 } |
2011 | 2011 |
2012 static Matrix | 2012 static Matrix |
2013 stack_complex_matrix (const ComplexMatrix& cm) | 2013 stack_complex_matrix (const ComplexMatrix& cm) |
2014 { | 2014 { |
2015 octave_idx_type m = cm.rows (), n = cm.cols (), nel = m*n; | 2015 octave_idx_type m = cm.rows (); |
2016 octave_idx_type n = cm.cols (); | |
2017 octave_idx_type nel = m*n; | |
2016 Matrix retval (m, 2*n); | 2018 Matrix retval (m, 2*n); |
2017 const Complex *cmd = cm.data (); | 2019 const Complex *cmd = cm.data (); |
2018 double *rd = retval.fortran_vec (); | 2020 double *rd = retval.fortran_vec (); |
2019 for (octave_idx_type i = 0; i < nel; i++) | 2021 for (octave_idx_type i = 0; i < nel; i++) |
2020 { | 2022 { |
2025 } | 2027 } |
2026 | 2028 |
2027 static ComplexMatrix | 2029 static ComplexMatrix |
2028 unstack_complex_matrix (const Matrix& sm) | 2030 unstack_complex_matrix (const Matrix& sm) |
2029 { | 2031 { |
2030 octave_idx_type m = sm.rows (), n = sm.cols () / 2, nel = m*n; | 2032 octave_idx_type m = sm.rows (); |
2033 octave_idx_type n = sm.cols () / 2; | |
2034 octave_idx_type nel = m*n; | |
2031 ComplexMatrix retval (m, n); | 2035 ComplexMatrix retval (m, n); |
2032 const double *smd = sm.data (); | 2036 const double *smd = sm.data (); |
2033 Complex *rd = retval.fortran_vec (); | 2037 Complex *rd = retval.fortran_vec (); |
2034 for (octave_idx_type i = 0; i < nel; i++) | 2038 for (octave_idx_type i = 0; i < nel; i++) |
2035 rd[i] = Complex (smd[i], smd[nel+i]); | 2039 rd[i] = Complex (smd[i], smd[nel+i]); |
3184 xgemm (const Matrix& a, const Matrix& b, | 3188 xgemm (const Matrix& a, const Matrix& b, |
3185 blas_trans_type transa, blas_trans_type transb) | 3189 blas_trans_type transa, blas_trans_type transb) |
3186 { | 3190 { |
3187 Matrix retval; | 3191 Matrix retval; |
3188 | 3192 |
3189 bool tra = transa != blas_no_trans, trb = transb != blas_no_trans; | 3193 bool tra = transa != blas_no_trans; |
3194 bool trb = transb != blas_no_trans; | |
3190 | 3195 |
3191 octave_idx_type a_nr = tra ? a.cols () : a.rows (); | 3196 octave_idx_type a_nr = tra ? a.cols () : a.rows (); |
3192 octave_idx_type a_nc = tra ? a.rows () : a.cols (); | 3197 octave_idx_type a_nc = tra ? a.rows () : a.cols (); |
3193 | 3198 |
3194 octave_idx_type b_nr = trb ? b.cols () : b.rows (); | 3199 octave_idx_type b_nr = trb ? b.cols () : b.rows (); |
3219 retval.xelem (j,i) = retval.xelem (i,j); | 3224 retval.xelem (j,i) = retval.xelem (i,j); |
3220 | 3225 |
3221 } | 3226 } |
3222 else | 3227 else |
3223 { | 3228 { |
3224 octave_idx_type lda = a.rows (), tda = a.cols (); | 3229 octave_idx_type lda = a.rows (); |
3225 octave_idx_type ldb = b.rows (), tdb = b.cols (); | 3230 octave_idx_type tda = a.cols (); |
3231 octave_idx_type ldb = b.rows (); | |
3232 octave_idx_type tdb = b.cols (); | |
3226 | 3233 |
3227 retval = Matrix (a_nr, b_nc); | 3234 retval = Matrix (a_nr, b_nc); |
3228 double *c = retval.fortran_vec (); | 3235 double *c = retval.fortran_vec (); |
3229 | 3236 |
3230 if (b_nc == 1) | 3237 if (b_nc == 1) |