def matrixInput(): print("Enter the elements row-wise: ") a= [] a.append(int(input()))
matrix.append(a) #this line shouldthis was a typo mistake...however left like this, the code is running in
因此,我开始使用OpenMP (多线程)来提高矩阵乘法的速度,我目睹了一些奇怪的事情:当我关闭OpenMP Support (在Visual中),嵌套的for-循环完成速度快了2倍。因此,我删除了“#语用omp关键程序”,以测试它是否显著减慢了进程,并且进程比之前快了4倍(使用OpenMP Support On)。
我的问题是:在嵌套循环中很重要吗?我</