|
|
|
@ -161,12 +161,12 @@ module Matrix = |
|
|
|
f |
|
|
|
|
|
|
|
/// Returns the sum of the results generated by applying the function to each column of the matrix. |
|
|
|
let inline sumColsBy (f: int -> Vector<float> -> float) (A: #Matrix<float>) = |
|
|
|
mapCols f A |> Seq.fold (+) 0.0 |
|
|
|
let inline sumColsBy (f: int -> Vector<float> -> 'a) (A: #Matrix<float>) = |
|
|
|
mapCols f A |> Seq.reduce (+) |
|
|
|
|
|
|
|
/// Returns the sum of the results generated by applying the function to each row of the matrix. |
|
|
|
let inline sumRowsBy (f: int -> Vector<float> -> float) (A: #Matrix<float>) = |
|
|
|
mapRows f A |> Seq.fold (+) 0.0 |
|
|
|
let inline sumRowsBy (f: int -> Vector<float> -> 'a) (A: #Matrix<float>) = |
|
|
|
mapRows f A |> Seq.reduce (+) |
|
|
|
|
|
|
|
/// Iterates over all elements of a matrix. |
|
|
|
let inline iter (f: float -> unit) (A: #Matrix<float>) = |
|
|
|
|