kalyshev_yan_lab_6 #235

Merged
Alexey merged 2 commits from kalyshev_yan_lab_6 into main 2024-12-15 13:35:48 +04:00
3 changed files with 4 additions and 11 deletions
Showing only changes of commit cdaa75298a - Show all commits

View File

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

Binary file not shown.

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(