Skip to content

Instantly share code, notes, and snippets.

View tschnz's full-sized avatar

Jens W. Schindel tschnz

View GitHub Profile
@tschnz
tschnz / 1d_gauss.h
Created December 14, 2022 17:39
Create centered & normalized 1D gaussian kernel aka normal distribution function aka probability density function
template <typename T>
T norm_pdf(T x, T mu, T sigma)
{
static const T inv_sqrt_2pi = static_cast<T>(0.3989422804014327); // Precomputed 1/sqrt(2*PI) to avoid sqrt()
T a = (x - mu) / sigma;
return inv_sqrt_2pi / sigma * std::exp(-T(0.5) * a * a);
}
template <typename T>
@tschnz
tschnz / vscode_settings.json
Created April 23, 2018 20:28
Current Settings of VS Code
{
"editor.wordWrap": "on",
"editor.fontFamily": "SauceCodePro Nerd Font",
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": "One Dark Pro",
"materialTheme.cache.workbench.settings": {
"themeColours": "Default High Contrast",
"accent": "Cyan",
"accentPrevious": "Indigo"
},