add video and fixes

This commit is contained in:
Zyzf 2024-11-26 19:13:56 +04:00
parent 4390166883
commit cdaa75298a
3 changed files with 4 additions and 11 deletions

View File

@ -18,3 +18,5 @@
```
docker compose up -d
```
Видео можно посмотреть по ссылке: [видео](https://zyzf.space/s/CjaXNQDkoPp9GzC).

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 99 KiB

View File

@ -26,11 +26,6 @@ def determinant(matrix):
return det
# Пример использования
A = np.random.rand(100, 100)
print(determinant(A))
def _determinant_parallel_chunk(args):
matrix, start_row, end_row = args
n = matrix.shape[0]
@ -69,12 +64,8 @@ def determinant_parallel(matrix, num_processes=None):
return det
# Пример использования
A = np.random.rand(100, 100)
print(determinant_parallel(A, num_processes=4))
sizes = [100, 300, 500]
num_processes = 12
NUM_PROCESSES = 12
for size in sizes:
A = np.random.rand(size, size)
@ -83,7 +74,7 @@ for size in sizes:
seq_time = time.time() - start_time
start_time = time.time()
det_par = determinant_parallel(A, num_processes=num_processes)
det_par = determinant_parallel(A, num_processes=NUM_PROCESSES)
par_time = time.time() - start_time
print(