diff --git a/newlib/examples/jacobi.c b/newlib/examples/jacobi.c index a899d87e..6c0e7a20 100644 --- a/newlib/examples/jacobi.c +++ b/newlib/examples/jacobi.c @@ -1,6 +1,6 @@ /* - * Copyright 2011 Stefan Lankes, Alexander Pilz, Maximilian Marx, Michael Ober, - * Chair for Operating Systems, RWTH Aachen University + * Copyright 2010-2011 Stefan Lankes + * Chair for Operating Systems, RWTH Aachen University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,10 +26,10 @@ #undef errno extern int errno; -#define MATRIX_SIZE 256 -#define MAXVALUE 1337 -#define PAGE_SIZE 4096 -#define CACHE_SIZE (256*1024) +#define MATRIX_SIZE 128 +#define MAXVALUE 1337 +#define PAGE_SIZE 4096 +#define CACHE_SIZE (256*1024) #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) static int generate_empty_matrix(double*** A , unsigned int N) { @@ -89,28 +89,26 @@ static int generate_empty_matrix(double*** A , unsigned int N) { int main(int argc, char **argv) { - double* temp; - unsigned int i, j, iter_start, iter_end; - unsigned int iterations = 0; - double error, norm, norm_res, max = 0.0; - double** A=0; - double* X; - double* X_old, xi; - double start,stop; + double* temp; + unsigned int i, j, iter_start, iter_end; + unsigned int iterations = 0; + double error, norm, max = 0.0; + double** A=0; + double* X; + double* X_old, xi; + double start,stop; if (generate_empty_matrix(&A,MATRIX_SIZE) < 0) { printf("generate_empty_matrix() failed...\n"); - fflush(stdout); exit(-1); } printf("generate_empty_matrix() done...\n"); - fflush(stdout); - X=(double*) malloc(MATRIX_SIZE*sizeof(double)); - X_old=(double*) malloc(MATRIX_SIZE*sizeof(double)); + X = (double*) malloc(MATRIX_SIZE*sizeof(double)); + X_old = (double*) malloc(MATRIX_SIZE*sizeof(double)); if(X == NULL || X_old == NULL) { printf("X or X_old is NULL...\n"); @@ -124,7 +122,6 @@ int main(int argc, char **argv) } printf("start calculation...\n"); - fflush(stdout); iter_start = 0; iter_end = MATRIX_SIZE; @@ -142,7 +139,7 @@ int main(int argc, char **argv) for (i=iter_start; i