{"repo":"tomhea/farray","free":true,"listed":false,"github":"https://github.com/tomhea/farray","clone":"git clone https://github.com/tomhea/farray.git","description":"Initialize / Fill C++ array fast - O(1) time with only 1 extra bit of memory.","language":"C++","stars":31,"topics":["array","constant-time","constant-space","implementation","template","data-structures","initialization","header-only","header","library"],"license":"BSD-2-Clause","category":"saas-starters-boilerplates","readme_excerpt":"Initialize arrays in constant time C++ Header-only Implementation of the In-Place Initializable Arrays paper. It's a templated array with constant-time fill(v), read(i), write(i,v) operations, all with just 1 bit of extra memory. You can really sense the speedup it provides. This single-file library is thoroughly tested , and is Embedded-friendly as it has no exceptions, and use no other library. It can also use no dynamic allocations. The paper is based on the simpler Initializing an array in constant time - which uses 2n extra memory words. I wrote a Medium article about array initialization and this project. Read it and come back 🧑‍💻. Basic Use: To use the array, just download and include the header file. That's it. If you want to compile it without any dynamic allocations: Using the Farray1 class: The output will be: You can also use the A.fill(v), A.read(i), A.write(i,v) syntax, instead of A=v, A[i], A[i]=v . Also, indexing is circular, so (e.g ). How much Faster? 🚀 Take a look at the time speedups gained by using Farray1 over a regular array. You can also run the timings benchmark on your pc with times farray1.cpp (takes about 5 minutes). Farray Website! This project has a Website! It covers to following topics: Short Description about the algorithm Advanced Features - iterator, direct-functions, smaller-blocks, templates","default_branch":null,"files":null,"tree":[],"storefront":"/r/tomhea","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tomhea/farray/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}