diff --git a/.DS_Store b/.DS_Store index 7befc8353f3ccaff41147958709118c865259d4c..5b0e88d4a5fa75607a2785972f718cf006bd4320 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/cmake-build-debug/CMakeFiles/viktor.dir/source/main.cpp.o b/cmake-build-debug/CMakeFiles/viktor.dir/source/main.cpp.o index 589e69f709ee64dc584fd4f8da2a1e2bc093e889..96ef8d102b132be77d91ad466d4319a267b7f744 100644 Binary files a/cmake-build-debug/CMakeFiles/viktor.dir/source/main.cpp.o and b/cmake-build-debug/CMakeFiles/viktor.dir/source/main.cpp.o differ diff --git a/cmake-build-debug/Testing/Temporary/LastTest.log b/cmake-build-debug/Testing/Temporary/LastTest.log index 7289a33dae6882af5010e6edec2d39646b5345a3..8806e6639bcd802fee5fa7a958f41fccbedbd967 100644 --- a/cmake-build-debug/Testing/Temporary/LastTest.log +++ b/cmake-build-debug/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Apr 10 22:34 MSK +Start testing: Apr 11 00:33 MSK ---------------------------------------------------------- -End testing: Apr 10 22:34 MSK +End testing: Apr 11 00:33 MSK diff --git a/cmake-build-debug/viktor b/cmake-build-debug/viktor index 3a087cbc6db67bce286c43c1e98de8b5cd3e906b..b8623671abe8d8497260044b7fb93d2b773316f3 100755 Binary files a/cmake-build-debug/viktor and b/cmake-build-debug/viktor differ diff --git a/source/laba3.hpp b/source/laba3.hpp index 5319439e0b8dfd81509c1d2881b21338dafbd45e..3691a84940b872b2e7986f641041111db3fa6877 100644 --- a/source/laba3.hpp +++ b/source/laba3.hpp @@ -1,3 +1,5 @@ + + #pragma once #include "laba3.h" @@ -23,9 +25,9 @@ std::tuple<const char*, node_name_t, node_name_t> parse_args(int arg_count, char throw std::runtime_error("Invalid number of arguments!"); std::unordered_map<std::string, const char*> args = { - {"--file", nullptr}, - {"--from", nullptr}, - {"--to", nullptr} + {"--file", nullptr}, + {"--from", nullptr}, + {"--to", nullptr} }; for (char** t = arg_vars + 1; t < arg_vars + arg_count; t += 2) { auto it = args.find(*t); @@ -97,3 +99,5 @@ matrix_t load_matrix(const char* filename) { return matr; } + + diff --git a/source/main.cpp b/source/main.cpp index 1787fed830ccba8ab7021e8ddacb9b630fe204d7..fa87c0ba266aafbe48a86683f82de258057737be 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -2,15 +2,8 @@ #include "laba3.h" #include <iostream> -#include <string> + #include <vector> -#include <sstream> -/* -int main(int arg_count, char* arg_values[]) { - for (size_t i = 0; i < arg_count; ++i) - std::cout << i << ": " << arg_values[i] << '\n'; -} -*/ @@ -26,42 +19,3 @@ int main(int arg_count, char* arg_values[]){ return 0; } - -/* -int main() { - std::string input; - std::vector<std::string> args; - - std::cout << "Enter the arguments for the program, press Enter to finish:\n"; - - std::getline(std::cin, input); - std::istringstream iss(input); - std::string arg; - - // Запрашиваем аргументы до тех пор, пока есть что читать в строке. - while (iss >> arg) { - args.push_back(arg); - } - - // Преобразуем введенные аргументы в формат, совместимый с argv. - std::vector<char*> argv; - for (auto& a : args) { - argv.push_back(a.data()); - } - - // Добавляем фиктивное название программы в начало argv, так как это ожидается функцией parse_args. - argv.insert(argv.begin(), const_cast<char*>("my_program")); - - try { - auto [file, from, to] = parse_args(static_cast<int>(argv.size()), argv.data()); - std::cout << "File: " << file << ", from: " << from << ", to: " << to << std::endl; - //std::ifstream file = open_file("your_file.txt"); - } catch (const std::exception& e) { - std::cerr << "Error: " << e.what() << '\n'; - return 1; - } - - return 0; - -} -*/ diff --git a/source/matrix_ex.txt b/source/matrix_ex.txt index c8ae9db231f01944ed4d0e3751a4f0750158d74a..0ff75e8d25639c714a29b52c23090ec25cb8d2bc 100644 --- a/source/matrix_ex.txt +++ b/source/matrix_ex.txt @@ -1,2 +1,2 @@ -|2 2| -|1 1.1| \ No newline at end of file +|1 2| +|3 4| \ No newline at end of file