pub fn mean_2d(data: &FdMatrix) -> Vec<f64>
Compute the mean function for 2D surfaces.
Data is stored as n x (m1*m2) matrix where each row is a flattened surface.