diff options
author | Ilhan Özgen <ilhan.oezgen@wahyd.tu-berlin.de> | 2017-05-03 17:55:23 +0200 |
---|---|---|
committer | Ilhan Özgen <ilhan.oezgen@wahyd.tu-berlin.de> | 2017-05-03 17:55:23 +0200 |
commit | c0fec33997f40f9a987d953cd6d6004c8220ecf6 (patch) | |
tree | 7da2df1773a173a9ea5d6250a578e89b3ee62085 | |
parent | b730c00cc97f748e0fb60ff1c2708f6d1eec669f (diff) |
change to struct in main
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | main.c | 5 | ||||
-rw-r--r-- | sysmat.c | 2 | ||||
-rw-r--r-- | sysmat.h | 2 |
4 files changed, 5 insertions, 6 deletions
@@ -8,7 +8,7 @@ PRG=main CC=cc CFLAGS=-Wall -Wextra -pedantic -g LFLAGS= -SRC=test_pcg.c linalg.c solver.c +SRC=main.c linalg.c solver.c sysmat.c INCLUDES= LIB=-lm @@ -66,13 +66,14 @@ int main (void) m.ids = ids; m.len_c = dim; m.len_r = dim; + m.len_d = dim; m.len_id = 5; - m = system_matrix(m, nx, ny, kf); + system_matrix(&m, nx, ny, kf); printf("... \n"); for (int i = 0; i < dim; i ++) { for (int j = 0; j < dim; j ++) { - printf(" %g ", get(m, i, j)); + printf(" %g ", get(&m, i, j)); } printf("\n"); } @@ -63,8 +63,6 @@ void system_matrix(struct diag* m, int nx, int ny, double* val) printf("%g\n", get(m, 4, 1)); printf("%g\n", get(m, 4, 7)); - return m; - // // boundary cells with 2 neighbors // // // upper left corner : r = 0, c = 0; @@ -14,7 +14,7 @@ #ifndef __SYSMAT_INCLUDED__ #define __SYSMAT_INCLUDED__ -struct diag system_matrix(struct diag, int, int, double*); +void system_matrix(struct diag*, int, int, double*); double harmonic(double, double); |