Skip to content

Commit

Permalink
adding neat operator<< for SG settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Aug 29, 2016
1 parent 4d37a08 commit d3ce1b2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/spectrum_generator_settings.cpp
Expand Up @@ -19,6 +19,7 @@
#include "spectrum_generator_settings.hpp"

#include <cassert>
#include <iostream>

namespace flexiblesusy {

Expand Down Expand Up @@ -113,4 +114,17 @@ void Spectrum_generator_settings::set_two_loop_corrections(
set(top_pole_qcd_corrections, two_loop_corrections.top_qcd);
}

std::ostream& operator<<(std::ostream& ostr, const Spectrum_generator_settings& sgs)
{
ostr << "(";

for (unsigned i = 0; i < Spectrum_generator_settings::NUMBER_OF_OPTIONS; i++) {
ostr << sgs.get(static_cast<Spectrum_generator_settings::Settings>(i));
if (i < Spectrum_generator_settings::NUMBER_OF_OPTIONS - 1)
ostr << ", ";
}

ostr << ")";
}

} // namespace flexiblesusy
3 changes: 3 additions & 0 deletions src/spectrum_generator_settings.hpp
Expand Up @@ -20,6 +20,7 @@
#define SPECTRUM_GENERATOR_SETTINGS_H

#include "two_loop_corrections.hpp"
#include <iosfwd>

namespace flexiblesusy {

Expand Down Expand Up @@ -69,6 +70,8 @@ class Spectrum_generator_settings {
double values[NUMBER_OF_OPTIONS]; ///< spectrum generator settings
};

std::ostream& operator<<(std::ostream&, const Spectrum_generator_settings&);

} // namespace flexiblesusy

#endif

0 comments on commit d3ce1b2

Please sign in to comment.