Fast C++ implementation of neural networks