Weighted choice implementation

In the previous post, we developed the tiny_rand library as an extension of the STL random header. The goal was to build a minimal set of functions such that it would allow to randomly generate any kind of data: containers, classes, tuples, variants, and any combination of those. The tiny_rand library is built around concepts... Continue Reading →

Building on the STL random header

In today's post, we will discuss the design and implementation of a small headers only library, whose aim is to complete the STL random header with combinators to generate arbitrary random data. Throughout this post, we will first describe the motivations behind this library, and the its high level goals. These goals will imply design... Continue Reading →

Lost in permutation test complexity

In our lost in permutation complexity post, we talked about the std::is_permutation algorithm and its algorithmic complexity issue. We went over several use cases that seems like perfect matches for std::is_permutation. But because of its quadratic complexity, we made the argument that std::is_permutation is almost impractical: its costs is not worth the trade-off of manually... Continue Reading →

Still lost in permutation complexity

In our last post, we talked about the std::is_permutation algorithm and its algorithm complexity issue. We went over several use cases that seems like perfect matches for std::is_permutation. But because of its quadratic complexity, we made the argument that std::is_permutation is almost impractical: its costs is not worth the trade-off of manually coding the alternative.... Continue Reading →

Lost in permutation complexity

This post will be dedicated to an STL algorithm I discovered only recently, and which caused me some serious performance issue at my first use of it. This algorithm is std::is_permutation. It appeared in the STL with C++11 and in principle, it is quite a useful algorithm. It is however deeply penalized by its inefficiency,... Continue Reading →

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: