Skip to content

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