Efficient C++ implementation of deep neural network training and testing that avoids unnecessary use of classes to represent the network.