Quantcast
Channel: Math.NET Numerics
Viewing all articles
Browse latest Browse all 971

New Post: How to apply operation over vector from each row/column of a matrix?

$
0
0
Probably 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 ;

Viewing all articles
Browse latest Browse all 971

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>