Skip to content

1. Параллельное умножение матриц - #1

Open
ArtemNikit1n wants to merge 8 commits into
mainfrom
01-concurrent-matrix-multiplication
Open

1. Параллельное умножение матриц#1
ArtemNikit1n wants to merge 8 commits into
mainfrom
01-concurrent-matrix-multiplication

Conversation

@ArtemNikit1n

Copy link
Copy Markdown
Owner

No description provided.


return (data, rows, columns);
}
} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Можно static-методы вынести в отдельный класс (/классы) для I/O операций и умножения, чтобы Matrix не перегружать

Assert.That(() => new Matrix(TestFilePath), Throws.TypeOf<FormatException>());
Assert.That(() => new Matrix(File.OpenRead(TestFilePath)), Throws.TypeOf<FormatException>());
Assert.That(() => new Matrix(new MemoryStream(contentBytes)), Throws.TypeOf<FormatException>());
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Github описал этот файл как large diffs :)
Тесты тоже хорошо бы по нескольким файлам разнести: например, тесты инициализации матрицы через конструкторы, тесты на умножение, тесты на сохранение в файл и чтение матрицы из него


using ConcurrentMatrixMultiplication;

if (args.Length >= 3)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
if (args.Length >= 3)
if (args.Length < 3)
{
Console.WriteLine("Usage: dotnet run -- <left_matrix> <right_matrix> <result> [--sequential|--parallel]");
Console.WriteLine("Examples:");
Console.WriteLine(" dotnet run -- matrix1.txt matrix2.txt result.txt --parallel");
Console.WriteLine(" dotnet run -- matrix1.txt matrix2.txt result.txt --sequential");
return;
}

Лучше так, чтобы не создавать лишней вложенности

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.

3 participants