Algorithm Design: Best Way to Represent a 2D Grid, with Boundary Digits, in C++?

I like working on algorithms in my spare time to improve my algorithm design skills. I tackle Jane Street’s monthly puzzles as my ‘monthly challenge’. I’ve previously developed algorithms to solve their October Puzzle, and have solved their November puzzle by hand. I solved their November puzzle (Hooks #6) by hand, but only because I’m…

Discover more

How to do multiplication for two 4-bit numbers treating them as polynomials in C++

I am simulating a mini AES encryption/decryption algorithm using C++. For this I need to multiply two 4-bit numbers while treating them as polynomials. It goes though some stages, that are, converting to polynomials, multiply the two polynomials, polynomial reduction to lower power if needed using a predefined irreducible polynomial. Then converting back to 4-bit…

Discover more

C++ External Class in std::vector ( definition would be ill-formed )

I have built a class in an external library that I was hoping to use in other areas. However, when I try to use the class within an std::vector I get compile errors from ../../src/geom/geom.cpp:21: /usr/include/c++/4.8.2/ext/new_allocator.h: In instantiation of `void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& …) [with _Up = GenUtils::MeshNormalData; _Args = {const GenUtils::MeshNormalData&}; _Tp = GenUtils::MeshNormalData]`: /usr/include/c++/4.8.2/bits/alloc_traits.h:254:4:…

Discover more