Subversion Repositories programming

Rev

Rev 326 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 326 Rev 327
Line -... Line 1...
-
 
1
/* proj3.c - implements the APSP algorithm for a matrix of size 4x4.
-
 
2
 *
-
 
3
 * Copyright (c) 2006, Ira W. Snyder (devel@irasnyder.com)
-
 
4
 */
-
 
5
 
-
 
6
 
1
#include <stdio.h>
7
#include <stdio.h>
2
#include <limits.h>
8
#include <limits.h>
3
#include <mpi.h>
9
#include <mpi.h>
4
 
10
 
5
const int ROOT_NODE = 0;
11
const int ROOT_NODE = 0;
Line 155... Line 161...
155
        b[12] = 10;
161
        b[12] = 10;
156
        b[13] = INT_MAX;
162
        b[13] = INT_MAX;
157
        b[14] = 3;
163
        b[14] = 3;
158
        b[15] = 0;
164
        b[15] = 0;
159
 
165
 
-
 
166
        /* Force b[i][i] = 0 */
-
 
167
        for (i=0; i<n; i++)
-
 
168
            b[i*n+i] = 0; 
-
 
169
 
160
        if (n<=100)
170
        if (n<=100)
161
            print_matrix (b, n, "Input Matrix:");
171
            print_matrix (b, n, "Input Matrix:");
162
        else
172
        else
163
        {
173
        {
164
            printf ("Beginning calculation for all shortest paths\n");
174
            printf ("Beginning calculation for all shortest paths\n");