Bug 410855

Summary: Repeated Random Values
Product: [Applications] LabPlot2 Reporter: ameya.patwardhan99
Component: backendAssignee: Alexander Semke <alexander.semke>
Status: RESOLVED FIXED    
Severity: critical    
Priority: NOR    
Version First Reported In: 2.6.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 2.7
Sentry Crash Report:
Attachments: file which demonstrate repetitive random values

Description ameya.patwardhan99 2019-08-12 16:42:44 UTC
Created attachment 122089 [details]
file which demonstrate repetitive random values

SUMMARY
Random values generated using the same function (eg. Flat, gaussian, etc.) are always the same i.e. Row 1 always gives same value 'a', row 2 always gives same value 'b', etc. This persists even across different files. 
See code KDE/labplot 
labplot/src/kdefrontend/spreadsheet/RandomValuesDialog.cpp
gsl_rng_set is the function that seeds the random value generator. This function is not used anywhere leading to the repetitive values. The seed value should be taken from the current time. This function should be used after gsl_rng* r = gsl_rng_alloc(T);


STEPS TO REPRODUCE
1. New spreadsheet
2. Generate Data -> Random values
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Alexander Semke 2019-08-12 18:03:46 UTC
Git commit c7d667f5be0fb68c7ab716a63f43516984f52ffc by Alexander Semke.
Committed on 12/08/2019 at 18:03.
Pushed by asemke into branch 'master'.

[spreadsheet] seed the random number generator with the current time in
order not to generate repetitive numbers in the spreadsheet.
FIXED-IN: 2.7

M  +1    -0    ChangeLog
M  +1    -0    src/kdefrontend/spreadsheet/RandomValuesDialog.cpp

https://commits.kde.org/labplot/c7d667f5be0fb68c7ab716a63f43516984f52ffc