Probably
Function.Sum(v, Axis.Rows) looks like this (column-major):
FoldRows(f,state) is what I need to build it. Function.Sum(v, Axis.Rows) looks like this (column-major):
for (int majorItem = 0; majorItem < t.Length; majorItem++)
{
for (int i = 0; i < items; i++)
t[majorItem] += mt[ptr + i * minorStride];
ptr += majorStride;
}
It treats every column of the matrix M as a vector mv and adds the vector v to it.For every k in M
mv = M.GetColumnVector(k);
mv += v ;