38
38
//!
39
39
//! ## Crate Feature Flags
40
40
//!
41
+ //! The following crate feature flags are available. The are specified in
42
+ //! `Cargo.toml`.
43
+ //!
41
44
//! - `assign_ops`
42
45
//! - Optional, requires nightly
43
46
//! - Enables the compound assignment operators
@@ -141,6 +144,16 @@ pub type Ixs = isize;
141
144
/// [`ArrayView`]: type.ArrayView.html
142
145
/// [`ArrayViewMut`]: type.ArrayViewMut.html
143
146
///
147
+ /// ## Contents
148
+ ///
149
+ /// + [OwnedArray and RcArray](#ownedarray-and-rcarray)
150
+ /// + [Indexing and Dimension](#indexing-and-dimension)
151
+ /// + [Slicing](#slicing)
152
+ /// + [Subviews](#subviews)
153
+ /// + [Arithmetic Operations](#arithmetic-operations)
154
+ /// + [Broadcasting](#broadcasting)
155
+ /// + [Methods](#methods)
156
+ ///
144
157
/// ## `OwnedArray` and `RcArray`
145
158
///
146
159
/// `OwnedArray` owns the underlying array elements directly (just like
@@ -296,25 +309,27 @@ pub type Ixs = isize;
296
309
///
297
310
/// Since the trait implementations are hard to overview, here is a summary.
298
311
///
299
- /// Let `A` be an array or view of any kind. Let `B` be a mutable
300
- /// array (that is, either `OwnedArray`, `RcArray`, or `ArrayViewMut`)
312
+ /// Let `A` be an array or view of any kind. Let `B` be an array
313
+ /// with owned storage (either `OwnedArray` or `RcArray`).
314
+ /// Let `C` be an array with mutable data (either `OwnedArray`, `RcArray`
315
+ /// or `ArrayViewMut`).
301
316
/// The following combinations of operands
302
317
/// are supported for an arbitrary binary operator denoted by `@`.
303
318
///
304
319
/// - `&A @ &A` which produces a new `OwnedArray`
305
320
/// - `B @ A` which consumes `B`, updates it with the result, and returns it
306
321
/// - `B @ &A` which consumes `B`, updates it with the result, and returns it
307
- /// - `B @= &A` which performs an arithmetic operation in place
308
- /// (requires `features = "assign_ops"`)
322
+ /// - `C @= &A` which performs an arithmetic operation in place
323
+ /// (requires crate feature ` "assign_ops"`)
309
324
///
310
325
/// The trait [`Scalar`](trait.Scalar.html) marks types that can be used in arithmetic
311
326
/// with arrays directly. For a scalar `K` the following combinations of operands
312
327
/// are supported (scalar can be on either side).
313
328
///
314
329
/// - `&A @ K` or `K @ &A` which produces a new `OwnedArray`
315
330
/// - `B @ K` or `K @ B` which consumes `B`, updates it with the result and returns it
316
- /// - `B @= K` which performs an arithmetic operation in place
317
- /// (requires `features = "assign_ops"`)
331
+ /// - `C @= K` which performs an arithmetic operation in place
332
+ /// (requires crate feature ` "assign_ops"`)
318
333
///
319
334
/// ## Broadcasting
320
335
///
@@ -2549,12 +2564,14 @@ macro_rules! impl_binary_op(
2549
2564
/// between `self` and `rhs`,
2550
2565
/// and return the result (based on `self`).
2551
2566
///
2567
+ /// `self` must be an `OwnedArray` or `RcArray`.
2568
+ ///
2552
2569
/// If their shapes disagree, `rhs` is broadcast to the shape of `self`.
2553
2570
///
2554
2571
/// **Panics** if broadcasting isn’t possible.
2555
2572
impl <A , S , S2 , D , E > $trt<ArrayBase <S2 , E >> for ArrayBase <S , D >
2556
2573
where A : Clone + $trt<A , Output =A >,
2557
- S : DataMut <Elem =A >,
2574
+ S : DataOwned <Elem =A > + DataMut ,
2558
2575
S2 : Data <Elem =A >,
2559
2576
D : Dimension ,
2560
2577
E : Dimension ,
@@ -2616,9 +2633,11 @@ impl<'a, A, S, S2, D, E> $trt<&'a ArrayBase<S2, E>> for &'a ArrayBase<S, D>
2616
2633
#[ doc=$doc]
2617
2634
/// between `self` and the scalar `x`,
2618
2635
/// and return the result (based on `self`).
2636
+ ///
2637
+ /// `self` must be an `OwnedArray` or `RcArray`.
2619
2638
impl <A , S , D , B > $trt<B > for ArrayBase <S , D >
2620
2639
where A : Clone + $trt<B , Output =A >,
2621
- S : DataMut <Elem =A >,
2640
+ S : DataOwned <Elem =A > + DataMut ,
2622
2641
D : Dimension ,
2623
2642
B : Clone + Scalar ,
2624
2643
{
@@ -2793,7 +2812,7 @@ mod assign_ops {
2793
2812
///
2794
2813
/// **Panics** if broadcasting isn’t possible.
2795
2814
///
2796
- /// **Requires ` feature = "assign_ops"`**
2815
+ /// **Requires crate feature ` "assign_ops"`**
2797
2816
impl <' a, A , S , S2 , D , E > $trt<& ' a ArrayBase <S2 , E >> for ArrayBase <S , D >
2798
2817
where A : Clone + $trt<A >,
2799
2818
S : DataMut <Elem =A >,
@@ -2809,7 +2828,7 @@ mod assign_ops {
2809
2828
}
2810
2829
2811
2830
#[ doc=$doc]
2812
- /// **Requires ` feature = "assign_ops"`**
2831
+ /// **Requires crate feature ` "assign_ops"`**
2813
2832
impl <A , S , D , B > $trt<B > for ArrayBase <S , D >
2814
2833
where A : $trt<B >,
2815
2834
S : DataMut <Elem =A >,
0 commit comments