Skip to content

Серобян Н. Ш. ЛР№2. Умножение плотных матриц. Элементы типа double. Блочная схема, алгоритм Кэннона. OpenMP#155

Open
mafioznik77 wants to merge 3 commits intovalentina-kustikova:masterfrom
mafioznik77:Cannon_OpenMP
Open

Серобян Н. Ш. ЛР№2. Умножение плотных матриц. Элементы типа double. Блочная схема, алгоритм Кэннона. OpenMP#155
mafioznik77 wants to merge 3 commits intovalentina-kustikova:masterfrom
mafioznik77:Cannon_OpenMP

Conversation

@mafioznik77
Copy link
Copy Markdown

No description provided.

Comment thread main.cpp Outdated
B = CreateMatrix(size);
C = CreateMatrix(size);
S = CreateMatrix(size);
C1 = CreateMatrix(size);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Матриц создано больше, чем используется, надо убрать создание матриц, которые не используются. Также отсутствует освобождение памяти из-под матриц.

Comment thread main.cpp Outdated
for (int j = 0; j < size; ++j)
for (int k = 0; k < size; ++k) {
SS[i * size + j] += A[i * size + k] * B[k * size + j];
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И так есть отдельная функция, нужно ее вызывать.

Comment thread main.cpp Outdated

for (int i = 0; i < size; i++)
for (int j = 0; j < size; j++) {
if (fabs(S[i * size + j] - C[i * size + j]) < 0.1)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.1 - слишком большой порог.

@mafioznik77
Copy link
Copy Markdown
Author

@alvls Исправлено

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants