Professional Documents
Culture Documents
CAMBRIDGE
UNIVERSITY PRESS
Contents
page l
3
3
3
4
6
7
7
8
8
10
10
12
13
14
15
16
16
17
17
18
20
23
23
4 Fundamental concepts
4.1 Overview of program structure
4.2 Tokens, names, and keywords
4.3 Expressions and statements
4.4 Constants, variables, and identifiers
4.5 Declarations, definitions, and scope
25
25
25
26
26
27
VII
viii
Contents
4.6
4.7
4.8
4.9
4.10
4.11
4.12
28
28
29
30
31
32
33
37
37
37
38
39
40
41
44
45
46
47
47
48
51
53
55
62
62
65
66
66
67
68
71
72
74
75
78
79
83
83
83
86
Contents
87
89
91
92
94
95
104
104
106
107
108
109
109
110
111
112
112
119
119
121
121
122
124
128
130
130
131
132
132
133
134
134
140
140
141
142
144
145
146
146
Contents
147
150
150
158
158
161
163
165
167
167
173
175
175
177
177
179
179
180
182
13 Integration
13.1 Discretization procedures
13.2 Implementation
13.3 Discretization error
13.4 Assignments
183
183
184
188
189
14 Root-finding procedures
14.1 Bisection method
14.2 Newton's method
14.3 Assignments
191
191
193
194
15 Differential equations
15.1 Euler's method
15.2 Error analysis
15.3 The spring class
15.4 Assignments
196
196
198
199
201
16 Linear algebra
16.1 Linear equation solvers
203
203
Contents
206
207
209
215
17 References
17.1 Basic properties
17.2 References as function arguments
17.3 Reference member variables
17.4 const reference variables
17.5 Reference return values
17.6 Assignments
217
217
218
219
220
221
222
227
228
228
229
230
230
231
232
232
234
234
234
235
235
237
239
241
242
243
244
248
261
261
262
263
265
XI
xii
Contents
19.5
19.6
19.7
Assignment operators
Copy constructors
Assignments
267
269
271
286
286
287
288
288
289
291
292
293
294
295
296
298
299
303
305
306
319
319
319
321
326
327
327
329
Part IV
331
333
333
334
339
343
347
352
Contents
354
354
356
359
363
Appendix A
365
Overview of
MATLAB
371
371
373
375
377
378
379
380
381
Appendix D
384
387
387
388
388
389
389
389
390
390
390
391
391
391
391
393
Index
398
XIII