This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On Wed, Sep 5, 2012 at 6:34 PM, Ed Smith-Rowland <3dw4rd@verizon.net> wrote:Forgot about that. Fixed.I wrote some distributions a couple months back. I wrote them as (name-uglified) extensions to libstdc++.
Here is the Rice distribution.I never used this distribution myself but that doesn't mean anything. A few nits:
- you should add __generate functions (see the current svn code)
Hypot is a good idea. I'm not worried about overflow heresuch as student-t.
- in the operator function, did you consider using hypot? I'm not sure it's necessary, the x and y numbers might not require it. hypot is usually more accurate. The multiplications are throwing away a lot of bits which the sqrt call might need.
i think I got this right. Other distros have things as I have them here.
- the operator== has the bug which we fixed in the library. You cannot define a template friend function in the template class definition. Look at the current libstdc++ code. Likewise for the other friend functions.
They are small. i left them where they wre but I could still move them.
- how about moving the operator() code and perhaps even the operator== code into random.tcc?
Done.
- move the operator!= outside the class definition, just like for the other classes
I sent an old patch I guess. Fixed.
- with the definition being in ext/random, the test cases shouldn't reference the non-existing rice_distribution.h header
Attachment:
rice_distro2
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |