1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>Chapter 27. Boost.MultiArray Reference Manual</title> 6<link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css"> 7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 8<link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> 9<link rel="up" href="libraries.html" title="Part I. The Boost C++ Libraries (BoostBook Subset)"> 10<link rel="prev" href="mpi/acknowledge.html" title="Acknowledgments"> 11<link rel="next" href="MultiArray.html" title="MultiArray Concept"> 12</head> 13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 14<table cellpadding="2" width="100%"><tr> 15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../boost.png"></td> 16<td align="center"><a href="../../index.html">Home</a></td> 17<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td> 18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 20<td align="center"><a href="../../more/index.htm">More</a></td> 21</tr></table> 22<hr> 23<div class="spirit-nav"> 24<a accesskey="p" href="mpi/acknowledge.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="MultiArray.html"><img src="../../doc/src/images/next.png" alt="Next"></a> 25</div> 26<div class="chapter"> 27<div class="titlepage"><div> 28<div><h2 class="title"> 29<a name="multi_array"></a>Chapter 27. Boost.MultiArray Reference Manual</h2></div> 30<div><div class="author"> 31<h3 class="author"> 32<span class="firstname">Ronald</span> <span class="surname">Garcia</span> 33</h3> 34<div class="affiliation"> 35<span class="orgname">Indiana University<br></span> <span class="orgdiv">Open Systems Lab<br></span> 36</div> 37</div></div> 38<div><p class="copyright">Copyright © 2002 The Trustees of Indiana University</p></div> 39</div></div> 40<div class="toc"> 41<p><b>Table of Contents</b></p> 42<dl class="toc"> 43<dt><span class="sect1"><a href="multi_array.html#synopsis">Library Synopsis</a></span></dt> 44<dt><span class="sect1"><a href="MultiArray.html">MultiArray Concept</a></span></dt> 45<dd><dl> 46<dt><span class="sect2"><a href="MultiArray.html#id-1.3.28.5.8">Notation</a></span></dt> 47<dt><span class="sect2"><a href="MultiArray.html#id-1.3.28.5.9">Associated Types</a></span></dt> 48<dt><span class="sect2"><a href="MultiArray.html#id-1.3.28.5.10">Valid expressions</a></span></dt> 49<dt><span class="sect2"><a href="MultiArray.html#id-1.3.28.5.11">Complexity guarantees</a></span></dt> 50<dt><span class="sect2"><a href="MultiArray.html#id-1.3.28.5.12">Invariants</a></span></dt> 51<dt><span class="sect2"><a href="MultiArray.html#view_types">Associated Types for Views</a></span></dt> 52<dt><span class="sect2"><a href="MultiArray.html#id-1.3.28.5.14">Models</a></span></dt> 53</dl></dd> 54<dt><span class="sect1"><a href="array_types.html">Array Components</a></span></dt> 55<dd><dl> 56<dt><span class="sect2"><a href="array_types.html#multi_array_class"><code class="literal">multi_array</code></a></span></dt> 57<dt><span class="sect2"><a href="array_types.html#multi_array_ref"><code class="literal">multi_array_ref</code></a></span></dt> 58<dt><span class="sect2"><a href="array_types.html#const_multi_array_ref"><code class="literal">const_multi_array_ref</code></a></span></dt> 59</dl></dd> 60<dt><span class="sect1"><a href="auxiliary.html">Auxiliary Components</a></span></dt> 61<dd><dl> 62<dt><span class="sect2"><a href="auxiliary.html#multi_array_types"><code class="literal">multi_array_types</code></a></span></dt> 63<dt><span class="sect2"><a href="auxiliary.html#extent_range"><code class="computeroutput">extent_range</code></a></span></dt> 64<dt><span class="sect2"><a href="auxiliary.html#extent_gen"><code class="computeroutput">extent_gen</code></a></span></dt> 65<dt><span class="sect2"><a href="auxiliary.html#id-1.3.28.7.5">Global Objects</a></span></dt> 66<dt><span class="sect2"><a href="auxiliary.html#generators">View and SubArray Generators</a></span></dt> 67<dt><span class="sect2"><a href="auxiliary.html#memory_layout">Memory Layout Specifiers</a></span></dt> 68<dt><span class="sect2"><a href="auxiliary.html#range_checking">Range Checking</a></span></dt> 69</dl></dd> 70</dl> 71</div> 72<p>Boost.MultiArray is composed of several components. 73The MultiArray concept defines a generic interface to multidimensional 74containers. 75<code class="literal">multi_array</code> is a general purpose container class 76that models MultiArray. <code class="literal">multi_array_ref</code> 77and <code class="literal">const_multi_array_ref</code> are adapter 78classes. Using them, 79you can manipulate any block of contiguous data as though it were a 80<code class="literal">multi_array</code>. 81<code class="literal">const_multi_array_ref</code> differs from 82<code class="literal">multi_array_ref</code> in that its elements cannot 83be modified through its interface. Finally, several auxiliary classes are used 84to create and specialize arrays and some global objects are defined as 85part of the library interface.</p> 86<div class="sect1"> 87<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 88<a name="synopsis"></a>Library Synopsis</h2></div></div></div> 89<p>To use Boost.MultiArray, you must include the header 90<code class="filename">boost/multi_array.hpp</code> in your source. This file 91brings the following declarations into scope:</p> 92<pre class="programlisting"> 93namespace boost { 94 95 namespace multi_array_types { 96 typedef *unspecified* index; 97 typedef *unspecified* size_type; 98 typedef *unspecified* difference_type; 99 typedef *unspecified* index_range; 100 typedef *unspecified* extent_range; 101 typedef *unspecified* index_gen; 102 typedef *unspecified* extent_gen; 103 } 104 105 template <typename ValueType, 106 std::size_t NumDims, 107 typename Allocator = std::allocator<ValueType> > 108 class multi_array; 109 110 template <typename ValueType, 111 std::size_t NumDims> 112 class multi_array_ref; 113 114 template <typename ValueType, 115 std::size_t NumDims> 116 class const_multi_array_ref; 117 118 multi_array_types::extent_gen extents; 119 multi_array_types::index_gen indices; 120 121 template <typename Array, int N> class subarray_gen; 122 template <typename Array, int N> class const_subarray_gen; 123 template <typename Array, int N> class array_view_gen; 124 template <typename Array, int N> class const_array_view_gen; 125 126 class c_storage_order; 127 class fortran_storage_order; 128 template <std::size_t NumDims> class general_storage_order; 129 130} 131</pre> 132</div> 133</div> 134<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 135<td align="left"></td> 136<td align="right"><div class="copyright-footer"></div></td> 137</tr></table> 138<hr> 139<div class="spirit-nav"> 140<a accesskey="p" href="mpi/acknowledge.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.html"><img src="../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="index.html"><img src="../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="MultiArray.html"><img src="../../doc/src/images/next.png" alt="Next"></a> 141</div> 142</body> 143</html> 144