From b9399a986660c247c869009b5c4ddc7076e4ff60 Mon Sep 17 00:00:00 2001 From: Joey Delport Date: Wed, 3 Nov 2021 10:21:16 +0200 Subject: [PATCH 1/3] Const const reference issue in clang --- src/LUSolve.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/LUSolve.cpp b/src/LUSolve.cpp index 677149b..b13ce6d 100644 --- a/src/LUSolve.cpp +++ b/src/LUSolve.cpp @@ -63,8 +63,9 @@ void LUSolve::solve(std::vector& x) { if (!constructed) { ABORT("Preconditioner not constructed."); } - DNformat LHSstore = { x.size(), &x.front() }; - SuperMatrix LHSmat = { SLU_DN, SLU_D, SLU_GE, x.size(), 1, &LHSstore }; + int x_size = x.size(); + DNformat LHSstore = { x_size, &x.front() }; + SuperMatrix LHSmat = { SLU_DN, SLU_D, SLU_GE, x_size, 1, &LHSstore }; dgstrs(trans, &L, &U, perm_c, perm_r, &LHSmat, &stat, &info); } From 7cb2651915f6341fde944e6fda502e7cb9302620 Mon Sep 17 00:00:00 2001 From: tanetakumi Date: Tue, 30 Nov 2021 05:16:29 +0000 Subject: [PATCH 2/3] Fix errors in standard input --- src/Input.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Input.cpp b/src/Input.cpp index 455a226..e1c23fa 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -15,9 +15,12 @@ using namespace JoSIM; std::vector Input::read_input( LineInput& input, string_o fileName) { - if (std::filesystem::path(fileName.value()).has_parent_path()) { - fileParentPath = - std::filesystem::path(fileName.value()).parent_path().string(); + //When the standard input is selected, "fileName" will be in the nullopt state. + if(fileName != std::nullopt){ + if (std::filesystem::path(fileName.value()).has_parent_path()) { + fileParentPath = + std::filesystem::path(fileName.value()).parent_path().string(); + } } // Variable to store the read line std::string line; @@ -85,6 +88,9 @@ std::vector Input::read_input( output_files.emplace_back(OutputFile(path.string())); } fileLines.emplace_back(tokens); + // If the line contains a "FINISH" statement + } else if (tokens.at(0) == ".FINISH" || tokens.at(0) == "FINISH") { + break; // If the line does not contain an "INCLUDE" or "FILE" statement } else { // Transform the entire line to upper case From 3e7bfc146b65b1d7104742511dacb3c982162f3f Mon Sep 17 00:00:00 2001 From: tanetakumi Date: Thu, 2 Dec 2021 03:36:12 +0000 Subject: [PATCH 3/3] changed the end character for standard input --- src/Input.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Input.cpp b/src/Input.cpp index e1c23fa..fbb83c6 100644 --- a/src/Input.cpp +++ b/src/Input.cpp @@ -88,10 +88,10 @@ std::vector Input::read_input( output_files.emplace_back(OutputFile(path.string())); } fileLines.emplace_back(tokens); - // If the line contains a "FINISH" statement - } else if (tokens.at(0) == ".FINISH" || tokens.at(0) == "FINISH") { + // If the line contains a "END" statement + } else if (tokens.at(0) == ".END" || tokens.at(0) == "END") { break; - // If the line does not contain an "INCLUDE" or "FILE" statement + // If the line does not contain an "INCLUDE", "FILE" or "END" statement } else { // Transform the entire line to upper case std::transform(tokens.begin() + 1, tokens.end(), tokens.begin() + 1,