我有一个看起来像下面这样的程序:
double[4][4] startMatrix;
double[4][4] inverseMatrix;
initialize(startMatrix) //this puts the information I want in startMatrix
我现在想计算startMatrix的逆矩阵并将其放入inverseMatrix中。 我有一个用于此目的的库函数,其原型如下:
void MatrixInversion(double** A, int order, double** B)
我需要将 double[4][4] 转换为 double** 以传递给函数,该函数对 A 进行求逆并将结果放入 B 中。问题在于我不知道如何进行转换。我尝试了"显而易见的方式":
MatrixInversion((double**)startMatrix, 4, (double**)inverseMatrix))
但这似乎不起作用。那真的是正确的做法吗?