⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 complex.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<HTML><HEAD><TITLE>&lt;complex&gt;</TITLE></HEAD><BODY><H1><A NAME="&lt;complex&gt;"><CODE>&lt;complex&gt;</CODE></A></H1><HR><P><B><CODE><A HREF="#abs">abs</A>&#183; <A HREF="#arg">arg</A>&#183; <A HREF="#complex">complex</A>&#183; <A HREF="#complex&lt;double&gt;">complex&lt;double&gt;</A>&#183; <A HREF="#complex&lt;float&gt;">complex&lt;float&gt;</A>&#183; <A HREF="#complex&lt;long double&gt;">complex&lt;long double&gt;</A>&#183; <A HREF="#conj">conj</A>&#183; <A HREF="#cos">cos</A>&#183; <A HREF="#cosh">cosh</A>&#183; <A HREF="#exp">exp</A>&#183; <A HREF="#imag">imag</A>&#183; <A HREF="#log">log</A>&#183; <A HREF="#log10">log10</A>&#183; <A HREF="#norm">norm</A>&#183; <A HREF="#operator!=">operator!=</A>&#183; <A HREF="#operator*">operator*</A>&#183; <A HREF="#operator+">operator+</A>&#183; <A HREF="#operator-">operator-</A>&#183; <A HREF="#operator/">operator/</A>&#183; <A HREF="#operator&lt;&lt;">operator&lt;&lt;</A>&#183; <A HREF="#operator==">operator==</A>&#183; <A HREF="#operator&gt;&gt;">operator&gt;&gt;</A>&#183; <A HREF="#polar">polar</A>&#183; <A HREF="#pow">pow</A>&#183; <A HREF="#real">real</A>&#183; <A HREF="#sin">sin</A>&#183; <A HREF="#sinh">sinh</A>&#183; <A HREF="#sqrt">sqrt</A>&#183; <A HREF="#tan">tan</A>&#183; <A HREF="#tanh">tanh</A>&#183; <A HREF="#__STD_COMPLEX">__STD_COMPLEX</A></CODE></B></P><HR><P>Include the standard header <B><CODE>&lt;complex&gt;</CODE></B>to define template class <CODE>complex</CODE> and a host ofsupporting template functions.Unless otherwise specified,functions that can return multiple values return an imaginarypart in the half-open interval <CODE>(-pi, pi]</CODE>.</P><PRE>namespace std {#define <B><A HREF="#__STD_COMPLEX">__STD_COMPLEX</A></B>        // TEMPLATE CLASSEStemplate&lt;class Ty&gt;    class <B><A HREF="#complex">complex</A></B>;template&lt;&gt;    class <B><A HREF="#complex&lt;float&gt;">complex&lt;float&gt;</A></B>;template&lt;&gt;    class <B><A HREF="#complex&lt;double&gt;">complex&lt;double&gt;</A></B>;template&lt;&gt;    class <B><A HREF="#complex&lt;long double&gt;">complex&lt;long double&gt;</A></B>;        // TEMPLATE FUNCTIONStemplate&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator+">operator+</A></B>(const complex&lt;Ty&gt;&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator+">operator+</A></B>(const complex&lt;Ty&gt;&amp; left,        const Ty&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator+">operator+</A></B>(const Ty&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator-">operator-</A></B>(const complex&lt;Ty&gt;&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator-">operator-</A></B>(const complex&lt;Ty&gt;&amp; left,        const Ty&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator-">operator-</A></B>(const Ty&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator*">operator*</A></B>(const complex&lt;Ty&gt;&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator*">operator*</A></B>(const complex&lt;Ty&gt;&amp; left,        const Ty&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator*">operator*</A></B>(const Ty&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator/">operator/</A></B>(const complex&lt;Ty&gt;&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator/">operator/</A></B>(const complex&lt;Ty&gt;&amp; left,        const Ty&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator/">operator/</A></B>(const Ty&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator+">operator+</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#operator-">operator-</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    bool <B><A HREF="#operator==">operator==</A></B>(const complex&lt;Ty&gt;&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    bool <B><A HREF="#operator==">operator==</A></B>(const complex&lt;Ty&gt;&amp; left,        const Ty&amp; right);template&lt;class Ty&gt;    bool <B><A HREF="#operator==">operator==</A></B>(const Ty&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    bool <B><A HREF="#operator!=">operator!=</A></B>(const complex&lt;Ty&gt;&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    bool <B><A HREF="#operator!=">operator!=</A></B>(const complex&lt;Ty&gt;&amp; left,        const Ty&amp; right);template&lt;class Ty&gt;    bool <B><A HREF="#operator!=">operator!=</A></B>(const Ty&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty, class Elem, class Tr&gt;    basic_istream&lt;Elem, Tr&gt;&amp;        <B><A HREF="#operator&gt;&gt;">operator&gt;&gt;</A></B>(basic_istream&lt;Elem, Tr&gt;&amp; istr,            complex&lt;Ty&gt;&amp; right);template&lt;class Ty, class Elem, class Tr&gt;    basic_ostream&lt;Elem, Tr&gt;&amp;        <B><A HREF="#operator&lt;&lt;">operator&lt;&lt;</A></B>(basic_ostream&lt;Elem, Tr&gt;&amp; ostr,            const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    Ty <B><A HREF="#real">real</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    Ty <B><A HREF="#imag">imag</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    Ty <B><A HREF="#abs">abs</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    Ty <B><A HREF="#arg">arg</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    Ty <B><A HREF="#norm">norm</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#conj">conj</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#polar">polar</A></B>(const Ty&amp; rho, const Ty&amp; theta = 0);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#cos">cos</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#cosh">cosh</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#exp">exp</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#log">log</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#log10">log10</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#pow">pow</A></B>(const complex&lt;Ty&gt;&amp; left, int right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#pow">pow</A></B>(const complex&lt;Ty&gt;&amp; left, const Ty&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#pow">pow</A></B>(const complex&lt;Ty&gt;&amp; left,        const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#pow">pow</A></B>(const Ty&amp; left, const complex&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#sin">sin</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#sinh">sinh</A></B>(const complex&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    complex&lt;Ty&gt; <B><A HREF="#sqrt">sqrt</A></B>(const complex&lt;Ty&gt;&amp; left);    };</PRE><H2><A NAME="abs"><CODE>abs</CODE></A></H2><PRE>template&lt;class Ty&gt;    Ty <B>abs</B>(const complex&lt;Ty&gt;&amp; left);</PRE><P>The function returns the magnitude of <CODE>left</CODE>.</P><H2><A NAME="arg"><CODE>arg</CODE></A></H2><PRE>template&lt;class Ty&gt;    Ty <B>arg</B>(const complex&lt;Ty&gt;&amp; left);</PRE><P>The function returns the phase angle of <CODE>left</CODE>.</P><H2><A NAME="complex"><CODE>complex</CODE></A></H2><PRE>template&lt;class Ty&gt;    class <B>complex</B> {public:    typedef Ty <B><A HREF="#complex::value_type">value_type</A></B>;    Ty <B><A HREF="#complex::real">real</A></B>() const;    Ty <B><A HREF="#complex::imag">imag</A></B>() const;    <B><A HREF="#complex::complex">complex</A></B>(const Ty&amp; realval = 0, const Ty&amp; imagval = 0);    template&lt;class Other&gt;        <B><A HREF="#complex::complex">complex</A></B>(const complex&lt;Other&gt;&amp; right);    template&lt;class Other&gt;        complex&amp; <B><A HREF="#complex::operator=">operator=</A></B>(const complex&lt;Other&gt;&amp; right);    template&lt;class Other&gt;        complex&amp; <B><A HREF="#complex::operator+=">operator+=</A></B>(const complex&lt;Other&gt;&amp; right);    template&lt;class Other&gt;        complex&amp; <B><A HREF="#complex::operator-=">operator-=</A></B>(const complex&lt;Other&gt;&amp; right);    template&lt;class Other&gt;        complex&amp; <B><A HREF="#complex::operator*=">operator*=</A></B>(const complex&lt;Other&gt;&amp; right);    template&lt;class Other&gt;        complex&amp; <B><A HREF="#complex::operator/=">operator/=</A></B>(const complex&lt;Other&gt;&amp; right);    complex&amp; <B><A HREF="#complex::operator=">operator=</A></B>(const Ty&amp; right);    complex&amp; <B><A HREF="#complex::operator+=">operator+=</A></B>(const Ty&amp; right);    complex&amp; <B><A HREF="#complex::operator-=">operator-=</A></B>(const Ty&amp; right);    complex&amp; <B><A HREF="#complex::operator*=">operator*=</A></B>(const Ty&amp; right);    complex&amp; <B><A HREF="#complex::operator/=">operator/=</A></B>(const Ty&amp; right);    };</PRE><P>The template class describes an object that stores two objectsof type <B><CODE>Ty</CODE></B>, one that represents the real partof a complex number and one that represents the imaginary part.An object of class <CODE>Ty</CODE>:</P><UL><LI>has a public default constructor, destructor,copy constructor, and assignment operator -- withconventional behavior</LI><LI>can be assigned integer or floating-point values, ortype cast to such values -- withconventional behavior</LI><LI>defines the arithmetic operators and math functions, as needed,that are defined for the floating-pointtypes -- with conventional behavior</LI></UL><P>In particular, no subtle differences may exist between copy constructionand default construction followed by assignment. And none of the operationson objects of class <CODE>Ty</CODE> may throw exceptions.</P><P>Explicit specializations of template class <CODE>complex</CODE>exist for the three floating-point types. In this<A HREF="index.html#implementation">implementation</A>, a value of any othertype <CODE>Ty</CODE> is type cast to <I>double</I> for actual calculations,with the <I>double</I> result assigned back to the stored objectof type <CODE>Ty</CODE>.</P><H3><A NAME="complex::complex"><CODE>complex::complex</CODE></A></H3><PRE><B>complex</B>(const Ty&amp; realval = 0, const Ty&amp; imagval = 0);template&lt;class Other&gt;    <B>complex</B>(const complex&lt;Other&gt;&amp; right);</PRE><P>The first constructor initializes the stored real part to<CODE>realval</CODE> and the stored imaginary part to <CODE>imagval</CODE>.The second constructor initializes the stored real part to<CODE>right.real()</CODE> and the stored imaginary part to<CODE>right.imag()</CODE>.</P><P>In this<A HREF="index.html#implementation">implementation</A>, if atranslator does not support member template functions, the template:</P><PRE>template&lt;class Other&gt;    <B>complex</B>(const complex&lt;Other&gt;&amp; right);</PRE><P>is replaced by:</P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -