Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/numeric/ublas/doc/vector.htm @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

File size: 22.2 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4<head>
5<meta name="generator" content=
6"HTML Tidy for Linux/x86 (vers 1st March 2004), see www.w3.org" />
7<meta http-equiv="Content-Type" content=
8"text/html; charset=us-ascii" />
9<link href="ublas.css" type="text/css" />
10<title>Vector</title>
11</head>
12<body>
13<h1><img src="../../../../boost.png" align="middle" />
14Vector</h1>
15<h2><a name="vector" id="vector"></a>Vector</h2>
16<h4>Description</h4>
17<p>The templated class <code>vector&lt;T, A&gt;</code> is the base
18container adaptor for dense vectors. For a <em>n</em>-dimensional
19vector and <em>0 &lt;= i &lt; n</em> every element
20<em>v</em><sub><em>i</em></sub> is mapped to the <em>i-</em>th
21element of the container.</p>
22<h4>Example</h4>
23<pre>
24#include &lt;boost/numeric/ublas/vector.hpp&gt;
25#include &lt;boost/numeric/ublas/io.hpp&gt;
26
27int main () {
28    using namespace boost::numeric::ublas;
29    vector&lt;double&gt; v (3);
30    for (unsigned i = 0; i &lt; v.size (); ++ i)
31        v (i) = i;
32    std::cout &lt;&lt; v &lt;&lt; std::endl;
33}
34</pre>
35<h4>Definition</h4>
36<p>Defined in the header vector.hpp.</p>
37<h4>Template parameters</h4>
38<table border="1" summary="parameters">
39<tbody>
40<tr>
41<th>Parameter</th>
42<th>Description</th>
43<th>Default</th>
44</tr>
45<tr>
46<td><code>T</code></td>
47<td>The type of object stored in the vector.</td>
48<td></td>
49</tr>
50<tr>
51<td><code>A</code></td>
52<td>The type of the <a href="storage_concept.htm">Storage</a> array. <a href="#vector_1">[1]</a></td>
53<td><code>unbounded_array&lt;T&gt;</code></td>
54</tr>
55</tbody>
56</table>
57<h4>Model of</h4>
58<p><a href="container_concept.htm#vector">Vector</a> .</p>
59<h4>Type requirements</h4>
60<p>None, except for those imposed by the requirements of <a href=
61"container_concept.htm#vector">Vector</a> .</p>
62<h4>Public base classes</h4>
63<p><code>vector_container&lt;vector&lt;T, A&gt; &gt;</code></p>
64<h4>Members</h4>
65<table border="1" summary="members">
66<tbody>
67<tr>
68<th>Member</th>
69<th>Where defined</th>
70<th>Description</th>
71</tr>
72<tr>
73<td><code>value_type</code>
74<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
75<td></td>
76</tr>
77<tr>
78<td><code>reference</code>
79<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
80<td></td>
81</tr>
82<tr>
83<td><code>const_reference</code>
84<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
85<td></td>
86</tr>
87<tr>
88<td><code>size_type</code>
89<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
90<td></td>
91</tr>
92<tr>
93<td><code>difference_type</code>
94<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
95<td></td>
96</tr>
97<tr>
98<td><code>const_iterator</code>
99<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
100<td></td>
101</tr>
102<tr>
103<td><code>iterator</code>
104<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
105<td></td>
106</tr>
107<tr>
108<td><code>const_reverse_iterator</code>
109<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
110<td></td>
111</tr>
112<tr>
113<td><code>reverse_iterator</code>
114<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
115<td></td>
116</tr>
117<tr>
118<td><code>array_type</code>
119<td><a href="container_concept.htm#vector">Vector</a></td>
120<td></td>
121</tr>
122<tr>
123<td><code>vector ()</code></td>
124<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
125<td>Allocates an uninitialized <code>vector</code> that holds zero
126elements.</td>
127</tr>
128<tr>
129<td><code>vector (size_type size)</code></td>
130<td><a href="container_concept.htm#vector">Vector</a></td>
131<td>Allocates an uninitialized <code>vector</code> that holds
132<code>size</code> elements.</td>
133</tr>
134<tr>
135<td><code>vector (const vector &amp;v)</code></td>
136<td></td>
137<td>The copy constructor.</td>
138</tr>
139<tr>
140<td><code>template&lt;class AE&gt;<br />
141vector (const vector_expression&lt;AE&gt; &amp;ae)</code></td>
142<td></td>
143<td>The extended copy constructor.</td>
144</tr>
145<tr>
146<td><code>void resize (size_type size, bool preserve =
147true)</code></td>
148<td><a href="container_concept.htm#vector">Vector</a></td>
149<td>Reallocates a <code>vector</code> to hold <code>size</code>
150elements. The existing elements of the <code>vector</code> are
151preseved when specified.</td>
152</tr>
153<tr>
154<td><code>size_type size () const</code></td>
155<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
156<td>Returns the size of the <code>vector</code>.</td>
157</tr>
158<tr>
159<td><code>const array_type&amp; data () const</code></td>
160<td><a href="container_concept.htm#vector">Vector</a></td>
161<td></td>
162</tr>
163<tr>
164<td><code>array_type&amp; data ()</code></td>
165<td><a href="container_concept.htm#vector">Vector</a></td>
166<td></td>
167</tr>
168<tr>
169<td><code>const_reference operator () (size_type i)
170const</code></td>
171<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
172<td>Returns a <code>const</code> reference of the <code>i</code>
173-th element.</td>
174</tr>
175<tr>
176<td><code>reference operator () (size_type i)</code></td>
177<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
178<td>Returns a reference of the <code>i</code>-th element.</td>
179</tr>
180<tr>
181<td><code>const_reference operator [] (size_type i) const</code></td>
182<td><a href="container_concept.htm#vector">Vector</a></td>
183<td>Returns a <code>const</code> reference of the <code>i</code>
184-th element.</td>
185</tr>
186<tr>
187<td><code>reference operator [] (size_type i)</code></td>
188<td><a href="container_concept.htm#vector">Vector</a></td>
189<td>Returns a reference of the <code>i</code>-th element.</td>
190</tr>
191<tr>
192<td><code>vector &amp;operator = (const vector &amp;v)</code></td>
193<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
194<td>The assignment operator.</td>
195</tr>
196<tr>
197<td><code>vector &amp;assign_temporary (vector &amp;v)</code></td>
198<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
199<td>Assigns a temporary. May change the vector <code>v</code>.</td>
200</tr>
201<tr>
202<td><code>template&lt;class AE&gt;<br />
203vector &amp;operator = (const vector_expression&lt;AE&gt;
204&amp;ae)</code></td>
205<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
206<td>The extended assignment operator.</td>
207</tr>
208<tr>
209<td><code>template&lt;class AE&gt;<br />
210vector &amp;assign (const vector_expression&lt;AE&gt;
211&amp;ae)</code></td>
212<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
213<td>Assigns a vector expression to the vector. Left and right hand
214side of the assignment should be independent.</td>
215</tr>
216<tr>
217<td><code>template&lt;class AE&gt;<br />
218vector &amp;operator += (const vector_expression&lt;AE&gt;
219&amp;ae)</code></td>
220<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
221<td>A computed assignment operator. Adds the vector expression to
222the vector.</td>
223</tr>
224<tr>
225<td><code>template&lt;class AE&gt;<br />
226vector &amp;plus_assign (const vector_expression&lt;AE&gt;
227&amp;ae)</code></td>
228<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
229<td>Adds a vector expression to the vector. Left and right hand
230side of the assignment should be independent.</td>
231</tr>
232<tr>
233<td><code>template&lt;class AE&gt;<br />
234vector &amp;operator -= (const vector_expression&lt;AE&gt;
235&amp;ae)</code></td>
236<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
237<td>A computed assignment operator. Subtracts the vector expression
238from the vector.</td>
239</tr>
240<tr>
241<td><code>template&lt;class AE&gt;<br />
242vector &amp;minus_assign (const vector_expression&lt;AE&gt;
243&amp;ae)</code></td>
244<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
245<td>Subtracts a vector expression from the vector. Left and right
246hand side of the assignment should be independent.</td>
247</tr>
248<tr>
249<td><code>template&lt;class AT&gt;<br />
250vector &amp;operator *= (const AT &amp;at)</code></td>
251<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
252<td>A computed assignment operator. Multiplies the vector with a
253scalar.</td>
254</tr>
255<tr>
256<td><code>template&lt;class AT&gt;<br />
257vector &amp;operator /= (const AT &amp;at)</code></td>
258<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
259<td>A computed assignment operator. Divides the vector through a
260scalar.</td>
261</tr>
262<tr>
263<td><code>void swap (vector &amp;v)</code></td>
264<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
265<td>Swaps the contents of the vectors.</td>
266</tr>
267<tr>
268<td><code>void insert_element (size_type i, const_reference t)</code></td>
269<td><a href="container_concept.htm#vector">Vector</a></td>
270<td>Inserts the value <code>t</code> at the <code>i</code>-th
271element.</td>
272</tr>
273<tr>
274<td><code>void erase_element (size_type i)</code></td>
275<td><a href="container_concept.htm#vector">Vector</a></td>
276<td>Erases the value at the <code>i</code>-th element.</td>
277</tr>
278<tr>
279<td><code>void clear ()</code></td>
280<td><a href="container_concept.htm#vector">Vector</a></td>
281<td>Clears the vector.</td>
282</tr>
283<tr>
284<td><code>const_iterator begin () const</code></td>
285<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
286<td>Returns a <code>const_iterator</code> pointing to the beginning
287of the <code>vector</code>.</td>
288</tr>
289<tr>
290<td><code>const_iterator end () const</code></td>
291<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
292<td>Returns a <code>const_iterator</code> pointing to the end of
293the <code>vector</code>.</td>
294</tr>
295<tr>
296<td><code>iterator begin ()</code></td>
297<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
298<td>Returns a <code>iterator</code> pointing to the beginning of
299the <code>vector</code>.</td>
300</tr>
301<tr>
302<td><code>iterator end ()</code></td>
303<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
304<td>Returns a <code>iterator</code> pointing to the end of the
305<code>vector</code>.</td>
306</tr>
307<tr>
308<td><code>const_reverse_iterator rbegin () const</code></td>
309<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
310<td>Returns a <code>const_reverse_iterator</code> pointing to the
311beginning of the reversed <code>vector</code>.</td>
312</tr>
313<tr>
314<td><code>const_reverse_iterator rend () const</code></td>
315<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
316<td>Returns a <code>const_reverse_iterator</code> pointing to the
317end of the reversed <code>vector</code>.</td>
318</tr>
319<tr>
320<td><code>reverse_iterator rbegin ()</code></td>
321<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
322<td>Returns a <code>reverse_iterator</code> pointing to the
323beginning of the reversed <code>vector</code>.</td>
324</tr>
325<tr>
326<td><code>reverse_iterator rend ()</code></td>
327<td><a href="expression_concept.htm#vector_expression">VectorExpression</a></td>
328<td>Returns a <code>reverse_iterator</code> pointing to the end of
329the reversed <code>vector</code>.</td>
330</tr>
331</tbody>
332</table>
333<h4>Notes</h4>
334<p><a name="vector_1" id="vector_1">[1]</a> Common parameters
335for the Storage array are <code>unbounded_array&lt;T&gt;</code> ,
336<code>bounded_array&lt;T&gt;</code> and
337<code>std::vector&lt;T&gt;</code> .</p>
338<h2><a name="unit_vector" id="unit_vector"></a>Unit Vector</h2>
339<h4>Description</h4>
340<p>The templated class <code>unit_vector&lt;T&gt;</code> represents
341canonical unit vectors. For the <em>k</em>-th
342<em>n</em>-dimensional canonical unit vector and <em>0 &lt;= i &lt;
343n</em> holds <em>u</em><sup><em>k</em></sup><sub><em>i</em></sub>
344<em>= 0</em>, if <em>i &lt;&gt; k</em>, and
345<em>u</em><sup><em>k</em></sup><sub><em>i</em></sub> <em>=
3461</em>.</p>
347<h4>Example</h4>
348<pre>
349#include &lt;boost/numeric/ublas/vector.hpp&gt;
350#include &lt;boost/numeric/ublas/io.hpp&gt;
351
352int main () {
353    using namespace boost::numeric::ublas;
354    for (int i = 0; i &lt; 3; ++ i) {
355        unit_vector&lt;double&gt; v (3, i);
356        std::cout &lt;&lt; v &lt;&lt; std::endl;
357    }
358}
359</pre>
360<h4>Definition</h4>
361<p>Defined in the header vector.hpp.</p>
362<h4>Template parameters</h4>
363<table border="1" summary="parameters">
364<tbody>
365<tr>
366<th>Parameter</th>
367<th>Description</th>
368<th>Default</th>
369</tr>
370<tr>
371<td><code>T</code></td>
372<td>The type of object stored in the vector.</td>
373<td><code>int</code></td>
374</tr>
375</tbody>
376</table>
377<h4>Model of</h4>
378<p><a href="container_concept.htm#vector">Vector</a> .</p>
379<h4>Type requirements</h4>
380<p>None, except for those imposed by the requirements of
381<a href="container_concept.htm#vector">Vector</a> .</p>
382<h4>Public base classes</h4>
383<p><code>vector_container&lt;unit_vector&lt;T&gt; &gt;</code></p>
384<h4>Members</h4>
385<table border="1" summary="members">
386<tbody>
387<tr>
388<th>Member</th>
389<th>Description</th>
390</tr>
391<tr>
392<td><code>unit_vector ()</code></td>
393<td>Constructs an <code>unit_vector</code> that holds zero
394elements.</td>
395</tr>
396<tr>
397<td><code>unit_vector (size_type size, size_type index)</code></td>
398<td>Constructs the <code>index</code>-th <code>unit_vector</code>
399that holds <code>size</code> elements.</td>
400</tr>
401<tr>
402<td><code>unit_vector (const unit_vector &amp;v)</code></td>
403<td>The copy constructor.</td>
404</tr>
405<tr>
406<td><code>void resize (size_type size, bool preserve =
407true)</code></td>
408<td>Resizes a <code>unit_vector</code> to hold <code>size</code>
409elements. Therefore the existing elements of the
410<code>unit_vector</code> are always preseved.</td>
411</tr>
412<tr>
413<td><code>size_type size () const</code></td>
414<td>Returns the size of the <code>unit_vector</code>.</td>
415</tr>
416<tr>
417<td><code>size_type index () const</code></td>
418<td>Returns the index of the <code>unit_vector</code>.</td>
419</tr>
420<tr>
421<td><code>const_reference operator () (size_type i)
422const</code></td>
423<td>Returns the value of the <code>i</code>-th element.</td>
424</tr>
425<tr>
426<td><code>const_reference operator [] (size_type i)
427const</code></td>
428<td>Returns the value of the <code>i</code>-th element.</td>
429</tr>
430<tr>
431<td><code>unit_vector &amp;operator = (const unit_vector
432&amp;v)</code></td>
433<td>The assignment operator.</td>
434</tr>
435<tr>
436<td><code>unit_vector &amp;assign_temporary (unit_vector
437&amp;v)</code></td>
438<td>Assigns a temporary. May change the unit vector <code>v</code>
439.</td>
440</tr>
441<tr>
442<td><code>void swap (unit_vector &amp;v)</code></td>
443<td>Swaps the contents of the unit vectors.</td>
444</tr>
445<tr>
446<td><code>const_iterator begin () const</code></td>
447<td>Returns a <code>const_iterator</code> pointing to the beginning
448of the <code>unit_vector</code>.</td>
449</tr>
450<tr>
451<td><code>const_iterator end () const</code></td>
452<td>Returns a <code>const_iterator</code> pointing to the end of
453the <code>unit_vector</code>.</td>
454</tr>
455<tr>
456<td><code>const_reverse_iterator rbegin () const</code></td>
457<td>Returns a <code>const_reverse_iterator</code> pointing to the
458beginning of the reversed <code>unit_vector</code>.</td>
459</tr>
460<tr>
461<td><code>const_reverse_iterator rend () const</code></td>
462<td>Returns a <code>const_reverse_iterator</code> pointing to the
463end of the reversed <code>unit_vector</code>.</td>
464</tr>
465</tbody>
466</table>
467<h2><a name="zero_vector" id="zero_vector"></a>Zero Vector</h2>
468<h4>Description</h4>
469<p>The templated class <code>zero_vector&lt;T&gt;</code> represents
470zero vectors. For a <em>n</em>-dimensional zero vector and <em>0
471&lt;= i &lt; n</em> holds <em>z</em><sub><em>i</em></sub> <em>=
4720</em>.</p>
473<h4>Example</h4>
474<pre>
475#include &lt;boost/numeric/ublas/vector.hpp&gt;
476#include &lt;boost/numeric/ublas/io.hpp&gt;
477
478int main () {
479    using namespace boost::numeric::ublas;
480    zero_vector&lt;double&gt; v (3);
481    std::cout &lt;&lt; v &lt;&lt; std::endl;
482}
483</pre>
484<h4>Definition</h4>
485<p>Defined in the header vector.hpp.</p>
486<h4>Template parameters</h4>
487<table border="1" summary="parameters">
488<tbody>
489<tr>
490<th>Parameter</th>
491<th>Description</th>
492<th>Default</th>
493</tr>
494<tr>
495<td><code>T</code></td>
496<td>The type of object stored in the vector.</td>
497<td><code>int</code></td>
498</tr>
499</tbody>
500</table>
501<h4>Model of</h4>
502<p><a href="container_concept.htm#vector">Vector</a> .</p>
503<h4>Type requirements</h4>
504<p>None, except for those imposed by the requirements of
505<a href="container_concept.htm#vector">Vector</a> .</p>
506<h4>Public base classes</h4>
507<p><code>vector_container&lt;zero_vector&lt;T&gt; &gt;</code></p>
508<h4>Members</h4>
509<table border="1" summary="members">
510<tbody>
511<tr>
512<th>Member</th>
513<th>Description</th>
514</tr>
515<tr>
516<td><code>zero_vector ()</code></td>
517<td>Constructs a <code>zero_vector</code> that holds zero
518elements.</td>
519</tr>
520<tr>
521<td><code>zero_vector (size_type size)</code></td>
522<td>Constructs a <code>zero_vector</code> that holds
523<code>size</code> elements.</td>
524</tr>
525<tr>
526<td><code>zero_vector (const zero_vector &amp;v)</code></td>
527<td>The copy constructor.</td>
528</tr>
529<tr>
530<td><code>void resize (size_type size, bool preserve =
531true)</code></td>
532<td>Resizes a <code>zero_vector</code> to hold <code>size</code>
533elements. Therefore the existing elements of the
534<code>zero_vector</code> are always preseved.</td>
535</tr>
536<tr>
537<td><code>size_type size () const</code></td>
538<td>Returns the size of the <code>zero_vector</code>.</td>
539</tr>
540<tr>
541<td><code>const_reference operator () (size_type i)
542const</code></td>
543<td>Returns the value of the <code>i</code>-th element.</td>
544</tr>
545<tr>
546<td><code>const_reference operator [] (size_type i)
547const</code></td>
548<td>Returns the value of the <code>i</code>-th element.</td>
549</tr>
550<tr>
551<td><code>zero_vector &amp;operator = (const zero_vector
552&amp;v)</code></td>
553<td>The assignment operator.</td>
554</tr>
555<tr>
556<td><code>zero_vector &amp;assign_temporary (zero_vector
557&amp;v)</code></td>
558<td>Assigns a temporary. May change the zero vector <code>v</code>
559.</td>
560</tr>
561<tr>
562<td><code>void swap (zero_vector &amp;v)</code></td>
563<td>Swaps the contents of the zero vectors.</td>
564</tr>
565<tr>
566<td><code>const_iterator begin () const</code></td>
567<td>Returns a <code>const_iterator</code> pointing to the beginning
568of the <code>zero_vector</code>.</td>
569</tr>
570<tr>
571<td><code>const_iterator end () const</code></td>
572<td>Returns a <code>const_iterator</code> pointing to the end of
573the <code>zero_vector</code>.</td>
574</tr>
575<tr>
576<td><code>const_reverse_iterator rbegin () const</code></td>
577<td>Returns a <code>const_reverse_iterator</code> pointing to the
578beginning of the reversed <code>zero_vector</code>.</td>
579</tr>
580<tr>
581<td><code>const_reverse_iterator rend () const</code></td>
582<td>Returns a <code>const_reverse_iterator</code> pointing to the
583end of the reversed <code>zero_vector</code>.</td>
584</tr>
585</tbody>
586</table>
587<h2><a name="scalar_vector" id="scalar_vector"></a>Scalar Vector</h2>
588<h4>Description</h4>
589<p>The templated class <code>scalar_vector&lt;T&gt;</code>
590represents scalar vectors. For a <em>n</em>-dimensional scalar
591vector and <em>0 &lt;= i &lt; n</em> holds
592<em>z</em><sub><em>i</em></sub> <em>= s</em>.</p>
593<h4>Example</h4>
594<pre>
595#include &lt;boost/numeric/ublas/vector.hpp&gt;
596#include &lt;boost/numeric/ublas/io.hpp&gt;
597
598int main () {
599    using namespace boost::numeric::ublas;
600    scalar_vector&lt;double&gt; v (3);
601    std::cout &lt;&lt; v &lt;&lt; std::endl;
602}
603</pre>
604<h4>Definition</h4>
605<p>Defined in the header vector.hpp.</p>
606<h4>Template parameters</h4>
607<table border="1" summary="parameters">
608<tbody>
609<tr>
610<th>Parameter</th>
611<th>Description</th>
612<th>Default</th>
613</tr>
614<tr>
615<td><code>T</code></td>
616<td>The type of object stored in the vector.</td>
617<td><code>int</code></td>
618</tr>
619</tbody>
620</table>
621<h4>Model of</h4>
622<p><a href="container_concept.htm#vector">Vector</a> .</p>
623<h4>Type requirements</h4>
624<p>None, except for those imposed by the requirements of
625<a href="container_concept.htm#vector">Vector</a> .</p>
626<h4>Public base classes</h4>
627<p><code>vector_container&lt;scalar_vector&lt;T&gt;
628&gt;</code></p>
629<h4>Members</h4>
630<table border="1" summary="members">
631<tbody>
632<tr>
633<th>Member</th>
634<th>Description</th>
635</tr>
636<tr>
637<td><code>scalar_vector ()</code></td>
638<td>Constructs a <code>scalar_vector</code> that holds zero
639elements.</td>
640</tr>
641<tr>
642<td><code>scalar_vector (size_type size, const value_type
643&amp;value)</code></td>
644<td>Constructs a <code>scalar_vector</code> that holds
645<code>size</code> elements each of the specified value.</td>
646</tr>
647<tr>
648<td><code>scalar_vector (const scalar_vector &amp;v)</code></td>
649<td>The copy constructor.</td>
650</tr>
651<tr>
652<td><code>void resize (size_type size, bool preserve =
653true)</code></td>
654<td>Resizes a <code>scalar_vector</code> to hold <code>size</code>
655elements. Therefore the existing elements of the
656<code>scalar_vector</code> are always preseved.</td>
657</tr>
658<tr>
659<td><code>size_type size () const</code></td>
660<td>Returns the size of the <code>scalar_vector</code>.</td>
661</tr>
662<tr>
663<td><code>const_reference operator () (size_type i)
664const</code></td>
665<td>Returns the value of the <code>i</code>-th element.</td>
666</tr>
667<tr>
668<td><code>const_reference operator [] (size_type i)
669const</code></td>
670<td>Returns the value of the <code>i</code>-th element.</td>
671</tr>
672<tr>
673<td><code>scalar_vector &amp;operator = (const scalar_vector
674&amp;v)</code></td>
675<td>The assignment operator.</td>
676</tr>
677<tr>
678<td><code>scalar_vector &amp;assign_temporary (scalar_vector
679&amp;v)</code></td>
680<td>Assigns a temporary. May change the scalar vector
681<code>v</code> .</td>
682</tr>
683<tr>
684<td><code>void swap (scalar_vector &amp;v)</code></td>
685<td>Swaps the contents of the scalar vectors.</td>
686</tr>
687<tr>
688<td><code>const_iterator begin () const</code></td>
689<td>Returns a <code>const_iterator</code> pointing to the beginning
690of the <code>scalar_vector</code>.</td>
691</tr>
692<tr>
693<td><code>const_iterator end () const</code></td>
694<td>Returns a <code>const_iterator</code> pointing to the end of
695the <code>scalar_vector</code>.</td>
696</tr>
697<tr>
698<td><code>const_reverse_iterator rbegin () const</code></td>
699<td>Returns a <code>const_reverse_iterator</code> pointing to the
700beginning of the reversed <code>scalar_vector</code>.</td>
701</tr>
702<tr>
703<td><code>const_reverse_iterator rend () const</code></td>
704<td>Returns a <code>const_reverse_iterator</code> pointing to the
705end of the reversed <code>scalar_vector</code>.</td>
706</tr>
707</tbody>
708</table>
709<hr />
710<p>Copyright (&copy;) 2000-2002 Joerg Walter, Mathias Koch<br />
711Permission to copy, use, modify, sell and distribute this document
712is granted provided this copyright notice appears in all copies.
713This document is provided ``as is'' without express or implied
714warranty, and with no claim as to its suitability for any
715purpose.</p>
716</body>
717</html>
Note: See TracBrowser for help on using the repository browser.