@@ -192,7 +192,9 @@ pub type Ixs = isize;
192
192
///
193
193
/// ## Contents
194
194
///
195
- /// + [Array and RcArray](#ownedarray-and-rcarray)
195
+ /// + [Array](#array)
196
+ /// + [RcArray](#rcarray)
197
+ /// + [Array Views](#array-views)
196
198
/// + [Indexing and Dimension](#indexing-and-dimension)
197
199
/// + [Slicing](#slicing)
198
200
/// + [Subviews](#subviews)
@@ -202,16 +204,51 @@ pub type Ixs = isize;
202
204
/// + [Methods For All Array Types](#methods-for-all-array-types)
203
205
/// + [Methods Specific to Array Views](#methods-specific-to-array-views)
204
206
///
205
- /// ## `Array` and `RcArray`
206
207
///
207
- /// `Array` owns the underlying array elements directly (just like
208
- /// a `Vec`), while [`RcArray`](type.RcArray.html) is a an array with reference
209
- /// counted data. `RcArray` can act both as an owner or as a view in that regard.
208
+ ///
209
+ ///
210
+ /// ## `Array`
211
+ ///
212
+ /// [`Array`](type.Array.html) is an owned array that ows the underlying array
213
+ /// elements directly (just like a `Vec`) and it is the default way to create and
214
+ /// store n-dimensional data. `Array<A, D>` has two type parameters: `A` for
215
+ /// the element type, and `D` for the dimensionality. A particular
216
+ /// dimensionality's type alias like `Array3<A>` just has the type parameter
217
+ /// `A` for element type.
218
+ ///
219
+ /// An example:
220
+ ///
221
+ /// ```
222
+ /// // Create a three-dimensional f64 array, initialized with zeros
223
+ /// use ndarray::Array3;
224
+ /// let mut temperature = Array3::<f64>::zeros((3, 4, 5));
225
+ /// // Increase the temperature in this location
226
+ /// temperature[[2, 2, 2]] += 0.5;
227
+ /// ```
228
+ ///
229
+ /// ## `RcArray`
230
+ ///
231
+ /// [`RcArray`](type.RcArray.html) is an owned array with reference counted
232
+ /// data (shared ownership).
210
233
/// Sharing requires that it uses copy-on-write for mutable operations.
211
234
/// Calling a method for mutating elements on `RcArray`, for example
212
235
/// [`view_mut()`](#method.view_mut) or [`get_mut()`](#method.get_mut),
213
236
/// will break sharing and require a clone of the data (if it is not uniquely held).
214
237
///
238
+ /// ## Array Views
239
+ ///
240
+ /// `ArrayView` and `ArrayViewMut` are read-only and read-write array views
241
+ /// respectively. They use dimensionality, indexing, and almost all other
242
+ /// methods the same was as the other array types.
243
+ ///
244
+ /// A view is created from an array using `.view()`, `.view_mut()`, using
245
+ /// slicing (`.slice()`, `.slice_mut()`) or from one of the many iterators
246
+ /// that yield array views.
247
+ ///
248
+ /// You can also create an array view from a regular slice of data not
249
+ /// allocated with `Array` — see [Methods Specific to Array
250
+ /// Views](#methods-specific-to-array-views).
251
+ ///
215
252
/// Note that all `ArrayBase` variants can change their view (slicing) of the
216
253
/// data freely, even when their data can’t be mutated.
217
254
///
0 commit comments