forcedotcom/distributions — pull request #77 by stephentu (2014-08-12 23:12:13+00:00)
Title: fix bug in NIW templated protobuf_load()/protobuf_store() 

The C++ templated versions of protobuf_load()/protobuf_store() was buggy for any dimension > 2.

This wasn't caught with test cases, since the lp cython wrappers reimplement protobuf_load()/protobuf_store() without using the C++ versions (meaning there was no test coverage of these functions). As a result, I also added a C++ level test in `src/test_protobuf.cc` which simply calls protobuf_load()/protobuf_store() on the C++ objects. Consequently, this also found a sign compare warning in DirichletDiscrete's implementation.

Unfortunately, the tests currently don't do any smart equality checking-- we could compare the bytes of the protobuf messages, but floating point imprecisions might screw that up. This is strictly better than what we had before, though.