Update matrix_running_time_for_different_num_of_cpu_cores.py

This commit is contained in:
guanjihuan 2025-03-08 19:59:52 +08:00
parent ef45071a38
commit cd9d66c857

View File

@ -6,7 +6,7 @@ The newest version of this code is on the web page: https://www.guanjihuan.com/a
import numpy as np
import time
n = 7000
n = 5000
A = np.random.rand(n, n)
B = np.random.rand(n, n)
@ -14,7 +14,7 @@ B = np.random.rand(n, n)
start_time = time.time()
det_A = np.linalg.det(A)
det_time = time.time() - start_time
print(f"矩阵行列式时间: {det_time:.2f}")
print(f"矩阵行列式时间: {det_time:.3f}")
# 矩阵乘法
start_time = time.time()