update eemd_example

This commit is contained in:
张壹 2021-11-20 16:23:07 +08:00
parent b786a3abd6
commit b09fd62041
2 changed files with 12 additions and 0 deletions

1
.gitignore vendored
View File

@ -51,6 +51,7 @@ Module.symvers
Mkfile.old Mkfile.old
dkms.conf dkms.conf
.vscode/
build/ build/
.DS_Store .DS_Store
*.sh *.sh

View File

@ -56,6 +56,8 @@ int main(void) {
} }
// Write output to file // Write output to file
FILE* fp = fopen(outfile, "w"); FILE* fp = fopen(outfile, "w");
// Output in lines
/*
for (size_t j=0; j<N; j++) { for (size_t j=0; j<N; j++) {
fprintf(fp, "%f ", inp[j]); fprintf(fp, "%f ", inp[j]);
} }
@ -66,6 +68,15 @@ int main(void) {
} }
fprintf(fp, "\n"); fprintf(fp, "\n");
} }
*/
// Output in columns
for (size_t j=0; j<N; j++) {
fprintf(fp, "%f ", inp[j]);
for (size_t i=0; i<M; i++) {
fprintf(fp, "%f ", outp[i*N+j]);
}
fprintf(fp, "\n");
}
printf("Done!\n"); printf("Done!\n");
// Cleanup // Cleanup
fclose(fp); fclose(fp);