Mercurial > octave-nkf
comparison liboctave/array/fMatrix.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 |
---|---|
2024 } | 2024 } |
2025 | 2025 |
2026 static FloatMatrix | 2026 static FloatMatrix |
2027 stack_complex_matrix (const FloatComplexMatrix& cm) | 2027 stack_complex_matrix (const FloatComplexMatrix& cm) |
2028 { | 2028 { |
2029 octave_idx_type m = cm.rows (), n = cm.cols (), nel = m*n; | 2029 octave_idx_type m = cm.rows (); |
2030 octave_idx_type n = cm.cols (); | |
2031 octave_idx_type nel = m*n; | |
2030 FloatMatrix retval (m, 2*n); | 2032 FloatMatrix retval (m, 2*n); |
2031 const FloatComplex *cmd = cm.data (); | 2033 const FloatComplex *cmd = cm.data (); |
2032 float *rd = retval.fortran_vec (); | 2034 float *rd = retval.fortran_vec (); |
2033 for (octave_idx_type i = 0; i < nel; i++) | 2035 for (octave_idx_type i = 0; i < nel; i++) |
2034 { | 2036 { |
2039 } | 2041 } |
2040 | 2042 |
2041 static FloatComplexMatrix | 2043 static FloatComplexMatrix |
2042 unstack_complex_matrix (const FloatMatrix& sm) | 2044 unstack_complex_matrix (const FloatMatrix& sm) |
2043 { | 2045 { |
2044 octave_idx_type m = sm.rows (), n = sm.cols () / 2, nel = m*n; | 2046 octave_idx_type m = sm.rows (); |
2047 octave_idx_type n = sm.cols () / 2; | |
2048 octave_idx_type nel = m*n; | |
2045 FloatComplexMatrix retval (m, n); | 2049 FloatComplexMatrix retval (m, n); |
2046 const float *smd = sm.data (); | 2050 const float *smd = sm.data (); |
2047 FloatComplex *rd = retval.fortran_vec (); | 2051 FloatComplex *rd = retval.fortran_vec (); |
2048 for (octave_idx_type i = 0; i < nel; i++) | 2052 for (octave_idx_type i = 0; i < nel; i++) |
2049 rd[i] = FloatComplex (smd[i], smd[nel+i]); | 2053 rd[i] = FloatComplex (smd[i], smd[nel+i]); |
3201 xgemm (const FloatMatrix& a, const FloatMatrix& b, | 3205 xgemm (const FloatMatrix& a, const FloatMatrix& b, |
3202 blas_trans_type transa, blas_trans_type transb) | 3206 blas_trans_type transa, blas_trans_type transb) |
3203 { | 3207 { |
3204 FloatMatrix retval; | 3208 FloatMatrix retval; |
3205 | 3209 |
3206 bool tra = transa != blas_no_trans, trb = transb != blas_no_trans; | 3210 bool tra = transa != blas_no_trans; |
3211 bool trb = transb != blas_no_trans; | |
3207 | 3212 |
3208 octave_idx_type a_nr = tra ? a.cols () : a.rows (); | 3213 octave_idx_type a_nr = tra ? a.cols () : a.rows (); |
3209 octave_idx_type a_nc = tra ? a.rows () : a.cols (); | 3214 octave_idx_type a_nc = tra ? a.rows () : a.cols (); |
3210 | 3215 |
3211 octave_idx_type b_nr = trb ? b.cols () : b.rows (); | 3216 octave_idx_type b_nr = trb ? b.cols () : b.rows (); |
3236 retval.xelem (j,i) = retval.xelem (i,j); | 3241 retval.xelem (j,i) = retval.xelem (i,j); |
3237 | 3242 |
3238 } | 3243 } |
3239 else | 3244 else |
3240 { | 3245 { |
3241 octave_idx_type lda = a.rows (), tda = a.cols (); | 3246 octave_idx_type lda = a.rows (); |
3242 octave_idx_type ldb = b.rows (), tdb = b.cols (); | 3247 octave_idx_type tda = a.cols (); |
3248 octave_idx_type ldb = b.rows (); | |
3249 octave_idx_type tdb = b.cols (); | |
3243 | 3250 |
3244 retval = FloatMatrix (a_nr, b_nc); | 3251 retval = FloatMatrix (a_nr, b_nc); |
3245 float *c = retval.fortran_vec (); | 3252 float *c = retval.fortran_vec (); |
3246 | 3253 |
3247 if (b_nc == 1) | 3254 if (b_nc == 1) |