Need to convert some c++ code into c#. In this case I need to pass in the second dimension of a multidimensional array into the function dot(...).
This is the original c++ declaration /* and definition */, followed by the global static const array.
double dot( const int* g, const double x, const double y ) /*{ return g[0]*x + g[1]*y; }*/;
static const int grad3[ 12 ][ 3 ] = {...};
In c# it could be this:
public class TestClass
{
float dot( ref int[] g, float x, float y ) { return g[0] * x + g[1] * y; }
public static readonly int[,] grad3 = new int[12, 3]{...};
}
Here is an example to see how it should be accessed:
public class TestClass
{
...
void test()
{
int gi0 = 0;
double d1 = dot( grad3[ gi0 ], x0, y0, z0 );
}
}