- . , , . . , array[i][j] = oneDimArray[i *n + j], n . , :
public void process(float[] oneDimInput, int numberOfColumns)
{
unsafe
{
fixed (float* inputPtr = &oneDimInput[0])
{
functionDelegate(inputPtr, numberOfColumns, 2, oneDimInput[0].length);
}
}
}
I also need to note that two arrays of measurements are rarely used in high-performance computing libraries such as Intel MKL, Intel IPP, and many others. Even the BLAS and Lapack interfaces contain only one dimensional array and emulate two dimensions using the aproach I mentioned (for performance reasons).
source
share