Skip to content

Commit

Permalink
make unchanging params const
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Glowacki committed Dec 7, 2023
1 parent 18973c1 commit 6181a29
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/core/process_whole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ using namespace std::placeholders; //for _1, _2,
// ----------------------------------------------------------------------------

bool optimize_integrated_fit_params(data_struct::Analysis_Job<double> * analysis_job,
data_struct::Spectra<double>& int_spectra,
const data_struct::Spectra<double>& int_spectra,
size_t detector_num,
data_struct::Params_Override<double>* params_override,
const data_struct::Params_Override<double>* const params_override,
std::string save_filename,
data_struct::Fit_Parameters<double>& out_fitp,
Callback_Func_Status_Def* status_callback)
Expand Down
4 changes: 2 additions & 2 deletions src/data_struct/fit_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class DLL_EXPORT Fit_Parameters
* @return Range structure with the min energy and max enegry of the spectra to fit.
*/
template<typename T_real>
DLL_EXPORT Range get_energy_range(T_real min_energy, T_real max_energy, size_t spectra_size, T_real energy_offset, T_real energy_slope)
DLL_EXPORT Range get_energy_range(const T_real min_energy, const T_real max_energy, const size_t spectra_size, const T_real energy_offset, const T_real energy_slope)
{

struct Range energy_range;
Expand All @@ -286,7 +286,7 @@ DLL_EXPORT Range get_energy_range(T_real min_energy, T_real max_energy, size_t s
//-----------------------------------------------------------------------------

template<typename T_real>
DLL_EXPORT Range get_energy_range(size_t spectra_size, Fit_Parameters<T_real>* params)
DLL_EXPORT Range get_energy_range(const size_t spectra_size, const Fit_Parameters<T_real>* const params)
{
return get_energy_range(params->value(STR_MIN_ENERGY_TO_FIT),
params->value(STR_MAX_ENERGY_TO_FIT),
Expand Down
2 changes: 1 addition & 1 deletion src/io/file/hl_file_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ bool load_scalers_lookup(const std::string filename)

// ----------------------------------------------------------------------------

void save_optimized_fit_params(std::string dataset_dir, std::string dataset_filename, int detector_num, std::string result, data_struct::Fit_Parameters<double> *fit_params, data_struct::Spectra<double>* spectra, data_struct::Fit_Element_Map_Dict<double>* elements_to_fit)
void save_optimized_fit_params(std::string dataset_dir, std::string dataset_filename, int detector_num, std::string result, data_struct::Fit_Parameters<double> *fit_params, const data_struct::Spectra<double>* const spectra, const data_struct::Fit_Element_Map_Dict<double>* const elements_to_fit)
{
std::string full_path = dataset_dir + DIR_END_CHAR + "output" + DIR_END_CHAR + dataset_filename;
std::string mca_full_path = dataset_dir + DIR_END_CHAR + "output" + DIR_END_CHAR + "intspec_" + dataset_filename;
Expand Down
2 changes: 1 addition & 1 deletion src/io/file/hl_file_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ DLL_EXPORT bool load_quantification_standardinfo(std::string dataset_directory,

//DLL_EXPORT void populate_netcdf_hdf5_files(std::string dataset_dir);

DLL_EXPORT void save_optimized_fit_params(std::string dataset_dir, std::string dataset_filename, int detector_num, std::string result, data_struct::Fit_Parameters<double>* fit_params, data_struct::Spectra<double>* spectra, data_struct::Fit_Element_Map_Dict<double>* elements_to_fit);
DLL_EXPORT void save_optimized_fit_params(std::string dataset_dir, std::string dataset_filename, int detector_num, std::string result, data_struct::Fit_Parameters<double>* fit_params, const data_struct::Spectra<double>* const spectra, const data_struct::Fit_Element_Map_Dict<double>* const elements_to_fit);

////DLL_EXPORT void save_roi_fit_params(std::string dataset_dir, std::string dataset_filename, int detector_num, string result, data_struct::Fit_Parameters<double>* fit_params, data_struct::Spectra<double>* spectra, data_struct::Fit_Element_Map_Dict<double>* elements_to_fit);

Expand Down
2 changes: 1 addition & 1 deletion src/io/file/mca_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ DLL_EXPORT bool load_integrated_spectra(std::string path, data_struct::Spectra<T
//-----------------------------------------------------------------------------

template<typename T_real>
DLL_EXPORT bool save_integrated_spectra(std::string path, data_struct::Spectra<T_real>* spectra, std::unordered_map<std::string, T_real>& pv_map)
DLL_EXPORT bool save_integrated_spectra(std::string path, const data_struct::Spectra<T_real>* const spectra, const std::unordered_map<std::string, T_real>& pv_map)
{
std::ofstream paramFileStream(path);

Expand Down

0 comments on commit 6181a29

Please sign in to comment.