Refactoring #1076

Updated by wuttke over 5 years ago

Adapt extant math code (e.g. form factor calculations) to Can we agree on some of the following agreed conventions: following:
* In a source file (or in a function ?) that contains several calls to sqrt, exp, sin, and the like: use "using namespace std"
* Ditto, when there are calls to sinc: "using namespace MathFunctions"
* Change Sinc into sinc: when it comes to the readability of formulae, math conventions are more important than project-wide coding conventions
* At single source file level, define I = Write 'I' for complex_t(0.0, 1.0). Where to define this?
* Add function sqr(x)=x*x #define SQR(x) ((x)*(x)) - where to MathFunctions put this?
* Never introduce auxiliary variables like m_root3 = std::sqrt(3.0); leave it to the compiler to replace 'sqrt(3) by a constant.
* In expressions like 'R/2' or '1+exp(...)' or 'sqrt(3)', write integer constants as integer, not as double.

Back