File: const_multi_array_ref.xml

package info (click to toggle)
boost1.83 1.83.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 545,632 kB
  • sloc: cpp: 3,857,086; xml: 125,552; ansic: 34,414; python: 25,887; asm: 5,276; sh: 4,799; ada: 1,681; makefile: 1,629; perl: 1,212; pascal: 1,139; sql: 810; yacc: 478; ruby: 102; lisp: 24; csh: 6
file content (190 lines) | stat: -rw-r--r-- 6,405 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<sect2 id="const_multi_array_ref">
<title><literal>const_multi_array_ref</literal></title>

<para>
<literal>const_multi_array_ref</literal> is a multi-dimensional container
adaptor.  It provides the MultiArray interface over any contiguous
block of elements.  <literal>const_multi_array_ref</literal> exports the
same interface as <literal>multi_array</literal>, with the exception
of the constructors.
</para>


<formalpara>
      <title>Model Of.</title>
<para>
<literal>const_multi_array_ref</literal> models
<link linkend="MultiArray">MultiArray</link>,
<ulink url="../../../libs/utility/CopyConstructible.html">CopyConstructible</ulink>.
and depending on the element type, it may also model
<ulink url="https://www.boost.org/sgi/stl/EqualityComparable.html">EqualityComparable</ulink> and <ulink url="https://www.boost.org/sgi/stl/LessThanComparable.html">LessThanComparable</ulink>. 

Detailed descriptions are provided here only for operations that are
not described in the <literal>multi_array</literal> reference.
</para>
</formalpara>

<formalpara>
<title>Synopsis</title>

<programlisting>
<![CDATA[
namespace boost {

template <typename ValueType, 
          std::size_t NumDims, 
          typename TPtr = const T*>
class const_multi_array_ref {
public:
// types:
  typedef ValueType                             element;
  typedef *unspecified*                         value_type;
  typedef *unspecified*                         reference;
  typedef *unspecified*                         const_reference;
  typedef *unspecified*                         difference_type;
  typedef *unspecified*                         iterator;
  typedef *unspecified*                         const_iterator;
  typedef *unspecified*                         reverse_iterator;
  typedef *unspecified*                         const_reverse_iterator;
  typedef multi_array_types::size_type          size_type;
  typedef multi_array_types::index              index;
  typedef multi_array_types::index_gen          index_gen;
  typedef multi_array_types::index_range        index_range;
  typedef multi_array_types::extent_gen         extent_gen;
  typedef multi_array_types::extent_range       extent_range;
  typedef *unspecified*                         storage_order_type;
  
  // template typedefs
  template <std::size_t Dims> struct            subarray;
  template <std::size_t Dims> struct            const_subarray;
  template <std::size_t Dims> struct            array_view;
  template <std::size_t Dims> struct            const_array_view;
  

  // structors

  template <typename ExtentList>
  explicit const_multi_array_ref(TPtr data, const ExtentList& sizes,
                       const storage_order_type& store = c_storage_order());
  explicit const_multi_array_ref(TPtr data, const extents_tuple& ranges,
                       const storage_order_type& store = c_storage_order());
  const_multi_array_ref(const const_multi_array_ref& x);
  ~const_multi_array_ref();



  // iterators:
  const_iterator			begin() const;
  const_iterator			end() const;
  const_reverse_iterator		rbegin() const;
  const_reverse_iterator		rend() const;

  // capacity:
  size_type				size() const;
  size_type				num_elements() const;
  size_type				num_dimensions() const;
 
  // element access:
  template <typename IndexList>
    const element&		operator()(const IndexList& indices) const;
  const_reference		operator[](index i) const;
  const_array_view<Dims>::type	operator[](const indices_tuple& r) const;

  // queries
  const element*		data() const;
  const element*		origin() const;
  const size_type*		shape() const;
  const index*			strides() const;
  const index*			index_bases() const;
  const storage_order_type&     storage_order() const;

  // comparators
  bool operator==(const const_multi_array_ref& rhs);
  bool operator!=(const const_multi_array_ref& rhs);
  bool operator<(const const_multi_array_ref& rhs);
  bool operator>(const const_multi_array_ref& rhs);
  bool operator>=(const const_multi_array_ref& rhs);
  bool operator<=(const const_multi_array_ref& rhs);

  // modifiers:
  template <typename SizeList>
  void			reshape(const SizeList& sizes)
  template <typename BaseList>	void reindex(const BaseList& values);
  void				reindex(index value);
};
]]>
</programlisting>
</formalpara>

<formalpara>
<title>Constructors</title>

<variablelist>
<varlistentry>
<term><programlisting>template &lt;typename ExtentList&gt;
explicit const_multi_array_ref(TPtr data, 
                     const ExtentList&amp; sizes,
                     const storage_order&amp; store = c_storage_order());
</programlisting></term>
<listitem>

<para>
This constructs a <literal>const_multi_array_ref</literal> using the specified
parameters.  <literal>sizes</literal> specifies the shape of the
constructed <literal>const_multi_array_ref</literal>.  <literal>store</literal>
specifies the storage order or layout in memory of the array
dimensions.
</para>

<formalpara><title><literal>ExtentList</literal> Requirements</title>
<para>
<literal>ExtentList</literal> must model <ulink url="../../utility/Collection.html">Collection</ulink>.
</para>
</formalpara>

<formalpara><title>Preconditions</title>
<para><literal>sizes.size() == NumDims;</literal></para>
</formalpara>

</listitem>
</varlistentry>

<varlistentry>
<term>
<programlisting><![CDATA[explicit const_multi_array_ref(TPtr data,
                     extent_gen::gen_type<NumDims>::type ranges,
                     const storage_order& store = c_storage_order());]]>
</programlisting></term> 
<listitem>
<formalpara><title>Effects</title>
<para>
This constructs a <literal>const_multi_array_ref</literal> using the specified
    parameters.  <literal>ranges</literal> specifies the shape and
index bases of the constructed const_multi_array_ref. It is the result of 
<literal>NumDims</literal> chained calls to 
    <literal>extent_gen::operator[]</literal>. <literal>store</literal>
specifies the storage order or layout in memory of the array
dimensions. 
</para>
</formalpara>
</listitem>
</varlistentry> 


<varlistentry>
<term><programlisting>
<![CDATA[const_multi_array_ref(const const_multi_array_ref& x);]]>
</programlisting></term>
<listitem>
<formalpara>
<title>Effects</title>
		  <para>This constructs a shallow copy of <literal>x</literal>.
</para></formalpara>
</listitem>
</varlistentry>

</variablelist>

</formalpara>

</sect2>