Pergunta

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

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top