Try using
Buffer.BlockCopy.
On an average, its aways faster than doing a point by point copy.
double [,] test = new double[2,ARRAYSIZE];
Random randy = new Random();
double[] one = new double[ARRAYSIZE];
double[] two = new double[ARRAYSIZE];
//Populate data
for(int i =0;i < ARRAYSIZE;i++)
{
one[i] = randy.NextDouble();
two[i] = randy.NextDouble();
}
int elementSize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(double));
Buffer.BlockCopy(one,0,test,0,elementS
ize*ARRAYSIZE);
Buffer.BlockCopy(two,0,test,elementSize*ARRAYSIZE,elementSize*ARRAYSIZE);
If you want to benchmark the results,
this article provides code for a high resolution timer.
Hope this helps
Bilal Durrani
NI
Bilal Durrani
NI