project-imprimis / libprimis

Libprimis: Imprimis' 3D destroyable world engine
https://project-imprimis.github.io/libprimis/index.html
Other
29 stars 8 forks source link

Mersenne twister implementation is plagiarized #30

Closed no-lex closed 4 years ago

no-lex commented 4 years ago

The Mersenne twister algorithm for random numbers in tools.cpp is plagiarized from an algorithm described in its original form in multiple other locations:

https://github.com/blei-lab/lda-c/blob/master/cokus.c https://github.com/hsoleimani/ATD/blob/master/ATDCode/cokus.c

This code was plagiarized essentially verbatim up until it was refactored in https://github.com/inexorgame/sauerbraten/commit/f3f3949f1009db3805dcf1ca5b4bbee453c79679, but it's still distributed against the terms of its licensing (GPL v2).

It needs to be removed and replaced with some other algorithm to keep the codebase's licensing consistent.

no-lex commented 4 years ago

None of the applications of the above MT algorithm appear to require particularly high randomness nor particularly high performance, so the MT implementation above has been replaced by stdlib's rand().