AtheMathmo / rulinalg

A linear algebra library written in Rust

Home Page:https://crates.io/crates/rulinalg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Flatten" the statistics functions (mean, etc.) on `BaseMatrix` trait

AtheMathmo opened this issue · comments

Some opening discussion of this issue can be found in #115 .

Currently these functions all take an Axis argument and work along the given axis. In most (all?) libraries it is conventional to have these functions work on the flattened array by default with optional arguments to work along the axis.

As rust does not provide optional arguments we cannot mimick this behaviour. We have a couple of options moving forwards:

  • Add a new variant to the Axis enum, Flat. (Wont work well with current split_at functions).
  • Have existing functions work on flat array, and add new mean_along_axis functions which have the current functionality.

This issue to discuss any other ideas and track the implementation.