这个怎么编呢??编写程序实现两个矩阵相乘???
编写程序实现两个矩阵相乘???
PROCEDURE Do_Matrix_Multiplication(tcMatrixA AS Character, tcMatrixB AS Character, tcResult AS Character) LOCAL arrayA[1,FCOUNT(tcMatrixA)-1], arrayB[1,FCOUNT(tcMatrixB)-1] ExportToArray(tcMatrixA, @arrayA) ExportToArray(tcMatrixB, @arrayB) LOCAL i, j, k SELECT (tcResult) LOCAL lcField AS Character LOCAL arrayC[ALEN(arrayA,1),ALEN(arrayB,2)] FOR i = 1 TO ALEN(arrayC,1) FOR j = 1 TO ALEN(arrayC,2) arrayC[i,j] = 0.0 FOR k = 1 TO ALEN(arrayA,2) arrayC[i,j] = arrayC[i,j] + arrayA[i,k] * arrayB[k,j] NEXT GOTO i IN (tcResult) lcField = tcResult + "." + FIELD(j + 1, tcResult) REPLACE (lcField) WITH arrayC[i,j] IN (tcResult) NEXT NEXT ENDPROC