Skip to content

Conversation

@Gathros
Copy link
Contributor

@Gathros Gathros commented Apr 17, 2018

No description provided.

for(size_t i = 0; i < N/2; ++i){
X[i + N/2] = tmp[i];
}
void cooley_tukey(double complex *X, const size_t N) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This N is the only parameter which is const, which is quite odd.

}
}
void iterative_cooley_tukey(double complex *X, size_t N) {
int stride;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is stride defined here, as opposed to inside the for loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know why I did that.

}
void iterative_cooley_tukey(double complex *X, size_t N) {
int stride;
double complex v,w;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with v and w; you can define these variables inside the for loop.

}
int main() {
srand(time(NULL));
const size_t N = 64;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you probably want to use a #define here; otherwise, the line after it is defining three VLAs.

for (size_t i = 0; i < grp_size; ++i) {
printf("preferences of man %zu \n", i);
for(size_t j = 0; j < grp_size; j++){
for (size_t j = 0; j < grp_size; j++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you switch i++ to ++i, but not j++ to ++j.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that, thanks.

@strega-nil
Copy link

Thanks for this cleanup!

@leios
Copy link
Member

leios commented Apr 18, 2018

Great! So I'll wait for a few more small scale changes before merging this one. Thanks!

@leios
Copy link
Member

leios commented Apr 18, 2018

Alright, great! Thanks again!

@leios leios merged commit 5d65985 into algorithm-archivists:master Apr 18, 2018
@Gathros Gathros deleted the CCleaningPR branch April 24, 2018 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants