diff --git a/src/run.cpp b/src/run.cpp index eb263f8..17c399f 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -15,26 +15,6 @@ #include -using TugType = double; - -using RowMajorMat = - Eigen::Matrix; - -static inline std::vector -eigenMatrix_to_vector(const Eigen::MatrixX &mat) { - if (mat.IsRowMajor) { - return std::vector(mat.data(), mat.data() + mat.size()); - } else { - std::vector out_vec(mat.size()); - for (int i = 0; i < mat.rows(); i++) { - for (int j = 0; j < mat.cols(); j++) { - out_vec[i * mat.cols() + j] = mat(i, j); - } - } - return out_vec; - } -} - double run_bench(const bench_input &input, const std::string &output_file) { std::vector> raw_data = read_conc_csv(input.csv_file_init, input.ncols, input.nrows); @@ -89,7 +69,7 @@ double run_bench(const bench_input &input, const std::string &output_file) { int ompNumThreads = std::stoi(out, NULL); sim.setNumberThreads(ompNumThreads); } - + sim.setTimestep(input.timestep); sim.setIterations(input.iterations); diff --git a/src/run.hpp b/src/run.hpp index 1a674aa..d6b6425 100644 --- a/src/run.hpp +++ b/src/run.hpp @@ -1,8 +1,29 @@ #ifndef _RUN_HPP #define _RUN_HPP +#include #include +using TugType = double; + +using RowMajorMat = + Eigen::Matrix; + double run_bench(const bench_input &input, const std::string &output_file = ""); +static inline std::vector +eigenMatrix_to_vector(const Eigen::MatrixX &mat) { + if (mat.IsRowMajor) { + return std::vector(mat.data(), mat.data() + mat.size()); + } else { + std::vector out_vec(mat.size()); + for (int i = 0; i < mat.rows(); i++) { + for (int j = 0; j < mat.cols(); j++) { + out_vec[i * mat.cols() + j] = mat(i, j); + } + } + return out_vec; + } +} + #endif // _RUN_HPP \ No newline at end of file