MCPcopy Create free account
hub / github.com/SingleRust/SingleRust / sum_whole

Method sum_whole

src/backed/statistics/mod.rs:63–74  ·  view source on GitHub ↗
(&self, direction: &Direction)

Source from the content-addressed store, hash-verified

61
62impl<B: Backend> ComputeSum for ArrayElem<B> {
63 fn sum_whole<T>(&self, direction: &Direction) -> anyhow::Result<Vec<T>>
64 where
65 T: num_traits::Float + num_traits::NumCast + AddAssign + std::iter::Sum + Send + Sync,
66 {
67 let x_data = self.get::<ArrayData>()?.expect("X matrix not found!");
68 match direction {
69 Direction::COLUMN => {
70 match_array_data_apply_function!(x_data, sum_col)
71 }
72 Direction::ROW => match_array_data_apply_function!(x_data, sum_row),
73 }
74 }
75
76 fn sum_chunk<T>(&self, direction: &Direction, reference: &mut [T]) -> anyhow::Result<()>
77 where

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected