Re: fill array using a lambda function

2013-10-10 Thread bearophile
Simen Kjaeraas: You've got the order wrong - copy takes first the source, then the target. I'd like it to be (re)named "copyTo" to avoid me such common mistake. Bye, bearophile

Re: fill array using a lambda function

2013-10-10 Thread Simen Kjaeraas
On 2013-10-10, 16:04, bearophile wrote: dominic jones: I want to fill an array with random numbers without resorting to loops, i.e. by doing something like the following, if it were possible: fill!(function double(){ return uniform(0.0, 1.0);})(x[]); Is there a simple way of doing this?

Re: fill array using a lambda function

2013-10-10 Thread bearophile
dominic jones: I want to fill an array with random numbers without resorting to loops, i.e. by doing something like the following, if it were possible: fill!(function double(){ return uniform(0.0, 1.0);})(x[]); Is there a simple way of doing this? Generally it's a good idea to use only p

fill array using a lambda function

2013-10-10 Thread dominic jones
Hello, I want to fill an array with random numbers without resorting to loops, i.e. by doing something like the following, if it were possible: fill!(function double(){ return uniform(0.0, 1.0);})(x[]); Is there a simple way of doing this? Thank you, Dominic Jones P.S. I am aware of the