Nick
Nick
@mrityunjay-tripathi Could you write a google benchmark and show how fast it is with and without the argument validation? This is a really hard question to answer without hard data....
@jzmaddock , @pabristow : For scalar distribution, using free functions to compute kurtosis, range, so on, is just fine. But for vector types, following this pattern is getting a bit...
@mrityunjay-tripathi : We have a file "boost/libs/math/test/math_unit_test.hpp", which you can use to write unit tests. An example is "test/whittaker_shannon_test.cpp".
> I am not familiar with 'google benchmark', but ready to delve into it. As soon as I add the tests, I will try to write the benchmark as well....
> I confess to a certain amount of hesitation in adding something that's not entirely mainstream as our first multivariate distribution. I had always assume that the multivariate normal would...
``` ./include/boost/math/distributions/dirichlet.hpp:53:20: error: need 'typename' before 'RandomAccessContainer::value_type' because 'RandomAccessContainer' is a dependent scope 53 | using RealType = RandomAccessContainer::value_type; | ^~~~~~~~~~~~~~~~~~~~~ | typename ``` Also: ``` ./include/boost/math/distributions/dirichlet.hpp:231:12: error: 'm_alpha' was...
Get your unit tests in, make them as simple and as meaningful as possible, and these errors will become obvious to you. Though I think you might be using "moved-from"...
BTW, your code is a little verbose: ```cpp std::vector alpha = {0.4, 5.0, 15.0}; std::vector x = {0.2, 0.2, 0.6}; using VectorType = typename std::vector; boost::math::dirichlet_distribution diri(std::move(alpha)); ``` Instead: ```cpp...
> How about using 'L' as suffix for those floating point literals? Yes, that would fix the issue.
What is the header `#include ` doing?