public static Matrix[] Stats(Matrix x, VectorType t = VectorType.Row) { int length = t == VectorType.Row ? x.Cols : x.Rows; var type = t == VectorType.Row ? VectorType.Col : VectorType.Row; Matrix[] result = new Matrix[length]; for (int i = 0; i < length; i++) result[i] = x[i, type].Stats(); return result; }
/// <summary>A Matrix extension method that statistics.</summary> /// <param name="m">Matrix.</param> /// <param name="t">Row or Column sum.</param> /// <returns>A Matrix[].</returns> public static Matrix[] Stats(this Matrix m, VectorType t) { return(Matrix.Stats(m, t)); }