Skip to content

Instantly share code, notes, and snippets.

View endJunction's full-sized avatar

Dmitri Yu. Naumov endJunction

  • Helmholtz Centre for Environmental Research -- UFZ
  • Leipzig
View GitHub Profile
@endJunction
endJunction / x.cpp
Created August 23, 2017 20:24
Benchmark for-range vs std::generate
#include <celero/Celero.h>
#include <algorithm>
#include <numeric>
#include <vector>
#include <random>
CELERO_MAIN;
std::random_device rd;
std::mt19937 random_number_generator(rd());
@endJunction
endJunction / b.h
Last active December 21, 2015 23:28
static const integral class member definition in c++ compile with $(CXX) -std=c++11 main.cpp
namespace b_space {
struct B
{
static const int j = 42;
};
}
@endJunction
endJunction / pow_test.cpp
Created August 22, 2013 11:15
timing of std::pow, sqrt, cbrt.
#include <algorithm>
#include <chrono>
#include <cmath>
#include <functional>
#include <iostream>
#include <random>
#include <vector>
using namespace std::placeholders;
@endJunction
endJunction / config.xml
Created November 7, 2012 11:08
boost::property_tree and xml config example
<coupling>
<P algorithm="serial">
<M name="flow1" type="GROUNDWATER_FLOW" />
<P algorithm="parallel">
<M name="compoundA" type="MASS_TRANSPORT" />
<M name="compoundB" type="MASS_TRANSPORT" />
</P>
</P>
</coupling>