Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/graph/doc/BasicMatrix.html @ 14

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

added boost

File size: 2.3 KB
Line 
1<HTML>
2<!--
3  -- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
4  --
5  -- Permission to use, copy, modify, distribute and sell this software
6  -- and its documentation for any purpose is hereby granted without fee,
7  -- provided that the above copyright notice appears in all copies and
8  -- that both that copyright notice and this permission notice appear
9  -- in supporting documentation.  We make no
10  -- representations about the suitability of this software for any
11  -- purpose.  It is provided "as is" without express or implied warranty.
12  -->
13<Head>
14<Title>BasicMatrix</Title>
15<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" 
16        ALINK="#ff0000"> 
17<IMG SRC="../../../boost.png" 
18     ALT="C++ Boost" width="277" height="86"> 
19
20<BR Clear>
21
22<H1><A NAME="concept:BasicMatrix"></A>
23BasicMatrix
24</H1>
25
26The BasicMatrix concept provides a minimalist interface for
27accessing elements from a 2 dimensional table of values.
28
29
30<H3>Refinement of</H3>
31
32none
33
34<h3>Notation</h3>
35
36<Table>
37<TR>
38<TD>{<tt>M,I,V</tt>}</TD>
39<TD>The matrix, index, and values types that together model the BasicMatrix concept.</TD>
40</TR>
41
42<TR>
43<TD><tt>A</tt></TD>
44<TD>An object of type <tt>M</tt>.</TD>
45</TR>
46
47<TR>
48<TD><tt>i, j</tt></TD>
49<TD>Objects of type <tt>I</tt>.</TD>
50</TR>
51
52</table>
53
54<H3>Associated Types</H3>
55
56none
57
58<h3>Valid Expressions</h3>
59
60<Table border>
61
62<tr>
63<td><a name="sec:elt-access"><TT>A[i][j]</TT></a></TD>
64<TD>Returns a reference to the element object stored at index <tt>(i,j)</tt><br>
65Return type: <TT>V&amp;</TT> for mutable <tt>A</tt> or <TT>const V&amp;</TT>
66for constant <tt>A</tt>.
67</TD>
68</TR>
69
70</table>
71
72<H3>Complexity guarantees</H3>
73
74Element access is constant time.
75
76<H3>Concept Checking Class</H3>
77
78<pre>
79  template &lt;class M, class I, class V&gt;
80  struct BasicMatrixConcept
81  {
82    void constraints() {
83      V&amp; elt = A[i][j];
84      const_constraints(A);
85      ignore_unused_variable_warning(elt);     
86    }
87    void const_constraints(const M&amp; A) {
88      const V&amp; elt = A[i][j];
89      ignore_unused_variable_warning(elt);     
90    }
91    M A;
92    I i, j;
93  };
94</pre>
95
96<br>
97<HR>
98<TABLE>
99<TR valign=top>
100<TD nowrap>Copyright &copy 2000-2001</TD><TD>
101<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
102Indiana University (<A
103HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
104</TD></TR></TABLE>
105
106</BODY>
107</HTML> 
Note: See TracBrowser for help on using the repository browser.