17.11.2012 Views

Numerical recipes

Numerical recipes

Numerical recipes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(a)<br />

**m<br />

(b)<br />

**m<br />

1.2 Some C Conventions for Scientific Computing 21<br />

*m[0]<br />

*m[1]<br />

*m[2]<br />

[0][0] [0][1] [0][2] [0][3] [0][4]<br />

[1][0] [1][1] [1][2] [1][3] [1][4]<br />

[2][0] [2][1] [2][2] [2][3] [2][4]<br />

[0][0] [0][1] [0][2] [0][3] [0][4]<br />

[1][0] [1][1] [1][2] [1][3] [1][4]<br />

[2][0] [2][1] [2][2] [2][3] [2][4]<br />

Figure 1.2.1. Two storage schemes for a matrix m. Dotted lines denote address reference, while solid<br />

lines connect sequential memory locations. (a) Pointer to a fixed size two-dimensional array. (b) Pointer<br />

to an array of pointers to rows; this is the scheme adopted in this book.<br />

float a[13][9],**aa;<br />

int i;<br />

aa=(float **) malloc((unsigned) 13*sizeof(float*));<br />

for(i=0;i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!