But so much confusion. Please consider using another language for your statistics problem. C++ is much more natural for expressing object-orientation. Most statistics have shapes in hyperspace that have already been analyzed to the Nth degree.