Created
March 31, 2012 16:17
-
-
Save isag/2266492 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double **select_subpool(Params *p, double **pool,int nrows,int nrows_sub) | |
{ | |
int positions[nrows]; | |
for(int i = 0 ; i < nrows ; ++i) positions[i] = i; | |
// shuffle the vector | |
//------------------- | |
knuth_shuffle((void*)positions, nrows, p->rng, sizeof(int*)); | |
for (int i = 0 ; i < nrows ; ++i) printf("%d\t",positions[i]); | |
printf("\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, I applied the method for a matrix shuffle (that's why I put the *).
I will removed the star in facilitation too.
Thanks