perf: return SimParams as const

This commit is contained in:
Max Lübke 2023-01-06 14:05:13 +01:00 committed by Max Luebke
parent 6a911962db
commit f32a3f3342
2 changed files with 14 additions and 12 deletions

View File

@ -23,6 +23,7 @@
#include <bits/stdint-uintn.h>
#include <string>
#include <string_view>
#include <vector>
#include "argh.hpp" // Argument handler https://github.com/adishavit/argh
@ -184,7 +185,7 @@ public:
*
* @return t_simparams Parameter struct
*/
t_simparams getNumParams();
t_simparams getNumParams() const;
/**
* @brief Get the DHT_Signif_Vector
@ -195,7 +196,7 @@ public:
* @return std::vector<int> Vector of integers containing information about
* significant digits
*/
std::vector<int> getDHTSignifVector();
std::vector<int> getDHTSignifVector() const;
/**
* @brief Get the DHT_Prop_Type_Vector
@ -205,7 +206,7 @@ public:
* @return std::vector<std::string> Vector if strings defining a type of a
* variable
*/
std::vector<std::string> getDHTPropTypeVector();
std::vector<std::string> getDHTPropTypeVector() const;
/**
* @brief Return name of DHT snapshot.
@ -215,7 +216,7 @@ public:
*
* @return std::string Absolute paht to the DHT snapshot
*/
std::string getDHTFile();
std::string_view getDHTFile() const;
/**
* @brief Get the filesim name
@ -225,7 +226,7 @@ public:
*
* @return std::string Absolute path to R file
*/
std::string getFilesim();
std::string_view getFilesim() const;
/**
* @brief Get the output directory
@ -235,7 +236,7 @@ public:
*
* @return std::string Absolute path to output path
*/
std::string getOutDir();
std::string_view getOutDir() const;
private:
/**

View File

@ -26,6 +26,7 @@
#include <iostream>
#include <string>
#include <string_view>
#include <vector>
using namespace poet;
@ -229,18 +230,18 @@ void SimParams::initVectorParams(RInside &R, int col_count) {
void SimParams::setDtDiffer(bool dt_differ) { simparams.dt_differ = dt_differ; }
t_simparams SimParams::getNumParams() { return this->simparams; }
t_simparams SimParams::getNumParams() const { return this->simparams; }
std::vector<int> SimParams::getDHTSignifVector() {
std::vector<int> SimParams::getDHTSignifVector() const {
return this->dht_signif_vector;
}
std::vector<std::string> SimParams::getDHTPropTypeVector() {
std::vector<std::string> SimParams::getDHTPropTypeVector() const {
return this->dht_prop_type_vector;
}
std::string SimParams::getDHTFile() { return this->dht_file; }
std::string_view SimParams::getDHTFile() const { return this->dht_file; }
std::string SimParams::getFilesim() { return this->filesim; }
std::string SimParams::getOutDir() { return this->out_dir; }
std::string_view SimParams::getFilesim() const { return this->filesim; }
std::string_view SimParams::getOutDir() const { return this->out_dir; }
std::list<std::string> SimParams::validateOptions(argh::parser cmdl) {
/* store all unknown parameters here */