Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mafioznik77
Copy link

No description provided.

main.cpp Outdated
B = CreateMatrix(size);
C = CreateMatrix(size);
S = CreateMatrix(size);
C1 = CreateMatrix(size);

Choose a reason for hiding this comment

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

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

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];
}

Choose a reason for hiding this comment

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

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

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)

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
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