-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[math] PRBS generator #8798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[math] PRBS generator #8798
Conversation
couet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@phsft-bot build I think new generators should go via |
|
I would like to revive this PR, @ferdymercury do you feel like rebasing so that I can start the builds ? |
|
see also #8798 (comment) |
Test Results 20 files 20 suites 3d 14h 2m 12s ⏱️ Results for commit 1a44726. ♻️ This comment has been updated with latest results. |
|
@hahnjo Thanks for the comment! I can move it there, but do I really need to derive from TRandomEngine? The parent methods are for double Rndm(), which does not seem very useful to me. Wrt tests, I will 'copy' the mentioned tutorial as 'test' once it's clear where this class should go. Thanks for the review!! :) |
|
Hello @ferdymercury |
Thanks for the reply! We discussed this point in the associated issue: #8199 (comment) |
|
I still think is very specific, and we could have it maybe as an external addition. |
|
Ok. What do you mean by external? Moving it to just a tutorial? Happy to change that once it's clarified. |
|
@lmoneta any chance of moving this forward? Not necessarily by merging it, but to know how to proceed (maybe move the implementation to a tutorial as @ferdymercury suggested) |
|
Hi @ferdymercury, all, I think I know how to move this forward. Indeed, using the Indeed, we nowadays prefer to have things in the Would that be okay for you? If this change would be made, and some tests implemented, I'd have no problem merging this! I see no risk. The maintenance burden is minimal, as there would be no new serializable class, no new dependencies, and minimal code. And there is also no risk of confusion if this is clearly separate from @ferdymercury, what do you think? Sorry that this PR took so long. |
Sounds perfect! I can take a look on it, thanks for the feedback. |
guitargeek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions/requests for improvement inline.
c0c8520 to
9ad94d5
Compare
|
Thanks for the update @ferdymercury! So in the end you didn't want to go for the iterators? I have made a suggestion to address your problem stated in #8798 (comment). Not sure if you have seen it, because GitHub is glitching for me (I can't see my own comments from my phone for example....). What comes to my mind is to introduce an additional if (i > 0)
*out++ = buffer;
buffer = newBit;And then in the end: if(!oppositBit)
*out++ = buffer; // don't add the last element otherwise, as we already pushed the one from the seed above the while loopSo there are ways, and it's generally cleaner to avoid these vector specific things like Or you really want a return variable? |
guitargeek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see we don't agree on some of the subjective choices here 😄
No problem. Then my final questions are if the taps is worth to pass by const &, and why we actually have the static keywords.
|
Ooooh okay I get it now, GitHub only posts all my inline comments after I finish the review! 😮 It's the first time I use the right button for inline review comments, and I got confused. So that's what "pending" meant.... I was already surprised how you ignored so professionally my comments 🤣 Well, anyway, now you should be able to see all my suggestions. |
Ah, nope, sorry, I didn't see that, might have been a glitch.
There are several reasons I preferred a return variable:
|
Fixes root-project#8199 [math] move to free-standing functions in namespace [nfc] spell out return types in tutorial as suggested by guitargeek [math] LFSR: allow setting output typename, default to uchar also remove const qualifiers from signature since they are copied by value and apply clang-formatting [nfc] fix typo in docu qualify std uint
This Pull request:
Changes or fixes:
Adds PRBS generation code
Checklist:
This PR fixes #8199