Hello, just getting started with MatNET.Numerics. I am porting some Matlab code to C#.
I frequently need to copy a column of a Matrix to another Matrix (same number of rows). Making the code run fast is paramount. Is it faster to create a for loop, and copy each individual element, or should I be using SetSubMatrix()
? E.g.:
for (int i = 0; i < matrixA.RowCount; ++i)
{
matrixA.At(i, myNewCol, matrixB.At(i, myOldCol));
}
vs
matrixA.SetSubMatrix(0, myNewCol, matrixB.SubMatrix(0, matrixB.RowCount, myOldCol, 1));
Which is faster?
1 post - 1 participant