EMPS intranet

Hi!   Hi!           Start main()

Try stepping through the code

Value and type of last evaluated expression: Address of array element: Address of array elementx:  (none)

Your browser does not support the canvas element which will make some the features unavailable.

If you are using Internet Explorer within the University of Exeter try going to the Settings menu (probably the gear shape at the top right of this page), selecting "Compatibility View settings", unchecking "Display intranet sites in Compatibility View" and reloading this page.

Code

``` Header...
//
// Multiply two matrices together: A = B x C
//
void matmul(int nx,int ny,int nz,float a[][ny],
float b[][nz],float c[][ny]){   ...
»  int x, y, z;

»  for (x=0; x<nx; ++x) {
»    for (y=0; y<ny; ++y) {
»      a[x]y=0.0;
»      for (z=0; z<nz; ++z)
a[x]y+=b[x]z*c[z]y;
}
}
}
#define NX 2
#define NY 3
#define NZ 2
int main(){   ...
»  float a[NX][NY], b[NX][NZ]={{1,2},{3,4}},
c[NZ][NY]={{1,-1,-2},{2,-2,-3}};

»  matmul(NX, NY, NZ, a, b, c);
»  return 0;
}
```
Memory

132
133
134
135
c = 308
136
137
138
139
140
141
142
143
b = 268
a = 284
144
145
146
147
148
149
150
151
?
?
?
?
x = 134538298
152
153
154
155
156
157
158
159
y = -144480933
z = 2055650816
208
209
210
211
212
213
214
215
nx = 2
ny = 3
216
217
218
219
nz = 2

main()

268
269
270
271
b[0][0] = 1
272
273
274
275
276
277
278
279
b[0][1] = 2
b[1][0] = 3
280
281
282
283
284
285
286
287
b[1][1] = 4
a[0][0] = -4.60314e+33
288
289
290
291
292
293
294
295
a[0][1] = 2.01101e-33
a[0][2] = 3.99931e-34
296
297
298
299
300
301
302
303
a[1][0] = 3.99922e-34
a[1][1] = 1.4013e-45
304
305
306
307
308
309
310
311
a[1][2] = -nan
c[0][0] = 1
312
313
314
315
316
317
318
319
c[0][1] = -1
c[0][2] = -2
320
321
322
323
324
325
326
327
c[1][0] = 2
c[1][1] = -2
328
329
330
331
c[1][2] = -3

NB: the actual memory address of each variable is the