]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/qvm/doc/accessing_vector_elements.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / qvm / doc / accessing_vector_elements.html
CommitLineData
7c673cae
FG
1<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
2'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
3<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
4<head>
5 <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
6 <title>accessing vector elements</title>
7 <link href='reno.css' type='text/css' rel='stylesheet'/>
8</head>
9<body>
10<div class="body-0">
11<div class="body-1">
12<div class="body-2">
13<div>
14<h1>QVM: Quaternions, Vectors, Matrices</h1>
15</div>
16<!-- Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc. -->
17<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
18<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
19<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Accessing Vector Elements</h3>
20</div>
21<div class="RenoIncludeDIV"><div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_qvm_vec_access_hpp.html">boost/qvm/vec_access.hpp</a></span>&gt;</p>
22<pre>namespace boost
23{
24 namespace <span class="RenoLink"><a href="qvm.html">qvm</a></span>
25 {
26<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">//Only <span class="RenoLink"><a href="SFINAE_enable_if.html">enabled if</a></span>:
27 // <span class="RenoLink"><a href="is_vec.html">is_vec</a></span>&lt;V&gt;::value
28
29 template &lt;int I,class V&gt; -unspecified-return-type- <span class="RenoLink">A</span>( V &amp; v );
30 template &lt;class V&gt; -unspecified-return-type- A0( V &amp; v );
31 template &lt;class V&gt; -unspecified-return-type- A1( V &amp; v );
32 ...
33 template &lt;class V&gt; -unspecified-return-type- A9( V &amp; v );
34
35 template &lt;class V&gt; -unspecified-return-type- X( V &amp; v );
36 template &lt;class V&gt; -unspecified-return-type- Y( V &amp; v );
37 template &lt;class V&gt; -unspecified-return-type- Z( V &amp; v );
38 template &lt;class V&gt; -unspecified-return-type- W( V &amp; v );</span></span>
39 }
40}</pre>
41</div></div><p>An expression of the form of <i><span class="RenoLink">A</span>&lt;I&gt;(v)</i> can be used to access the <i>I</i>-th element a vector object <i>v</i>. For example, the expression:</p>
42<pre><span class="RenoLink">A</span>&lt;1&gt;(v) *= 42;</pre>
43<p>can be used to multiply the element at index 1 (indexing in Boost QVM is always zero-based) of a vector <i>v</i> by 42.</p>
44<p>For convenience, there are also non-template overloads for <i>I</i> from 0 to 9; an alternative way to write the above expression is:</p>
45<pre>A1(v) *= 42;</pre>
46<p><i>X</i>, <i>Y</i>, <i>Z</i> and <i>W</i> act the same as <i>A0</i>/<i>A1</i>/<i>A2</i>/<i>A3</i>; yet another alternative way to write the above expression is:</p>
47<pre>Y(v) *= 42;</pre>
48</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
49See also: <span class="RenoPageList"><a href="index.html">Boost QVM</a>&nbsp;| <a href="boost_qvm_vec_access_hpp.html">boost/qvm/vec_access.hpp</a>&nbsp;| <a href="known_quirks_and_issues.html">Known Quirks and Issues</a>&nbsp;| <a href="Synopsis.html">Synopsis</a></span>
50</div>
51<!-- Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc. -->
52<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
53<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
54<div id="footer">
55<p>
56<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
57<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
58<small>Copyright (c) 2008-2016 by Emil Dotchevski and Reverge Studios, Inc.<br/>
59Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
60</p>
61</div>
62</div>
63</div>
64</div>
65</body>
66</html>