Skip to content

Commit

Permalink
Relax bounds on .mean_axis()
Browse files Browse the repository at this point in the history
This removes the `LinalgScalar` bound on the element type for
`.mean_axis()`. This transitively removes the following unnecessary
bounds:

* `'static`
* `Copy`
* `Sub<Output=A>`
* `Mul<Output=A>`
  • Loading branch information
jturner314 committed Sep 28, 2018
1 parent 843c5a8 commit d4b9801
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/numeric/impl_numeric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::ops::Add;
use libnum::{self, Zero, Float};
use std::ops::{Add, Div};
use libnum::{self, One, Zero, Float};
use itertools::free::enumerate;

use imp_prelude::*;
use numeric_util;

use {
LinalgScalar,
FoldWhile,
Zip,
};
use {FoldWhile, Zip};

/// Numerical methods for arrays.
impl<A, S, D> ArrayBase<S, D>
Expand Down Expand Up @@ -105,7 +101,7 @@ impl<A, S, D> ArrayBase<S, D>
/// );
/// ```
pub fn mean_axis(&self, axis: Axis) -> Array<A, D::Smaller>
where A: LinalgScalar,
where A: Clone + Zero + One + Add<Output=A> + Div<Output=A>,
D: RemoveAxis,
{
let n = self.len_of(axis);
Expand Down

0 comments on commit d4b9801

Please sign in to comment.