Ask a Question

can someone give me the c code for vogels approximation method?

on 2011-01-31 21:39:38   by priyam   on Computer Science & Engineering  3 answers

sanchayita

on 2011-01-31 10:30:00  

#include #include #define TRUE 1 #define FALSE 0 #define INFINITY 1111 #define N 3 #define M 4 void input(void); void display(void); void displayfinal(void); void diffmin(void); void table(void); int max(int *,int *,int); int min(int,int); int mini(int *,int *,int); int condition(void); int arr[N][M]; int arrcopy[N][M]; int value[N][M]; int u[N]; int v[M]; int rowdiffmin[N]; int coldiffmin[M]; int decide[M+N]; int x[N],y[M]; /* x is u y is v */ void main() { int i,j; table(); x[0]=0; for(i=0;i

sanchayita

on 2011-01-31 10:30:00  

Output of Vogel Approximation Method ------------------------------------ 5 3 6 2 19 (1) 4 7 9 1 37 (3) 3 4 7 5 34 (1) 16 18 31 25 (1) (1) (1) (1) ---------------------------------------------------- 5 3 6 1111 19 (2) 4 7 9 1111 12 (3) 3 4 7 1111 34 (1) 16 18 31 0 (1) (1) (1) (0) ---------------------------------------------------- 5 3 6 1111 19 (2) 1111 1111 1111 1111 0 (0) 3 4 7 1111 34 (1) 4 18 31 0 (2) (1) (1) (0) ---------------------------------------------------- 5 1111 6 1111 1 (1) 1111 1111 1111 1111 0 (0) 3 1111 7 1111 34 (4) 4 0 31 0 (2) (0) (1) (0) --------------------------------------------------- 1111 1111 6 1111 1 (1105) 1111 1111 1111 1111 0 (0) 1111 1111 7 1111 30 (1104) 0 0 31 0 (0) (0) (1) (0) --------------------------------------------------- 1111 1111 1111 1111 0 (0) 1111 1111 1111 1111 0 (0) 1111 1111 7 1111 30 (1104) 0 0 30 0 (0) (0) (1104) (0) --------------------------------------------------- 1111 1111 1111 1111 0 (0) 1111 1111 1111 1111 0 (0) 1111 1111 1111 1111 0 (0) 0 0 0 0 (0) (0) (0) (0) --------------------------------------------------- --------------------------------------------------- 5 3|18 6|1 2 4|12 7 9 1|25 3|4 4 7|30 5 1111 1111 7 1111 30 (1104) X[1][2] = 18 X[1][3] = 1 X[2][1] = 12 X[2][4] = 25 X[3][1] = 4 X[3][3] = 30

SHOUBHIK

on 2011-02-03 10:30:00  

poor code quality, not readable... ! try pastebin.com