|
Boost-Commit : |
From: dgregor_at_[hidden]
Date: 2008-05-08 14:27:31
Author: dgregor
Date: 2008-05-08 14:27:30 EDT (Thu, 08 May 2008)
New Revision: 45222
URL: http://svn.boost.org/trac/boost/changeset/45222
Log:
Finish complex, for real
Text files modified:
sandbox/committee/concepts/stdlib/clib-numerics.tex | 138 ++++++++++++++++++++++-----------------
1 files changed, 77 insertions(+), 61 deletions(-)
Modified: sandbox/committee/concepts/stdlib/clib-numerics.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-numerics.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-numerics.tex 2008-05-08 14:27:30 EDT (Thu, 08 May 2008)
@@ -430,9 +430,6 @@
The effect of instantiating the template
\tcode{complex}\
for any type other than float, double or long double is unspecified.
-\addedCC{\mbox{\enternote} In addition, for some
- \mbox{\tcode{complex}} operations the concept requirements are
- unspecified. \mbox{\exitnote}}
\pnum
If the result of a function is not mathematically defined or not in
@@ -494,40 +491,49 @@
template<@\changedCC{class}{ArithmeticLike}@ T> T real(const complex<T>&);
template<@\changedCC{class}{ArithmeticLike}@ T> T imag(const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ T abs(const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ T arg(const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ T norm(const complex<T>&);
-
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> conj(const complex<T>&);
- @\ptr_at_template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> fabs(const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> polar(const T&, const T& = 0);
+ template<class T> @\addedCC{requires HasSqrt<T>}@ T abs(const complex<T>&);
+ template<class T> @\addedCC{requires HasAtan2<T>}@ T arg(const complex<T>&);
+ template<@\changedCC{class}{ArithmeticLike}@ T> T norm(const complex<T>&);
+
+ template<@\changedCC{class}{ArithmeticLike}@ T> complex<T> conj(const complex<T>&);
+ @\ptr_at_template<@\changedCC{class}{ArithmeticLike}@ T> complex<T> fabs(const complex<T>&);
+ template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T>}@ complex<T> polar(const T&, const T& = 0);
// \ref{complex.transcendentals} transcendentals:
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> acos(const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> asin(const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> atan(const complex<T>&);
-
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> acosh(const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> asinh(const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> atanh(const complex<T>&);
-
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> cos (const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> cosh (const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> exp (const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> log (const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> log10(const complex<T>&);
-
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> pow(const complex<T>&, int);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> pow(const complex<T>&, const T&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> pow(const complex<T>&, const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> pow(const T&, const complex<T>&);
-
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> sin (const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> sinh (const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> sqrt (const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> tan (const complex<T>&);
- template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> tanh (const complex<T>&);
-
+ template<class T> @\addedCC{requires HasSqrt<T> \&\& HasLog<T>}@ complex<T> acos(const complex<T>&);
+ template<class T> @\addedCC{requires HasSqrt<T> \&\& HasLog<T>}@ complex<T> asin(const complex<T>&);
+ template<class T> @\addedCC{requires HasAtan2<T> \&\& HasLog<T>}@ complex<T> atan(const complex<T>&);
+
+ template<class T> @\addedCC{requires HasSqrt<T> \&\& HasLog<T>}@ complex<T> acosh(const complex<T>&);
+ template<class T> @\addedCC{requires HasSqrt<T> \&\& HasLog<T>}@ complex<T> asinh(const complex<T>&);
+ template<class T> @\addedCC{requires HasAtan2<T> \&\& HasLog<T>}@ complex<T> atanh(const complex<T>&);
+
+ template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> cos (const complex<T>&);
+ template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> cosh (const complex<T>&);
+ template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasExp<T>}@
+ complex<T> exp (const complex<T>&);
+ template<class T> @\addedCC{requires HasAtan2<T> \&\& HasExp<T>}@ complex<T> log (const complex<T>&);
+ template<class T> @\addedCC{requires HasAtan2<T> \&\& HasExp<T>}@ complex<T> log10(const complex<T>&);
+
+ template<class T> @\addedCC{requires ArithmeticLike<T>}@ complex<T> pow(const complex<T>&, int);
+ template<class T> @\addedCC{requires HasPow<T> \&\& HasLog<T> \&\& HasSin<T> \&\& HasCos<T>}@
+ complex<T> pow(const complex<T>&, const T&);
+ template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasExp<T> \&\& HasAtan2<T>}@
+ complex<T> pow(const complex<T>&, const complex<T>&);
+ template<class T> @\addedCC{requires HasPow<T> \&\& HasSin<T> \&\& HasCos<T> \&\& HasExp<T> \&\& HasAtan2<T>}@
+ complex<T> pow(const T&, const complex<T>&);
+
+ template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> sin (const complex<T>&);
+ template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> sinh (const complex<T>&);
+ template<class T> @\addedCC{requires HasSqrt<T>}@ complex<T> sqrt (const complex<T>&);
+ template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> tan (const complex<T>&);
+ template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> tanh (const complex<T>&);
}
\end{codeblock}
@@ -1061,7 +1067,7 @@
\index{abs@\tcode{abs}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ T abs(const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasSqrt<T>}@ T abs(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1072,7 +1078,7 @@
\index{arg@\tcode{arg}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ T arg(const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasAtan2<T>}@ T arg(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1083,7 +1089,7 @@
\index{norm@\tcode{norm}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ T norm(const complex<T>& @\farg{x}@);
+template<@\changedCC{class}{ArithmeticLike}@ T> T norm(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1094,7 +1100,7 @@
\index{conj@\tcode{conj}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> conj(const complex<T>& @\farg{x}@);
+template<@\changedCC{class}{ArithmeticLike}@ T> complex<T> conj(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1106,7 +1112,7 @@
\index{fabs@\tcode{fabs}!\tcode{complex}}%
\index{cabs@\tcode{cabs}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> fabs(const complex<T>& @\farg{x}@);
+template<@\changedCC{class}{ArithmeticLike}@ T> complex<T> fabs(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1116,7 +1122,8 @@
\index{polar@\tcode{polar}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> polar(const T& @\farg{rho}@, const T& @\farg{theta}@ = 0);
+template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T>}@
+ complex<T> polar(const T& @\farg{rho}@, const T& @\farg{theta}@ = 0);
\end{itemdecl}
\begin{itemdescr}
@@ -1134,7 +1141,7 @@
\index{acos@\tcode{acos}!\tcode{complex}}%
\index{cacos@\tcode{cacos}!\tcode{complex}}%
\begin{itemdecl}
-@\ptr_at_template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> acos(const complex<T>& @\farg{x}@);
+@\ptr_at_template<class T> @\addedCC{requires HasSqrt<T> \&\& HasLog<T>}@ complex<T> acos(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1145,7 +1152,7 @@
\index{asin@\tcode{asin}!\tcode{complex}}%
\index{casin@\tcode{casin}!\tcode{complex}}%
\begin{itemdecl}
-@\ptr_at_template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> asin(const complex<T>& @\farg{x}@);
+@\ptr_at_template<class T> @\addedCC{requires HasSqrt<T> \&\& HasLog<T>}@ complex<T> asin(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1156,7 +1163,7 @@
\index{atan@\tcode{atan}!\tcode{complex}}%
\index{catan@\tcode{catan}!\tcode{complex}}%
\begin{itemdecl}
-@\ptr_at_template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> atan(const complex<T>& @\farg{x}@);
+@\ptr_at_template<class T> @\addedCC{requires HasAtan2<T> \&\& HasLog<T>}@ complex<T> atan(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1167,7 +1174,7 @@
\index{acosh@\tcode{acosh}!\tcode{complex}}%
\index{cacosh@\tcode{cacosh}!\tcode{complex}}%
\begin{itemdecl}
-@\ptr_at_template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> acosh(const complex<T>& @\farg{x}@);
+@\ptr_at_template<class T> @\addedCC{requires HasSqrt<T> \&\& HasLog<T>}@ complex<T> acosh(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1178,7 +1185,7 @@
\index{asinh@\tcode{asinh}!\tcode{complex}}%
\index{casinh@\tcode{casinh}!\tcode{complex}}%
\begin{itemdecl}
-@\ptr_at_template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> asinh(const complex<T>& @\farg{x}@);
+@\ptr_at_template<class T> @\addedCC{requires HasSqrt<T> \&\& HasLog<T>}@ complex<T> asinh(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1189,7 +1196,7 @@
\index{atanh@\tcode{atanh}!\tcode{complex}}%
\index{catanh@\tcode{catanh}!\tcode{complex}}%
\begin{itemdecl}
-@\ptr_at_template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> atanh(const complex<T>& @\farg{x}@);
+@\ptr_at_template<class T> @\addedCC{requires HasAtan2<T> \&\& HasLog<T>}@ complex<T> atanh(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1199,7 +1206,8 @@
\index{cos@\tcode{cos}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> cos(const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> cos(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1210,7 +1218,8 @@
\index{cosh@\tcode{cosh}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> cosh(const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> cosh(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1221,7 +1230,7 @@
\index{exp@\tcode{exp}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> exp(const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasExp<T>}@ complex<T> exp(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1232,7 +1241,7 @@
\index{log@\tcode{log}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> log(const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasAtan2<T> \&\& HasExp<T>}@ complex<T> log(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1254,7 +1263,7 @@
\index{log10@\tcode{log10}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> log10(const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasAtan2<T> \&\& HasExp<T>}@ complex<T> log10(const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1270,11 +1279,14 @@
\index{pow@\tcode{pow}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> pow(const complex<T>& @\farg{x}@, int @\farg{y}@);
+template<class T> @\addedCC{requires ArithmeticLike<T>}@ complex<T> pow(const complex<T>& @\farg{x}@, int @\farg{y}@);
template<class T>
- complex<T> @\addedCC{requires \mbox{\textit{unspecified}}}@ pow(const complex<T>& @\farg{x}@, const complex<T>& @\farg{y}@);
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> pow (const complex<T>& @\farg{x}@, const T& @\farg{y}@);
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> pow (const T& @\farg{x}@, const complex<T>& @\farg{y}@);
+ complex<T> @\addedCC{requires HasPow<T> \&\& HasLog<T> \&\& HasSin<T> \&\& HasCos<T>}@
+ pow(const complex<T>& @\farg{x}@, const complex<T>& @\farg{y}@);
+template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasExp<T> \&\& HasAtan2<T>}@ complex<T>
+ pow (const complex<T>& @\farg{x}@, const T& @\farg{y}@);
+template<class T> @\addedCC{requires HasPow<T> \&\& HasSin<T> \&\& HasCos<T> \&\& HasExp<T> \&\& HasAtan2<T>}@
+ complex<T> pow (const T& @\farg{x}@, const complex<T>& @\farg{y}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1294,7 +1306,8 @@
\index{sin@\tcode{sin}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> sin (const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> sin (const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1305,7 +1318,8 @@
\index{sinh@\tcode{sinh}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> sinh (const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> sinh (const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1316,7 +1330,7 @@
\index{sqrt@\tcode{sqrt}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> sqrt (const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasSqrt<T>}@ complex<T> sqrt (const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1334,7 +1348,8 @@
\index{tan@\tcode{tan}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> tan (const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> tan (const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
@@ -1345,7 +1360,8 @@
\index{tanh@\tcode{tanh}!\tcode{complex}}%
\begin{itemdecl}
-template<class T> @\addedCC{requires \mbox{\textit{unspecified}}}@ complex<T> tanh (const complex<T>& @\farg{x}@);
+template<class T> @\addedCC{requires HasSin<T> \&\& HasCos<T> \&\& HasSinh<T> \&\& HasCosh<T>}@
+ complex<T> tanh (const complex<T>& @\farg{x}@);
\end{itemdecl}
\begin{itemdescr}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk