C++ and Object-Oriented Numeric Computing for Scientists and Engineers

Front Cover
Springer Science & Business Media, Oct 23, 2000 - Computers - 440 pages
This book is intended to be an easy, concise, but rather complete, introduc the ISO/ANSI C++ programming language with special empha tion to sis on object-oriented numeric computation for students and professionals in science and engineering. The description of the language is platform independent. Thus it applies to different operating systems such as UNIX, Linux, MacOS, Windows, and DOS, as long as a standard C++ compiler is equipped. The prerequisite of this book is elementary knowledge of cal culus and linear algebra. However, this prerequisite is hardly necessary if this book is going to be used as a textbook for teaching C++ and all the sections on numeric methods are skipped. Programming experience in an other language such as FORTRAN, C, Ada, Pascal, Maple, or Matlab will certainly help, but is not presumed. All C++ features are introduced in an easy way through concepts such as functions, complex numbers, vectors, matrices, and integrals, which are familiar to every student and professional in science and engineering. In the final chapter, advanced features that are not found in FORTRAN, C, Ada, or Matlab, are illustrated in the context of iterative algorithms for linear systems such as the preconditioned conjugate gradient (CG) method and generalized minimum residual (GMRES) method. Knowledge of CG, GMRES, and preconditioning techniques is not presumed and they are ex plained in detail at the algorithmic level.
 

What people are saying - Write a review

We haven't found any reviews in the usual places.

Contents

Basic Types
1
12 Types and Declarations
6
13 Basic Types
8
132 Character Types
10
133 Floating Point Types
11
134 The Boolean Type
14
14 Numeric Limits
15
15 Identifiers and Keywords
19
61 Complex Numbers
204
611 Initialization
206
613 Conversions and MixedMode Operations
207
63 Vectors and Matrices
211
64 Explicit and Implicit Conversions
220
65 Efficiency and Operator Overloading
223
66 Conjugate Gradient Algorithm
226
67 Exercises
229

152 Keywords
20
16 Exercises
21
Expressions and Statements
25
211 Local and Global Variables
26
212 External and Register Variables
27
22 Expressions
28
222 Relational Expressions
29
223 Logical Expressions
30
224 Bitwise Expressions
31
225 Comma Expressions
33
231 Declarations and Initializations
34
232 Assignments
35
234 Increments and Decrements
36
236 Conditional Statements
37
237 Iteration Statements
41
24 Fibonacci Numbers
44
25 Exercises
47
Derived Types
51
32 Enumerations
52
33 Arrays
54
34 Structures
57
36 Pointers
60
361 Pointer Arithmetic
64
363 Offsetting Pointers
67
364 Constant Pointers
68
365 Void and Null Pointers
70
367 Pointers to Char
72
38 Functions
73
382 Function Overloading
74
383 Argument Passing
75
384 Return Values
79
385 Recursive Functions
81
387 Default Arguments
82
388 Function Types
83
389 Static Local Variables
84
3810 The Function main
85
39 Program Execution
86
310 Operator Summary and Precedence
88
311 Standard Library on Mathematical Functions
92
312 Polynomial Evaluation
94
313 Trapezoidal and Simpsons Rules
98
314 Exercises
101
Namespaces and Files
113
411 Using Declarations and Directives
117
412 Multiple Interfaces
119
413 Namespace Alias
120
414 Unnamed Namespaces
121
42 Include Files
122
422 Users Own Include Files
124
423 Conditional Include Directives The directive
126
424 File Inclusion
128
43 Source Files and Linkages
129
433 Linkage to Other Languages
133
44 Some Useful Tools
134
442 Compilation Options and Debuggers
136
443 Creating a Library
138
444 Makefile
139
45 Standard Library on Strings
142
452 Operations
143
453 CStyle Strings
144
455 C Library on Strings
145
46 Standard Library on Streams
146
462 Formatted Floating Point Output
148
463 Output Width
149
464 Input and Output Files
150
465 Input and Output of Characters
153
466 String Streams
157
47 Iterative Methods for Nonlinear Equations
158
471 Bisection Method
159
472 Newtons Method
165
48 Exercises
167
Classes
173
52 Copy Constructors and Copy Assignments
180
53 Friends
184
54 Static Members
185
55 Constant and Mutable Members
187
56 Class Objects as Members
189
57 Array of Classes
191
58 Pointers to Members
193
59 Numeric Methods for Ordinary Differential Equations
194
510 Exercises
199
Operator Overloading
203
Templates
231
711 Member and Friend Definitions
233
712 Template Instantiation
234
713 Template Parameters
235
716 Order of Specializations
239
72 Function Templates
240
721 Function Template Parameters
241
722 Function Template Overloading
242
723 Specializations
243
724 Class Templates as Function Template Parameters
245
725 Member Function Templates
246
726 Friend Function Templates
247
73 Template Source Code Organization
248
74 Standard Library on Complex Numbers
250
75 Standard Library on valarrays
251
751 The Type valarray
252
752 Slice Arrays
253
755 Generalized Slice Arrays
256
754 Mask Arrays and Indirect Arrays
257
76 Standard Library on Numeric Algorithms
258
761 Accumulate
259
762 Inner Products
262
763 Partial Sums
263
77 Efficient Techniques for Numeric Integration
264
772 Function Pointer as Template Parameter
265
773 Using Dot Products and Expression Templates
266
774 Using Dot Products and Template Metaprograms
270
78 Polynomial Interpolation
273
782 Newton Form
275
79 Exercises
279
Class Inheritance
283
811 Member Functions
286
813 Copying
287
815 Virtual Functions
288
816 Virtual Destructors
289
82 Abstract Classes
291
83 Access Control
296
832 Access to Base Classes
297
84 Multiple Inheritance
300
841 Ambiguity Resolution
301
842 Replicated Base Classes
302
843 Virtual Base Classes
303
844 Access Control in Multiple Inheritance
304
85 RunTime Type Information
305
851 The dynamiccast Mechanism
306
852 The typeid Mechanism
308
853 RunTime Overhead
309
87 Exercises
316
Exception Handling
319
92 Deriving Exceptions
323
93 Catching Exceptions
325
931 Rethrow
326
933 Order of Handlers
327
95 Standard Exceptions
329
96 Exercises
331
Standard Libraries on Containers and Algorithms
333
1011 Vector
334
1012 List
341
1013 Map and Set
344
1014 Stack and Queue
347
102 Standard Algorithms
348
1022 Searching and Traversing Algorithms
355
1023 Set Permutation and Heap Algorithms
360
103 Standard Function Objects and Adaptors
365
1032 Relational Function Objects
366
1034 Standard Adaptors
367
104 Exercises
368
Linear System Solvers
371
111 Matrix Storage Formats
372
1113 Sparse Matrices
374
112 A Class Hierarchy for Matrices
375
113 Iterative Algorithms
385
1132 Generalized Minimum Residual Method
390
1133 Preconditioning Techniques
398
114 Gauss Elimination
401
1142 Gauss Elimination Without Pivoting
406
1143 Gauss Elimination with Pivoting
408
115 Finite Difference Method for Partial Differential Equations
414
116 Exercises
424
References
427
Index
430
Copyright

Other editions - View all

Common terms and phrases

Popular passages

Page 427 - TH Gormen, CE Leiserson, and RL Rivest, Introduction to Algorithms, McGraw-Hill, New York, NY, 1990.

Bibliographic information