From cd9d66c857f9498f367740361bc9c0c5a1cd0a44 Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Sat, 8 Mar 2025 19:59:52 +0800 Subject: [PATCH] Update matrix_running_time_for_different_num_of_cpu_cores.py --- .../matrix_running_time_for_different_num_of_cpu_cores.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2025.03.08_matrix_running_time_for_different_num_of_cpu_cores/matrix_running_time_for_different_num_of_cpu_cores.py b/2025.03.08_matrix_running_time_for_different_num_of_cpu_cores/matrix_running_time_for_different_num_of_cpu_cores.py index 0f725b4..31381eb 100644 --- a/2025.03.08_matrix_running_time_for_different_num_of_cpu_cores/matrix_running_time_for_different_num_of_cpu_cores.py +++ b/2025.03.08_matrix_running_time_for_different_num_of_cpu_cores/matrix_running_time_for_different_num_of_cpu_cores.py @@ -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()