Bug 410855 - Repeated Random Values
Summary: Repeated Random Values
Status: RESOLVED FIXED
Alias: None
Product: LabPlot2
Classification: Applications
Component: backend (other bugs)
Version First Reported In: 2.6.0
Platform: Other Linux
: NOR critical
Target Milestone: ---
Assignee: Alexander Semke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-12 16:42 UTC by ameya.patwardhan99
Modified: 2019-08-12 18:03 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 2.7
Sentry Crash Report:


Attachments
file which demonstrate repetitive random values (1.39 KB, application/x-labplot2)
2019-08-12 16:42 UTC, ameya.patwardhan99
Details

Note You need to log in before you can comment on or make changes to this bug.
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