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

📄 valarray.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 5 页
字号:
template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B><A HREF="#sin">sin</A></B>(const valarray&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B><A HREF="#sinh">sinh</A></B>(const valarray&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B><A HREF="#sqrt">sqrt</A></B>(const valarray&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B><A HREF="#tan">tan</A></B>(const valarray&lt;Ty&gt;&amp; left);template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B><A HREF="#tanh">tanh</A></B>(const valarray&lt;Ty&gt;&amp; left);    };</PRE><H2><A NAME="abs"><CODE>abs</CODE></A></H2><PRE>template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B>abs</B>(const valarray&lt;Ty&gt;&amp; left);</PRE><P>The template function returns an object of class<CODE><A HREF="#valarray">valarray</A>&lt;Ty&gt;</CODE>, each of whoseelements <CODE>I</CODE> is the absolute value of <CODE>left[I]</CODE>.</P><H2><A NAME="acos"><CODE>acos</CODE></A></H2><PRE>template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B>acos</B>(const valarray&lt;Ty&gt;&amp; left);</PRE><P>The template function returns an object of class<CODE><A HREF="#valarray">valarray</A>&lt;Ty&gt;</CODE>, each of whoseelements <CODE>I</CODE> is the arccosine of <CODE>left[I]</CODE>.</P><H2><A NAME="asin"><CODE>asin</CODE></A></H2><PRE>template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B>asin</B>(const valarray&lt;Ty&gt;&amp; left);</PRE><P>The template function returns an object of class<CODE><A HREF="#valarray">valarray</A>&lt;Ty&gt;</CODE>, each of whoseelements <CODE>I</CODE> is the arcsine of <CODE>left[I]</CODE>.</P><H2><A NAME="atan"><CODE>atan</CODE></A></H2><PRE>template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B>atan</B>(const valarray&lt;Ty&gt;&amp; left);</PRE><P>The template function returns an object of class<CODE><A HREF="#valarray">valarray</A>&lt;Ty&gt;</CODE>, each of whoseelements <CODE>I</CODE> is the arctangent of <CODE>left[I]</CODE>.</P><H2><A NAME="atan2"><CODE>atan2</CODE></A></H2><PRE>template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B>atan2</B>(const valarray&lt;Ty&gt;&amp; left,        const valarray&lt;Ty&gt;&amp; right);template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B>atan2</B>(const valarray&lt;Ty&gt; left, const Ty&amp; right);template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B>atan2</B>(const Ty&amp; left, const valarray&lt;Ty&gt;&amp; right);</PRE><P>The first template function returns an object of class<CODE><A HREF="#valarray">valarray</A>&lt;Ty&gt;</CODE>, each of whoseelements <CODE>I</CODE> is the arctangent of <CODE>left[I] / right[I]</CODE>.The second template function stores in element <CODE>I</CODE>the arctangent of <CODE>left[I] / right</CODE>.The third template function stores in element <CODE>I</CODE>the arctangent of <CODE>left / right[I]</CODE>.</P><H2><A NAME="cos"><CODE>cos</CODE></A></H2><PRE>template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B>cos</B>(const valarray&lt;Ty&gt;&amp; left);</PRE><P>The template function returns an object of class<CODE><A HREF="#valarray">valarray</A>&lt;Ty&gt;</CODE>, each of whoseelements <CODE>I</CODE> is the cosine of <CODE>left[I]</CODE>.</P><H2><A NAME="cosh"><CODE>cosh</CODE></A></H2><PRE>template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B>cosh</B>(const valarray&lt;Ty&gt;&amp; left);</PRE><P>The template function returns an object of class<CODE><A HREF="#valarray">valarray</A>&lt;Ty&gt;</CODE>, each of whoseelements <CODE>I</CODE> is the hyperbolic cosine of <CODE>left[I]</CODE>.</P><H2><A NAME="exp"><CODE>exp</CODE></A></H2><PRE>template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B>exp</B>(const valarray&lt;Ty&gt;&amp; left);</PRE><P>The template function returns an object of class<CODE><A HREF="#valarray">valarray</A>&lt;Ty&gt;</CODE>, each of whoseelements <CODE>I</CODE> is the exponential of <CODE>left[I]</CODE>.</P><H2><A NAME="gslice"><CODE>gslice</CODE></A></H2><PRE>class <B>gslice</B> {public:    <B><A HREF="#gslice::gslice">gslice</A></B>();    <B><A HREF="#gslice::gslice">gslice</A></B>(size_t off,        const valarray&lt;size_t&gt; lenarr,        const valarray&lt;size_t&gt; incarr);    size_t <B><A HREF="#gslice::start">start</A></B>() const;    const valarray&lt;size_t&gt; <B><A HREF="#gslice::size">size</A></B>() const;    const valarray&lt;size_t&gt; <B><A HREF="#gslice::stride">stride</A></B>() const;    };</PRE><P>The class stores the parameters that characterize a<CODE><A HREF="#gslice_array">gslice_array</A></CODE> when anobject of class <CODE>gslice</CODE> appears as a subscriptfor an object of class<CODE><A HREF="#valarray::operator[]">valarray</A>&lt;Ty&gt;</CODE>.The stored values include:</P><UL><LI>a <B>starting index</B></LI><LI>a <B>length vector</B> of class <CODE>valarray&lt;size_t&gt;</CODE></LI><LI>a <B>stride vector</B> of class <CODE>valarray&lt;size_t&gt;</CODE></LI></UL><P>The two vectors must have the same length.</P><H3><A NAME="gslice::gslice"><CODE>gslice::gslice</CODE></A></H3><PRE><B>gslice</B>();<B>gslice</B>(size_t off,    const valarray&lt;size_t&gt; lenarr,    const valarray&lt;size_t&gt; incarr);</PRE><P>The default constructor stores zero for the starting index,and zero-length vectors for the length and stride vectors.The second constructor stores <CODE>off</CODE>for the starting index, <CODE>lenarr</CODE> for the length vector,and <CODE>incarr</CODE> for the stride vector.</P><H3><A NAME="gslice::size"><CODE>gslice::size</CODE></A></H3><PRE>const valarray&lt;size_t&gt; <B>size</B>() const;</PRE><P>The member function returns the stored length vector.</P><H3><A NAME="gslice::start"><CODE>gslice::start</CODE></A></H3><PRE>size_t <B>start</B>() const;</PRE><P>The member function returns the stored starting index.</P><H3><A NAME="gslice::stride"><CODE>gslice::stride</CODE></A></H3><PRE>const valarray&lt;size_t&gt; <B>stride</B>() const;</PRE><P>The member function returns the stored stride vector.</P><H2><A NAME="gslice_array"><CODE>gslice_array</CODE></A></H2><PRE>template&lt;class Ty&gt;    class <B>gslice_array</B> {public:    typedef Ty <B><A NAME="gslice_array::value_type">value_type</A></B>;    void <B><A NAME="gslice_array::operator=">operator=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="#gslice_array::operator=">operator=</A></B>(const Ty&amp; right) const;    void <B><A NAME="gslice_array::operator*=">operator*=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="gslice_array::operator/=">operator/=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="gslice_array::operator%=">operator%=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="gslice_array::operator+=">operator+=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="gslice_array::operator-=">operator-=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="gslice_array::operator^=">operator^=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="gslice_array::operator&amp;=">operator&amp;=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="gslice_array::operator|=">operator|=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="gslice_array::operator&lt;&lt;=">operator&lt;&lt;=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="gslice_array::operator&gt;&gt;=">operator&gt;&gt;=</A></B>(const valarray&lt;Ty&gt; right) const;private:    void <B>gslice_array</B>();  // not defined    void <B>gslice_array</B>(        const gslice_array&amp;);  // not defined    gslice_array&amp; <B>operator=</B>(        const gslice_array&amp;);  // not defined    };</PRE><P>The class describes an object thatstores a reference to an object <CODE>va</CODE> of class<CODE><A HREF="#valarray">valarray</A>&lt;Ty&gt;</CODE>,along with an object <CODE>gs</CODE> of class<CODE><A HREF="#gslice">gslice</A></CODE> whichdescribes the sequence of elements to select from the<CODE>valarray&lt;Ty&gt;</CODE> object.</P><P>You construct a <CODE>gslice_array&lt;Ty&gt;</CODE> object onlyby writing an expression of the form<CODE><A HREF="#valarray::operator[]">va[gs]</A></CODE>.The member functions of class <CODE>gslice_array</CODE> thenbehave like the corresponding function signatures definedfor <CODE>valarray&lt;Ty&gt;</CODE>, except that only the sequenceof selected elements is affected.</P><P>The sequence is determined as follows. For a length vector<CODE>gs.<A HREF="#gslice::size">size</A>()</CODE>of length <CODE>N</CODE>, construct the indexvector <CODE>valarray&lt;size_t&gt; idx(0, N)</CODE>. Thisdesignates the initial element of the sequence, whose index<CODE>K</CODE> within <CODE>va</CODE> is given by the mapping:</P><PRE>K = gs.start();for (size_t I = 0; I &lt; N; ++I)    K += idx[I] * gs.stride()[I];</PRE><P>The successor to an index vector value is given by:</P><PRE>for (size_t I = N; 0 &lt; I--; )    if (++idx[I] &lt; gs.size()[I])        break;    else        idx[I] = 0;</PRE><P>For example:</P><PRE>const size_t lv[] = {2, 3};const size_t dv[] = {7, 2};const valarray&lt;size_t&gt; len(lv, 2), str(dv, 2);// va[gslice(3, len, str)] selects elements with//   indices 3, 5, 7, 10, 12, 14</PRE><H2><A NAME="indirect_array"><CODE>indirect_array</CODE></A></H2><PRE>template&lt;class Ty&gt;    class <B>indirect_array</B> {public:    typedef Ty <B><A NAME="indirect_array::value_type">value_type</A></B>;    void <B><A NAME="indirect_array::operator=">operator=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="#indirect_array::operator=">operator=</A></B>(const Ty&amp; right) const;    void <B><A NAME="indirect_array::operator*=">operator*=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="indirect_array::operator/=">operator/=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="indirect_array::operator%=">operator%=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="indirect_array::operator+=">operator+=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="indirect_array::operator-=">operator-=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="indirect_array::operator^=">operator^=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="indirect_array::operator&amp;=">operator&amp;=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="indirect_array::operator|=">operator|=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="indirect_array::operator&lt;&lt;=">operator&lt;&lt;=</A></B>(const valarray&lt;Ty&gt; right) const;    void <B><A NAME="indirect_array::operator&gt;&gt;=">operator&gt;&gt;=</A></B>(const valarray&lt;Ty&gt; right) const;private:private:    void <B>indirect_array</B>();  // not defined    void <B>indirect_array</B>(        const indirect_array&amp;);  // not defined    indirect_array&amp; <B>operator=</B>(        const indirect_array&amp;);  // not defined    };</PRE><P>The class describes an object thatstores a reference to an object <CODE>va</CODE> of class<CODE><A HREF="#valarray">valarray</A>&lt;Ty&gt;</CODE>,along with an object <CODE>xa</CODE> of class<CODE>valarray&lt;size_t&gt;</CODE> whichdescribes the sequence of elements to select from the<CODE>valarray&lt;Ty&gt;</CODE> object.</P><P>You construct an <CODE>indirect_array&lt;Ty&gt;</CODE> object onlyby writing an expression of the form<CODE><A HREF="#valarray::operator[]">va[xa]</A></CODE>.The member functions of class <CODE>indirect_array</CODE> thenbehave like the corresponding function signatures definedfor <CODE>valarray&lt;Ty&gt;</CODE>, except that only the sequenceof selected elements is affected.</P><P>The sequence consists of<CODE>xa.<A HREF="#valarray::size">size</A>()</CODE>elements, where element <CODE>I</CODE> becomes the index<CODE>xa[I]</CODE> within <CODE>va</CODE>. For example:</P><PRE>const size_t vi[] = {7, 5, 2, 3, 8};// va[valarray&lt;size_t&gt;(vi, 5)] selects elements with//   indices 7, 5, 2, 3, 8</PRE><H2><A NAME="log"><CODE>log</CODE></A></H2><PRE>template&lt;class Ty&gt;    valarray&lt;Ty&gt; <B>log</B>(const valarray&lt;Ty&gt;&amp; left);</PRE>

⌨️ 快捷键说明

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