Mercurial > octave-libtiff
comparison liboctave/numeric/bsxfun.h @ 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 | ebb3ef964372 |
children | 6113e0c6920b |
comparison
equal
deleted
inserted
replaced
18083:938f01339043 | 18084:8e056300994b |
---|---|
36 is_valid_bsxfun (const std::string& name, const dim_vector& dx, | 36 is_valid_bsxfun (const std::string& name, const dim_vector& dx, |
37 const dim_vector& dy) | 37 const dim_vector& dy) |
38 { | 38 { |
39 for (int i = 0; i < std::min (dx.length (), dy.length ()); i++) | 39 for (int i = 0; i < std::min (dx.length (), dy.length ()); i++) |
40 { | 40 { |
41 octave_idx_type xk = dx(i), yk = dy(i); | 41 octave_idx_type xk = dx(i); |
42 octave_idx_type yk = dy(i); | |
42 // Check the three conditions for valid bsxfun dims | 43 // Check the three conditions for valid bsxfun dims |
43 if (! ( (xk == yk) || (xk == 1 && yk > 1) || (xk > 1 && yk == 1))) | 44 if (! ( (xk == yk) || (xk == 1 && yk > 1) || (xk > 1 && yk == 1))) |
44 return false; | 45 return false; |
45 } | 46 } |
46 | 47 |
57 inline | 58 inline |
58 bool | 59 bool |
59 is_valid_inplace_bsxfun (const std::string& name, const dim_vector& dr, | 60 is_valid_inplace_bsxfun (const std::string& name, const dim_vector& dr, |
60 const dim_vector& dx) | 61 const dim_vector& dx) |
61 { | 62 { |
62 octave_idx_type drl = dr.length (), dxl = dx.length (); | 63 octave_idx_type drl = dr.length (); |
64 octave_idx_type dxl = dx.length (); | |
63 if (drl < dxl) | 65 if (drl < dxl) |
64 return false; | 66 return false; |
65 | 67 |
66 for (int i = 0; i < drl; i++) | 68 for (int i = 0; i < drl; i++) |
67 { | 69 { |
68 octave_idx_type rk = dr(i), xk = dx(i); | 70 octave_idx_type rk = dr(i); |
71 octave_idx_type xk = dx(i); | |
69 | 72 |
70 // Only two valid canditions to check; can't stretch rk | 73 // Only two valid canditions to check; can't stretch rk |
71 if (! ( (rk == xk) || (rk > 1 && xk == 1))) | 74 if (! ( (rk == xk) || (rk > 1 && xk == 1))) |
72 return false; | 75 return false; |
73 } | 76 } |