summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/complex
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2016-06-16 14:47:35 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2016-06-16 14:47:35 +0100
commit33ac58d5299c7eba6be3c112817fe917bed48043 (patch)
tree2e1904833bafbe7ef8decd985f84ec94de07c8cb /libstdc++-v3/include/std/complex
parent1dc8d15bc6d7d55c7731093e0a8f280fc5477381 (diff)
downloadgcc-33ac58d5299c7eba6be3c112817fe917bed48043.tar.gz
Remove trailing whitespace from libstdc++ headers
* include/std/array: Remove trailing whitespace. * include/std/atomic: Likewise. * include/std/bitset: Likewise. * include/std/chrono: Likewise. * include/std/complex: Likewise. * include/std/condition_variable: Likewise. * include/std/fstream: Likewise. * include/std/functional: Likewise. * include/std/future: Likewise. * include/std/iomanip: Likewise. * include/std/iosfwd: Likewise. * include/std/istream: Likewise. * include/std/limits: Likewise. * include/std/ratio: Likewise. * include/std/scoped_allocator: Likewise. * include/std/sstream: Likewise. * include/std/stdexcept: Likewise. * include/std/string: Likewise. * include/std/system_error: Likewise. * include/std/thread: Likewise. * include/std/tuple: Likewise. * include/std/type_traits: Likewise. * include/std/utility: Likewise. * include/std/valarray: Likewise. * include/std/vector: Likewise. From-SVN: r237528
Diffstat (limited to 'libstdc++-v3/include/std/complex')
-rw-r--r--libstdc++-v3/include/std/complex134
1 files changed, 67 insertions, 67 deletions
diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex
index 9b7c1d7279e..bb09b7d0aa7 100644
--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -93,7 +93,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// Return @a x to the @a y'th power.
template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&, const _Tp&);
/// Return @a x to the @a y'th power.
- template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&,
+ template<typename _Tp> complex<_Tp> pow(const complex<_Tp>&,
const complex<_Tp>&);
/// Return @a x to the @a y'th power.
template<typename _Tp> complex<_Tp> pow(const _Tp&, const complex<_Tp>&);
@@ -107,8 +107,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp> complex<_Tp> tan(const complex<_Tp>&);
/// Return complex hyperbolic tangent of @a z.
template<typename _Tp> complex<_Tp> tanh(const complex<_Tp>&);
-
-
+
+
// 26.2.2 Primary template class complex
/**
* Template to represent complex numbers.
@@ -123,7 +123,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
/// Value typedef.
typedef _Tp value_type;
-
+
/// Default constructor. First parameter is x, second parameter is y.
/// Unspecified parameters default to 0.
_GLIBCXX_CONSTEXPR complex(const _Tp& __r = _Tp(), const _Tp& __i = _Tp())
@@ -143,41 +143,41 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 387. std::complex over-encapsulated.
_GLIBCXX_ABI_TAG_CXX11
- constexpr _Tp
+ constexpr _Tp
real() const { return _M_real; }
_GLIBCXX_ABI_TAG_CXX11
- constexpr _Tp
+ constexpr _Tp
imag() const { return _M_imag; }
#else
/// Return real part of complex number.
- _Tp&
+ _Tp&
real() { return _M_real; }
/// Return real part of complex number.
- const _Tp&
+ const _Tp&
real() const { return _M_real; }
/// Return imaginary part of complex number.
- _Tp&
+ _Tp&
imag() { return _M_imag; }
/// Return imaginary part of complex number.
- const _Tp&
+ const _Tp&
imag() const { return _M_imag; }
#endif
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 387. std::complex over-encapsulated.
- void
+ void
real(_Tp __val) { _M_real = __val; }
- void
+ void
imag(_Tp __val) { _M_imag = __val; }
/// Assign a scalar to this complex number.
complex<_Tp>& operator=(const _Tp&);
-
+
/// Add a scalar to this complex number.
// 26.2.5/1
complex<_Tp>&
@@ -237,7 +237,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_real = __t;
_M_imag = _Tp();
return *this;
- }
+ }
// 26.2.5/5
template<typename _Tp>
@@ -317,7 +317,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_real = __r / __n;
return *this;
}
-
+
// Operators:
//@{
/// Return new complex value @a x plus @a y.
@@ -359,7 +359,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__r -= __y;
return __r;
}
-
+
template<typename _Tp>
inline complex<_Tp>
operator-(const complex<_Tp>& __x, const _Tp& __y)
@@ -419,7 +419,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__r /= __y;
return __r;
}
-
+
template<typename _Tp>
inline complex<_Tp>
operator/(const complex<_Tp>& __x, const _Tp& __y)
@@ -495,23 +495,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Tp __re_x, __im_x;
_CharT __ch;
__is >> __ch;
- if (__ch == '(')
+ if (__ch == '(')
{
__is >> __re_x >> __ch;
- if (__ch == ',')
+ if (__ch == ',')
{
__is >> __im_x >> __ch;
- if (__ch == ')')
+ if (__ch == ')')
__x = complex<_Tp>(__re_x, __im_x);
else
__is.setstate(ios_base::failbit);
}
- else if (__ch == ')')
+ else if (__ch == ')')
__x = __re_x;
else
__is.setstate(ios_base::failbit);
}
- else
+ else
{
__is.putback(__ch);
__is >> __re_x;
@@ -549,17 +549,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline _Tp&
real(complex<_Tp>& __z)
{ return __z.real(); }
-
+
template<typename _Tp>
inline const _Tp&
real(const complex<_Tp>& __z)
{ return __z.real(); }
-
+
template<typename _Tp>
inline _Tp&
imag(complex<_Tp>& __z)
{ return __z.imag(); }
-
+
template<typename _Tp>
inline const _Tp&
imag(const complex<_Tp>& __z)
@@ -576,7 +576,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const _Tp __s = std::max(abs(__x), abs(__y));
if (__s == _Tp()) // well ...
return __s;
- __x /= __s;
+ __x /= __s;
__y /= __s;
return __s * sqrt(__x * __x + __y * __y);
}
@@ -599,7 +599,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp>
inline _Tp
abs(const complex<_Tp>& __z) { return __complex_abs(__z); }
-#endif
+#endif
// 26.2.7/4: arg(__z): Returns the phase angle of __z.
@@ -655,12 +655,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __res * __res;
}
};
-
+
template<typename _Tp>
inline _Tp
norm(const complex<_Tp>& __z)
{
- return _Norm_helper<__is_floating<_Tp>::__value
+ return _Norm_helper<__is_floating<_Tp>::__value
&& !_GLIBCXX_FAST_MATH>::_S_do_it(__z);
}
@@ -676,7 +676,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline complex<_Tp>
conj(const complex<_Tp>& __z)
{ return complex<_Tp>(__z.real(), -__z.imag()); }
-
+
// Transcendentals
// 26.2.8/1 cos(__z): Returns the cosine of __z.
@@ -804,7 +804,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
const _Tp __x = __z.real();
const _Tp __y = __z.imag();
- return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y));
+ return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y));
}
#if _GLIBCXX_USE_C99_COMPLEX
@@ -839,14 +839,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
- __complex_sinh(__complex__ float __z) { return __builtin_csinhf(__z); }
+ __complex_sinh(__complex__ float __z) { return __builtin_csinhf(__z); }
inline __complex__ double
- __complex_sinh(__complex__ double __z) { return __builtin_csinh(__z); }
+ __complex_sinh(__complex__ double __z) { return __builtin_csinh(__z); }
inline __complex__ long double
__complex_sinh(const __complex__ long double& __z)
- { return __builtin_csinhl(__z); }
+ { return __builtin_csinhl(__z); }
template<typename _Tp>
inline complex<_Tp>
@@ -902,7 +902,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
// 26.2.8/14 tan(__z): Return the complex tangent of __z.
-
+
template<typename _Tp>
inline complex<_Tp>
__complex_tan(const complex<_Tp>& __z)
@@ -930,7 +930,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// 26.2.8/15 tanh(__z): Returns the hyperbolic tangent of __z.
-
+
template<typename _Tp>
inline complex<_Tp>
__complex_tanh(const complex<_Tp>& __z)
@@ -1066,38 +1066,38 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
explicit _GLIBCXX_CONSTEXPR complex(const complex<double>&);
- explicit _GLIBCXX_CONSTEXPR complex(const complex<long double>&);
+ explicit _GLIBCXX_CONSTEXPR complex(const complex<long double>&);
#if __cplusplus >= 201103L
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 387. std::complex over-encapsulated.
__attribute ((__abi_tag__ ("cxx11")))
- constexpr float
+ constexpr float
real() const { return __real__ _M_value; }
__attribute ((__abi_tag__ ("cxx11")))
- constexpr float
+ constexpr float
imag() const { return __imag__ _M_value; }
#else
- float&
+ float&
real() { return __real__ _M_value; }
- const float&
- real() const { return __real__ _M_value; }
+ const float&
+ real() const { return __real__ _M_value; }
- float&
+ float&
imag() { return __imag__ _M_value; }
- const float&
+ const float&
imag() const { return __imag__ _M_value; }
#endif
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 387. std::complex over-encapsulated.
- void
+ void
real(float __val) { __real__ _M_value = __val; }
- void
+ void
imag(float __val) { __imag__ _M_value = __val; }
complex&
@@ -1217,38 +1217,38 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_CONSTEXPR complex(const complex<float>& __z)
: _M_value(__z.__rep()) { }
- explicit _GLIBCXX_CONSTEXPR complex(const complex<long double>&);
+ explicit _GLIBCXX_CONSTEXPR complex(const complex<long double>&);
#if __cplusplus >= 201103L
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 387. std::complex over-encapsulated.
__attribute ((__abi_tag__ ("cxx11")))
- constexpr double
+ constexpr double
real() const { return __real__ _M_value; }
__attribute ((__abi_tag__ ("cxx11")))
- constexpr double
+ constexpr double
imag() const { return __imag__ _M_value; }
#else
- double&
+ double&
real() { return __real__ _M_value; }
- const double&
+ const double&
real() const { return __real__ _M_value; }
- double&
+ double&
imag() { return __imag__ _M_value; }
- const double&
+ const double&
imag() const { return __imag__ _M_value; }
#endif
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 387. std::complex over-encapsulated.
- void
+ void
real(double __val) { __real__ _M_value = __val; }
- void
+ void
imag(double __val) { __imag__ _M_value = __val; }
complex&
@@ -1264,7 +1264,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_value += __d;
return *this;
}
-
+
complex&
operator-=(double __d)
{
@@ -1354,7 +1354,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_CONSTEXPR complex(_ComplexT __z) : _M_value(__z) { }
- _GLIBCXX_CONSTEXPR complex(long double __r = 0.0L,
+ _GLIBCXX_CONSTEXPR complex(long double __r = 0.0L,
long double __i = 0.0L)
#if __cplusplus >= 201103L
: _M_value{ __r, __i } { }
@@ -1375,32 +1375,32 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 387. std::complex over-encapsulated.
__attribute ((__abi_tag__ ("cxx11")))
- constexpr long double
+ constexpr long double
real() const { return __real__ _M_value; }
__attribute ((__abi_tag__ ("cxx11")))
- constexpr long double
+ constexpr long double
imag() const { return __imag__ _M_value; }
#else
- long double&
+ long double&
real() { return __real__ _M_value; }
- const long double&
+ const long double&
real() const { return __real__ _M_value; }
- long double&
+ long double&
imag() { return __imag__ _M_value; }
- const long double&
+ const long double&
imag() const { return __imag__ _M_value; }
#endif
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 387. std::complex over-encapsulated.
- void
+ void
real(long double __val) { __real__ _M_value = __val; }
- void
+ void
imag(long double __val) { __imag__ _M_value = __val; }
complex&
@@ -1554,7 +1554,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
public:
typedef std::complex<typename __promote_2<_Tp, _Up>::__type> __type;
};
-
+
template<typename _Tp, typename _Up>
struct __promote_2<std::complex<_Tp>, std::complex<_Up> >
{
@@ -1653,7 +1653,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
asin(const std::complex<_Tp>& __z)
{ return __complex_asin(__z); }
#endif
-
+
template<typename _Tp>
std::complex<_Tp>
__complex_atan(const std::complex<_Tp>& __z)