Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GSL statistics, what is stride?

I would like to use GSL (Gnu Scientific Lib) to calculate the standard deviation of an array. http://www.gnu.org/software/gsl/manual/html_node/Mean-and-standard-deviation-and-variance.html

In the manual, the function prototype is gsl_stats_sd (const double data[], size_t stride, size_t n)

However, I don't quite understand what the "stride" is here. Would somebody know what it is?

Thank you very much for any suggestions!

-Alfred

like image 568
Alfred Zhong Avatar asked May 30 '12 17:05

Alfred Zhong


1 Answers

A stride is the separation in the array between two consecutive elements. If you have an array of doubles as the argument, then the stride would be 1.

The idea is that you can handle multiple data within a single array, and operate on different subcomponents of the array.

like image 80
K-ballo Avatar answered Nov 04 '22 23:11

K-ballo