copy matrices

  • Thread starter Thread starter phoenix
  • Start date Start date
P

phoenix

Hello,

could somebody provide some info on what the fastest way is to copy arrays?
Basically I'm having a Matrix class which internally is represented by a 2D
array of floats (float[,] data). I'm wondering what the best way is to copy
all that data in for example a Clone() method. Should i use Array.Copy or
should I look at unsafe code or are there better ways (maybe an alternative
for the old memcpy)?

Y
 
phoenix,
I would look at either Array.Copy or System.Buffer.BlockCopy.

I would expect both of the above to be safely using unsafe code.

Hope this helps
Jay
 
Back
Top