From 4420d537aa73573105e531f74a87b0a10a97b6a2 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Mon, 7 Oct 2024 22:07:02 -0400 Subject: [PATCH] silly --- CMakeLists.txt | 2 +- src/main.cpp | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c529c16..db646ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(COSC-4P80-Assignment-1 VERSION 0.0.23) +project(COSC-4P80-Assignment-1 VERSION 0.0.24) option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) option(ENABLE_UBSAN "Enable the ub sanitizer" OFF) diff --git a/src/main.cpp b/src/main.cpp index 5db7265..a76def0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -114,12 +114,13 @@ class executor std::vector crosstalk_data; crosstalk_data.resize(outputs.size()); + std::cout << "\\begin{tabular}{||c|c|c|c|c||}\n\\hline\n"; for (auto [i, c] : blt::enumerate(crosstalk_data)) { if (print_latex) { if (i == 0) - std::cout << "\\hline\nInput " << i + 1 << " & & Cos & Output Vector & Crosstalk Vector \\\\\n\\hline\\hline\n"; + std::cout << "Input " << i + 1 << " & & Cos & Output Vector & Crosstalk Vector \\\\\n\\hline\\hline\n"; else std::cout << "Input " << i + 1 << " & & & & \\\\\n\\hline\\hline\n"; } @@ -148,6 +149,7 @@ class executor std::cout << "}\\\\\n\\multicolumn{5}{|c|}{Total Crosstalk: " << c.magnitude() << "} \\\\\n\\hline\\hline\n"; } } + std::cout << "\\end{tabular}\n"; return crosstalk_data; } @@ -273,12 +275,12 @@ class executor for (auto [i, os] : blt::enumerate(output_lines)) (os += "Output ") += std::to_string(i + 1); - for (const auto& step : steps) + for (const auto& [step_idx, step] : blt::enumerate(steps)) { for (auto [idx, pong] : blt::enumerate(step)) { - if (!(idx == 0 || idx == step.size()-1)) - continue; + if (!(step_idx == 0 || step_idx == steps.size()-1)) + break; auto& is = input_lines[idx]; auto& os = output_lines[idx]; @@ -577,6 +579,11 @@ void part_c() cute.print_execution_results(); cute.print_correctness(); cute.print_crosstalk(); + if (print_latex) + cute.print_execution_results_latex_no_intermediates(); + cute.execute_output(); + cute.print_execution_results(); + cute.print_correctness(); if (print_latex) cute.print_execution_results_latex_no_intermediates(); BLT_TRACE("--- { Part C with 3 extra pairs } ---"); @@ -587,6 +594,11 @@ void part_c() cute2.print_crosstalk(); if (print_latex) cute2.print_execution_results_latex_no_intermediates(); + cute2.execute_output(); + cute2.print_execution_results(); + cute2.print_correctness(); + if (print_latex) + cute2.print_execution_results_latex_no_intermediates(); } blt::size_t hdist(const input_t& a, const input_t& b)