Mercurial > octave-nkf
comparison liboctave/util/oct-cmplx.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 | 49a5a4be04a1 |
children | bdf90710dddf |
comparison
equal
deleted
inserted
replaced
18083:938f01339043 | 18084:8e056300994b |
---|---|
38 | 38 |
39 #define DEF_COMPLEXR_COMP(OP, OPS) \ | 39 #define DEF_COMPLEXR_COMP(OP, OPS) \ |
40 template <class T> \ | 40 template <class T> \ |
41 inline bool operator OP (const std::complex<T>& a, const std::complex<T>& b) \ | 41 inline bool operator OP (const std::complex<T>& a, const std::complex<T>& b) \ |
42 { \ | 42 { \ |
43 FLOAT_TRUNCATE const T ax = std::abs (a), bx = std::abs (b); \ | 43 FLOAT_TRUNCATE const T ax = std::abs (a); \ |
44 FLOAT_TRUNCATE const T bx = std::abs (b); \ | |
44 if (ax == bx) \ | 45 if (ax == bx) \ |
45 { \ | 46 { \ |
46 FLOAT_TRUNCATE const T ay = std::arg (a), by = std::arg (b); \ | 47 FLOAT_TRUNCATE const T ay = std::arg (a); \ |
48 FLOAT_TRUNCATE const T by = std::arg (b); \ | |
47 return ay OP by; \ | 49 return ay OP by; \ |
48 } \ | 50 } \ |
49 else \ | 51 else \ |
50 return ax OPS bx; \ | 52 return ax OPS bx; \ |
51 } \ | 53 } \ |
52 template <class T> \ | 54 template <class T> \ |
53 inline bool operator OP (const std::complex<T>& a, T b) \ | 55 inline bool operator OP (const std::complex<T>& a, T b) \ |
54 { \ | 56 { \ |
55 FLOAT_TRUNCATE const T ax = std::abs (a), bx = std::abs (b); \ | 57 FLOAT_TRUNCATE const T ax = std::abs (a); \ |
58 FLOAT_TRUNCATE const T bx = std::abs (b); \ | |
56 if (ax == bx) \ | 59 if (ax == bx) \ |
57 { \ | 60 { \ |
58 FLOAT_TRUNCATE const T ay = std::arg (a); \ | 61 FLOAT_TRUNCATE const T ay = std::arg (a); \ |
59 return ay OP 0; \ | 62 return ay OP 0; \ |
60 } \ | 63 } \ |
62 return ax OPS bx; \ | 65 return ax OPS bx; \ |
63 } \ | 66 } \ |
64 template <class T> \ | 67 template <class T> \ |
65 inline bool operator OP (T a, const std::complex<T>& b) \ | 68 inline bool operator OP (T a, const std::complex<T>& b) \ |
66 { \ | 69 { \ |
67 FLOAT_TRUNCATE const T ax = std::abs (a), bx = std::abs (b); \ | 70 FLOAT_TRUNCATE const T ax = std::abs (a); \ |
71 FLOAT_TRUNCATE const T bx = std::abs (b); \ | |
68 if (ax == bx) \ | 72 if (ax == bx) \ |
69 { \ | 73 { \ |
70 FLOAT_TRUNCATE const T by = std::arg (b); \ | 74 FLOAT_TRUNCATE const T by = std::arg (b); \ |
71 return 0 OP by; \ | 75 return 0 OP by; \ |
72 } \ | 76 } \ |