- Timestamp:
- Oct 3, 2008, 10:27:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/concepts.doxygen
r1545 r1547 25 25 26 26 - \subpage concept_container_2d 27 - \subpage concept_distance 27 28 - \subpage concept_mutable_container_2d 28 - \subpage concept_distance29 29 - \subpage concept_neighbor_weighting 30 30 */ … … 36 36 \section Description 37 37 38 \ref concept_container_2d is a concept... 38 \ref concept_container_2d is a <a 39 href="http://www.sgi.com/tech/stl/Container.html">Container</a> that 40 stores elements in a two-dimensional array (columns and rows). It 41 provides element access element of a specific row and column, as well 42 as iterators than can be used iterate over a specific column or row. 39 43 40 44 \section Requirements 41 45 42 Classes modelling the concept \ref concept_container_2d should implement 43 the following public function: ... 46 A \ref concept_container_2d provides the following: 47 48 \subsection Types 49 50 <table cellspacing=0> 51 <tr><td>Const reference type</td><td><tt>X::const_reference</tt></td> 52 <td>A type that behaves as const reference to the \ref 53 concept_container_2d 's value type.</td> 54 </tr> 55 <tr> 56 <td>Const iterator type</td> 57 <td><tt>X::const_iterator</tt></td> 58 <td> 59 A read-only iterator that can be used to iterate over the entire \ref 60 concept_container_2d. Typically the iterator iterates along a 61 row, and when the end of one row is reached it jumps to the 62 beginning of the next row. 63 </td> 64 </tr> 65 <tr> 66 <td>Const column iterator type</td> 67 <td><tt>X::const_column_iterator</tt></td> 68 <td> 69 A read-only iterator that can be used to examine the elements in one 70 column of the \ref concept_container_2d. 71 </td> 72 </tr> 73 <tr> 74 <td>Const row iterator type</td> 75 <td><tt>X::const_row_iterator</tt></td> 76 <td> 77 A read-only iterator that can be used to examine the elements in one 78 row of the \ref concept_container_2d. 79 </td> 80 </tr> 81 </table> 82 83 \subsection public_functions Public Functions 84 85 <table cellspacing=0> 86 <tr> 87 <th>Name</th><th>Expression</th><th>Precondition</th><th>Return type</th> 88 <th>Postcondition</th> 89 </tr> 90 <tr> 91 <td>Beginning of range</td> 92 <td><tt>a.begin()</tt></td> 93 <td> </td> 94 <td><tt>const_iterator</tt></td> 95 <td> </td> 96 </tr> 97 <tr> 98 <td>Beginning of column</td> 99 <td><tt>a.begin_column(size_t column)</tt></td> 100 <td><tt>0 <= column < a.columns()</tt></td> 101 <td><tt>const_column_iterator</tt></td> 102 <td> </td> 103 </tr> 104 <tr> 105 <td>Beginning of row</td> 106 <td><tt>a.begin_row(size_t row)</tt></td> 107 <td><tt>0 <= row < a.rows()</tt></td> 108 <td><tt>const_row_iterator</tt></td> 109 <td> </td> 110 </tr> 111 <tr> 112 <td>End of range</td> 113 <td><tt>a.end()</tt></td> 114 <td> </td> 115 <td><tt>const_iterator</tt></td> 116 <td> </td> 117 </tr> 118 <tr> 119 <td>End of column</td> 120 <td><tt>a.end_column(size_t column)</tt></td> 121 <td><tt>0 <= column < a.columns()</tt></td> 122 <td><tt>const_column_iterator</tt></td> 123 <td> </td> 124 </tr> 125 <tr> 126 <td>End of row</td> 127 <td><tt>a.end_row(size_t row)</tt></td> 128 <td><tt>0 <= row < a.rows()</tt></td> 129 <td><tt>const_row_iterator</tt></td> 130 <td> </td> 131 </tr> 132 <tr> 133 <td>Columns</td> 134 <td><tt>a.columns()</tt></td> 135 <td> </td> 136 <td><tt>size_t</tt></td> 137 <td> </td> 138 </tr> 139 <tr> 140 <td>Rows</td> 141 <td><tt>a.rows()</tt></td> 142 <td> </td> 143 <td><tt>size_t</tt></td> 144 <td> </td> 145 </tr> 146 <tr> 147 <td>Element Access</td> 148 <td><tt>a(size_t row, size_t column)</tt></td> 149 <td><tt>0 <= row<a.rows()</tt> and 150 <tt>0 <= column < a.columns()</tt></td> 151 <td><tt>const_reference</tt></td> 152 <td> </td> 153 </tr> 154 </table> 44 155 45 156 \section Implementations 46 157 47 Examples of classes modelling the concept \ref concept_container_2d 48 include ... 49 50 */ 51 52 /** 53 \page concept_mutable_container_2d MutableContainer2D 158 Examples of concept \ref concept_container_2d include: 159 - theplu::yat::classifier::MatrixLookup, 160 - theplu::yat::classifier::MatrixLookupWeighted 161 - theplu::yat::classifier::KernelLookup. 162 163 */ 164 165 /** 166 \page concept_mutable_container_2d Mutable Container2D 54 167 55 168 \section Description 56 169 57 \ref concept_mutable_container_2d is a concept... 170 \ref concept_mutable_container_2d is a \ref concept_container_2d that 171 also provides non-const access to its elements. 58 172 59 173 \section Requirements 60 174 175 In addition to the requirements defined in \ref concept_container_2d, 176 a \ref concept_mutable_container_2d also provides the following: 177 178 \subsection Types 179 180 <table cellspacing=0> 181 <tr><td>Reference type</td><td><tt>X::reference</tt></td> 182 <td>A type that behaves as reference to the \ref 183 concept_mutable_container_2d 's value type.</td> 184 </tr> 185 <tr> 186 <td>Iterator type</td> 187 <td><tt>X::iterator</tt></td> 188 <td> 189 190 A mutable iterator similar to Const iterator type, which can be used to 191 iterate over the \ref concept_mutable_container_2d (and modify the 192 elements). Typically the iterator iterates along a row, and when the 193 end of one row is reached it jumps to the beginning of the next row. 194 195 </td> 196 </tr> 197 <tr> 198 <td>Column iterator type</td> 199 <td><tt>X::column_iterator</tt></td> 200 <td> 201 A mutable iterator that can be used to modify the elements in one 202 column of the \ref concept_mutable_container_2d. 203 </td> 204 </tr> 205 <tr> 206 <td>Row iterator type</td> 207 <td><tt>X::row_iterator</tt></td> 208 <td> 209 A mutable iterator that can be used to modify the elements in one 210 row of the \ref concept_mutable_container_2d. 211 </td> 212 </tr> 213 </table> 214 215 \subsection public_functions Public Functions 216 217 <table cellspacing=0> 218 <tr> 219 <th>Name</th><th>Expression</th><th>Precondition</th><th>Return type</th> 220 <th>Postcondition</th> 221 </tr> 222 <tr> 223 <td>Beginning of range</td> 224 <td><tt>a.begin()</tt></td> 225 <td> </td> 226 <td><tt>iterator</tt></td> 227 <td><tt>iterator</tt> is derefenceable, unless <tt>a</tt> is empty</td> 228 </tr> 229 <tr> 230 <td>Beginning of column</td> 231 <td><tt>a.begin_column(size_t column)</tt></td> 232 <td><tt>0 <= column < a.columns()</tt></td> 233 <td><tt>column_iterator</tt></td> 234 <td><tt>column_iterator</tt> is derefenceable, unless <tt>a</tt> is empty</td> 235 </tr> 236 <tr> 237 <td>Beginning of row</td> 238 <td><tt>a.begin_row(size_t row)</tt></td> 239 <td><tt>0 <= row < a.rows()</tt></td> 240 <td><tt>row_iterator</tt></td> 241 <td><tt>row_iterator</tt> is derefenceable, unless <tt>a</tt> is empty</td> 242 </tr> 243 <tr> 244 <td>End of range</td> 245 <td><tt>a.end()</tt></td> 246 <td> </td> 247 <td><tt>iterator</tt></td> 248 <td> </td> 249 </tr> 250 <tr> 251 <td>End of column</td> 252 <td><tt>a.end_column(size_t column)</tt></td> 253 <td><tt>column<a.columns()</tt></td> 254 <td><tt>column_iterator</tt></td> 255 <td> </td> 256 </tr> 257 <tr> 258 <td>End of row</td> 259 <td><tt>a.end_row(size_t row)</tt></td> 260 <td><tt>row<a.rows()</tt></td> 261 <td><tt>row_iterator</tt></td> 262 <td> </td> 263 </tr> 264 <tr> 265 <td>Element Access</td> 266 <td><tt>a(size_t row, size_t column)</tt></td> 267 <td><tt>0 <= row < a.rows()</tt> and 268 <tt>0 <= column < a.columns()</tt></td> 269 <td><tt>reference</tt></td> 270 <td> </td> 271 </tr> 272 </table> 273 61 274 \section Implementations 62 275 63 Examples of classes modelling the concept \ref 64 concept_mutable_container_2d include ... 276 Examples of concept \ref concept_mutable_container_2d include: 277 - theplu::yat::utility::Matrix, 278 - theplu::yat::utility::MatrixWeighted 65 279 66 280 */
Note: See TracChangeset
for help on using the changeset viewer.