Skip to content

Commit

Permalink
Added clang style format and adjusted all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Basler committed Jan 13, 2021
1 parent e2d2f4c commit 0e098cf
Show file tree
Hide file tree
Showing 38 changed files with 15,896 additions and 15,945 deletions.
23 changes: 23 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
BasedOnStyle: LLVM
AlignConsecutiveAssignments: 'true'
AlignEscapedNewlines: Right
AlignTrailingComments: 'true'
AllowAllConstructorInitializersOnNextLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'true'
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterReturnType: All
BinPackArguments: 'false'
BinPackParameters: 'false'
BreakBeforeBraces: Allman
BreakConstructorInitializers: BeforeComma
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
IndentWidth: '2'
Language: Cpp
TabWidth: '2'

...
94 changes: 57 additions & 37 deletions include/BSMPT/Kfactors/Kfactors.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,105 +3,125 @@
*
* Copyright (C) 2020 Philipp Basler, Margarete Mühlleitner and Jonas Müller
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/


#include <BSMPT/models/IncludeAllModels.h>
#include <gsl/gsl_monte_vegas.h>
#include <gsl/gsl_monte.h>
#include <gsl/gsl_monte_vegas.h>
#include <vector>

/**
* @file
*/

namespace BSMPT{
namespace Kfactors{

namespace BSMPT
{
namespace Kfactors
{

/**
* @brief The GSL_integration struct used to pass information to the GSL minimisation routine
* @brief The GSL_integration struct used to pass information to the GSL
* minimisation routine
*/
struct GSL_integration{
struct GSL_integration
{
double Temp;
int switchval;
double masssquared;
int s;
double vw;
};


/**
* Helper function which displays the numbers in a more readable way
*/
void display_results (std::string title, double result, double error);
void
display_results(std::string title, double result, double error);

/**
* Calculates the distribution f0, defined in Eq(13) in 0604159
* @param E0 Energy at which the distribution is calculated
* @param s s=1 for fermions and s=-1 for bosons
* @param Temp Temperature at which the distribution should be evaluated
* @param diff number of derivatives w.r.t. E0, diff = 0 no derivative and diff = 1 or 2 accordingly
* @param diff number of derivatives w.r.t. E0, diff = 0 no derivative and diff
* = 1 or 2 accordingly
*/
double distribution_f0(double E0, int s, double Temp, int diff=0);
double
distribution_f0(double E0, int s, double Temp, int diff = 0);

/**
* Evaluates the integrand in the K functions
* @param p momentum at which to evaluate the K function
* @param masssquared the m^2 value at which K should be evaluated
* @param Temp the temperature at which K should be evaluated
* @param switchvalue The index which K to choose
* @param s s=-1 yields the function for a bosonic distribution, s=+1 for a fermionic one
* @param s s=-1 yields the function for a bosonic distribution, s=+1 for a
* fermionic one
*/
double K_integrand(const std::vector<double>& p, double masssquared, int switchvalue,int s, double Temp);
double
K_integrand(const std::vector<double> &p,
double masssquared,
int switchvalue,
int s,
double Temp);

/**
* Interface to communicate the value of K_integrand() to the GSL integration routine
* Interface to communicate the value of K_integrand() to the GSL integration
* routine
*/
double K_integrand_gsl(double *x, std::size_t dim, void *params );
double
K_integrand_gsl(double *x, std::size_t dim, void *params);

/**
* Calculates the values of the K functions given in Eq (23) in 0604159 without the normalization
* Calculates the values of the K functions given in Eq (23) in 0604159 without
* the normalization
* @param masssquared the m^2 value at which K should be evaluated
* @param Temp the temperature at which K should be evaluated
* @param switchvalue The index which K to choose
* @param s s=-1 yields the function for a bosonic distribution, s=+1 for a fermionic one
* @param s s=-1 yields the function for a bosonic distribution, s=+1 for a
* fermionic one
*/
double K_integration(double masssquared, double Temp, int switchvalue, int s);
double
K_integration(double masssquared, double Temp, int switchvalue, int s);

/**
* Calculates the normalized K function
* @param masssquared the m^2 value at which K should be evaluated
* @param Temp the temperature at which K should be evaluated
* @param switchvalue The index which K to choose
* @param s s=-1 yields the function for a bosonic distribution, s=+1 for a fermionic one
* @param s s=-1 yields the function for a bosonic distribution, s=+1 for a
* fermionic one
*/
double K_functions(double masssquared, double Temp, int switchvalue,int s);
double
K_functions(double masssquared, double Temp, int switchvalue, int s);
/**
* Integrand to calculate the normalization for the Ktilde functions. Used in Ktilde_normalization()
* Integrand to calculate the normalization for the Ktilde functions. Used in
* Ktilde_normalization()
* @param x vector which containts the momentum
* @param params GSL_integration struct
*/
double Ktilde_normalization_func(double x, void *params);
double
Ktilde_normalization_func(double x, void *params);
/**
* Calculates the normalization for the non tilde K functions
* @param Temp Temperature
* @param s +1 for fermions and -1 for bosons
* @param masssquared m^2 value
*/
double Ktilde_normalization(double Temp, int s, double masssquared);
double
Ktilde_normalization(double Temp, int s, double masssquared);

}
}
} // namespace Kfactors
} // namespace BSMPT
72 changes: 42 additions & 30 deletions include/BSMPT/Kfactors/Kfactors_grid/Kfunctions_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@

/**
* @file
* Declaration of the vectors containing the data points used for the Kfactor interpolations
*/
* Declaration of the vectors containing the data points used for the Kfactor
* interpolations
*/
#pragma once
#include <array>
namespace BSMPT {
namespace Kfactors {
namespace Data{
namespace BSMPT
{
namespace Kfactors
{
namespace Data
{
/**
* @brief msg_size number of data points sampled in msg
*/
Expand All @@ -36,54 +40,62 @@ const std::size_t msg_size = 12999;
const std::size_t Tg_size = 121;
/**
* @brief msg Data points used to sample in the m^2 direction of the Kfunctions
* starting from 0 to 5 in steps of 10^-3 and then continuing to 200^2 in steps of 5
* starting from 0 to 5 in steps of 10^-3 and then continuing to 200^2 in steps
* of 5
*/
extern const std::array<double,msg_size> msg;
extern const std::array<double, msg_size> msg;
/**
* @brief Tg Data points used to sample in the Temperature direction of the Kfunctions
* starting from 10 to 250 in steps of 2
* @brief Tg Data points used to sample in the Temperature direction of the
* Kfunctions starting from 10 to 250 in steps of 2
*/
extern const std::array<double,Tg_size> Tg;
extern const std::array<double, Tg_size> Tg;
/**
* @brief K1p Data set used for the interpolation of the K1 functions for fermions
* @brief K1p Data set used for the interpolation of the K1 functions for
* fermions
*/
extern const std::array<std::array<double,Tg_size>,msg_size> K1p;
extern const std::array<std::array<double, Tg_size>, msg_size> K1p;
/**
* @brief K1m Data set used for the interpolation of the K1 functions for bosons
*/
extern const std::array<std::array<double,Tg_size>,msg_size> K1m;
extern const std::array<std::array<double, Tg_size>, msg_size> K1m;
/**
* @brief K2p Data set used for the interpolation of the K2 functions for fermions
* @brief K2p Data set used for the interpolation of the K2 functions for
* fermions
*/
extern const std::array<std::array<double,Tg_size>,msg_size> K2p;
extern const std::array<std::array<double, Tg_size>, msg_size> K2p;
/**
* @brief K4p Data set used for the interpolation of the K4 functions for fermions
* @brief K4p Data set used for the interpolation of the K4 functions for
* fermions
*/
extern const std::array<std::array<double,Tg_size>,msg_size> K4p;
extern const std::array<std::array<double, Tg_size>, msg_size> K4p;
/**
* @brief K4m Data set used for the interpolation of the K4 functions for bosons
*/
extern const std::array<std::array<double,Tg_size>,msg_size> K4m;
extern const std::array<std::array<double, Tg_size>, msg_size> K4m;
/**
* @brief K5p Data set used for the interpolation of the K5 functions for fermions
* @brief K5p Data set used for the interpolation of the K5 functions for
* fermions
*/
extern const std::array<std::array<double,Tg_size>,msg_size> K5p;
extern const std::array<std::array<double, Tg_size>, msg_size> K5p;
/**
* @brief K5m Data set used for the interpolation of the K5 functions for bosons
*/
extern const std::array<std::array<double,Tg_size>,msg_size> K5m;
extern const std::array<std::array<double, Tg_size>, msg_size> K5m;
/**
* @brief K6p Data set used for the interpolation of the K6 functions for fermions
* @brief K6p Data set used for the interpolation of the K6 functions for
* fermions
*/
extern const std::array<std::array<double,Tg_size>,msg_size> K6p;
extern const std::array<std::array<double, Tg_size>, msg_size> K6p;
/**
* @brief K8p Data set used for the interpolation of the K8 functions for fermions
* @brief K8p Data set used for the interpolation of the K8 functions for
* fermions
*/
extern const std::array<std::array<double,Tg_size>,msg_size> K8p;
extern const std::array<std::array<double, Tg_size>, msg_size> K8p;
/**
* @brief K9p Data set used for the interpolation of the K9 functions for fermions
* @brief K9p Data set used for the interpolation of the K9 functions for
* fermions
*/
extern const std::array<std::array<double,Tg_size>,msg_size> K9p;
}
}
}
extern const std::array<std::array<double, Tg_size>, msg_size> K9p;
} // namespace Data
} // namespace Kfactors
} // namespace BSMPT
Loading

0 comments on commit 0e098cf

Please sign in to comment.