Skip to content

Instantly share code, notes, and snippets.

View bfraboni's full-sized avatar
🙃
Doing nothing

Basile Fraboni bfraboni

🙃
Doing nothing
View GitHub Profile
@bfraboni
bfraboni / permute.cpp
Created January 8, 2021 09:23
Memory free pseudo random permutation of a range of indices
#include <iostream>
#include <vector>
#include <random>
#include <algorithm>
// Non stored iteration order over a 2D array of dimension NxM
// (walk through every cell only once)
// 1. deterministic orders
// row per row
@bfraboni
bfraboni / search.cpp
Last active September 30, 2019 16:31
Comparison between exhaustive search, binary search, and linear fit / interpolation search for sorted arrays.
#include <chrono>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <random>
#include <cassert>
// Comparison between exhaustive search, binary search, and linear fit / interpolation search for sorted arrays.
@bfraboni
bfraboni / concurrency.cpp
Created September 4, 2019 13:06
Task concurrency using nested parallelism with OpenMP
#include <cstdio>
#include <chrono>
#include <omp.h>
void viewer( int& a, bool& stop )
{
printf("thread %d start viewer\n", omp_get_thread_num());
auto start = std::chrono::high_resolution_clock::now();
while( !stop )
{
@bfraboni
bfraboni / blur_float.cpp
Last active October 29, 2024 22:19
C++ implementation of a fast Gaussian blur algorithm by Ivan Kutskir - Integer and Floating point version
// Copyright (C) 2017 Basile Fraboni
// Copyright (C) 2014 Ivan Kutskir
// All Rights Reserved
// You may use, distribute and modify this code under the
// terms of the MIT license. For further details please refer
// to : https://mit-license.org/
//
//!
//! \file blur.cpp