Muutke küpsiste eelistusi

E-raamat: Scientific Programming: C-Language, Algorithms and Models in Science [World Scientific e-raamat]

(Sapienza Univ Di Roma, Italy), (Sapienza Univ Di Roma, Italy), (Sapienza Universita Di Roma, Italy), (Sapienza Univ Di Roma, Italy)
  • Formaat: 720 pages
  • Ilmumisaeg: 18-Sep-2013
  • Kirjastus: World Scientific Publishing Co Pte Ltd
  • ISBN-13: 9789814513418
  • World Scientific e-raamat
  • Hind: 189,42 €*
  • * hind, mis tagab piiramatu üheaegsete kasutajate arvuga ligipääsu piiramatuks ajaks
  • Formaat: 720 pages
  • Ilmumisaeg: 18-Sep-2013
  • Kirjastus: World Scientific Publishing Co Pte Ltd
  • ISBN-13: 9789814513418
The book teaches a student to model a scientific problem and write a computer program in C language to solve that problem. To do that, the book first introduces the student to the basics of C language, dealing with all syntactical aspects, but without the pedantic content of a typical programming language manual. Then the book describes and discusses many algorithms commonly used in scientific applications (e.g. searching, graphs, statistics, equation solving, Monte Carlo methods etc.).This important book fills a gap in current available bibliography. There are many manuals for programming in C, but they never explain programming technicalities to solve a given problem. This book illustrates many relevant algorithms and shows how to translate them in a working computer program.
Preface xv
Foreword xvii
Technical note xxiii
0 Programming to compute
1(4)
Basic programming in C language
5(234)
1 Numbers and non-numbers
7(30)
1.1 Numeral systems
7(1)
1.2 Positional systems
8(8)
1.2.1 The binary system
10(3)
1.2.2 The hexadecimal system
13(3)
1.3 Representation systems
16(9)
1.3.1 Representing negative numbers
18(1)
1.3.2 Complement representation
19(2)
1.3.3 Excess-N representation
21(1)
1.3.4 Rational number representation
22(3)
1.4 The approximation problem
25(3)
1.5 Non-numbers on computers
28(1)
1.6 Logical value representation
28(3)
1.6.1 Logical operators
29(2)
1.7 Character representation
31(2)
1.7.1 Character strings
31(1)
1.7.2 The ASCII code
32(1)
1.7.3 UNICODE
33(1)
1.8 Representing other information
33(4)
2 Programming languages
37(28)
2.1 The necessity of a programming language
37(6)
2.2 High-level languages and elementary statements
43(2)
2.2.1 The assembly language
44(1)
2.3 The role of the compiler
45(4)
2.3.1 Interpreters and compilers
48(1)
2.4 The linker
49(3)
2.5 Procedural and object-oriented languages
52(3)
2.6 Why C?
55(2)
2.7 History and characteristics of the C language
57(1)
2.8 C compilers in their environment
58(7)
2.8.1 Linux and Windows
60(1)
2.8.2 A first example, in Linux: gcc
61(3)
2.8.3 Compiling C in Windows
64(1)
3 Basics of C programs
65(28)
3.1 Starting to program
66(1)
3.2 Statements, variables, types
67(4)
3.3 Operators
71(9)
3.3.1 Arithmetic Operators
71(6)
3.3.2 Logical operators
77(1)
3.3.3 Other operators
78(2)
3.4 Input/Output for beginners
80(4)
3.5 Preprocessor directives
84(3)
3.6 Notes on library functions
87(2)
3.7 First applications
89(4)
4 Logic management
93(30)
4.1 Flow control
94(3)
4.1.1 Nonlinear flows
96(1)
4.2 Taking a decision
97(5)
4.2.1 if/else
99(3)
4.2.2 The selection operator
102(1)
4.3 Iterations
102(12)
4.3.1 The factorial
108(1)
4.3.2 Solving equations
109(4)
4.3.3 Searching prime numbers
113(1)
4.4 Deprecated statements
114(2)
4.5 A rounding problem
116(7)
5 Fundamental data structures
123(26)
5.1 One-dimensional arrays
124(2)
5.2 Algorithms with arrays
126(6)
5.2.1 Sorting: Bubblesort
128(2)
5.2.2 Binary search
130(2)
5.3 Multidimensional arrays
132(1)
5.4 Solving systems of linear equations
133(4)
5.5 Generating random numbers
137(3)
5.6 Character strings
140(9)
5.6.1 C string syntax
140(1)
5.6.2 I/O of character strings
141(2)
5.6.3 Multidimensional strings and arrays
143(6)
6 Pointers
149(28)
6.1 Pointers and pointed variables
149(4)
6.2 Arrays and pointers in C
153(6)
6.2.1 The const qualifier
156(2)
6.2.2 String pointers
158(1)
6.3 Pointer arithmetic
159(3)
6.4 Efficiency issues
162(1)
6.5 Multidimensional arrays and pointers
163(4)
6.5.1 Pointer arrays
165(2)
6.6 Pointers to pointers
167(1)
6.7 Input/Output with files
168(9)
6.7.1 Binary files
174(3)
7 Functions
177(34)
7.1 Declaration and definition
177(7)
7.1.1 Scope
182(2)
7.2 Formal parameters
184(5)
7.3 Pointers and array parameters
189(9)
7.3.1 Array in input and output
190(4)
7.3.2 Passing multidimensional arrays
194(3)
7.3.3 Global and local variables
197(1)
7.4 Applications
198(8)
7.4.1 Histograms
198(5)
7.4.2 Computing the x2 of a distribution
203(2)
7.4.3 Programming style and reusability
205(1)
7.5 Pointers to functions
206(1)
7.6 Functions of functions
207(4)
8 Numerical interpolation and integration
211(28)
8.1 Interpolation
211(10)
8.1.1 Determining the parameters of a function
213(4)
8.1.2 Interpolation with Lagrange polynomials
217(4)
8.2 Numerical integration
221(13)
8.2.1 The rectangle rule
223(2)
8.2.2 The midpoint method
225(1)
8.2.3 The trapezoid rule
226(3)
8.2.4 Other integration methods
229(5)
8.3 The Monte Carlo method
234(5)
8.3.1 Multiple integrals
236(3)
Advanced programming and simple algorithms
239(194)
9 Integrating differential equations
241(30)
9.1 The harmonic oscillator
241(3)
9.2 Integration algorithms
244(15)
9.2.1 Euler and Euler-Cromer: convergence and stability
246(6)
9.2.2 Other methods: midpoint and leapfrog
252(2)
9.2.3 Physical results of a simple integration
254(5)
9.3 The struct
259(3)
9.4 A complete program as a simple example
262(9)
10 In-depth examination of differential equations
271(30)
10.1 More algorithms
271(8)
10.1.1 Verlet and velocity Verlet
272(2)
10.1.2 Predictor-corrector and Runge-Kutta
274(2)
10.1.3 Stability analysis
276(3)
10.2 system, malloc and typedef
279(7)
10.2.1 The interaction with the operating system: the function system
279(1)
10.2.2 Dynamic memory allocation: malloc and calloc
280(5)
10.2.3 Defining derived types: typedef
285(1)
10.3 The simple pendulum
286(3)
10.4 Two planets revolving around the sun
289(3)
10.5 Software tools: gnuplot
292(2)
10.6 A falling body
294(2)
10.7 The pendulum and chaos
296(5)
11 (Pseudo)random numbers
301(32)
11.1 Generating random sequences
302(2)
11.2 Linear congruence
304(9)
11.2.1 Choosing the modulo
308(1)
11.2.2 Choosing the multiplier
309(2)
11.2.3 Purely multiplicative generators
311(2)
11.3 Some examples of generators and a first test
313(3)
11.4 Statistical tests
316(9)
11.4.1 x2 test
317(5)
11.4.2 The Kolmogorov-Smirnov test
322(3)
11.5 Shift registers
325(5)
11.6 Generating nonuniform distributions
330(3)
12 Random walks
333(36)
12.1 A first simple crucial argument
334(7)
12.2 More than one dimension: the generating function
341(12)
12.3 A lattice gas
353(11)
12.4 Random walks in random environments
364(5)
13 Lists, dictionaries and percolation
369(36)
13.1 The union
369(5)
13.1.1 A virtual experiment
372(2)
13.2 Linked lists
374(14)
13.2.1 Lists, strings and a dictionary
375(7)
13.2.2 Recursive functions: computing the factorial
382(1)
13.2.3 Binary trees and dictionaries
383(5)
13.3 Connected clusters
388(5)
13.4 Percolation
393(7)
13.5 An algorithm based on lists
400(5)
14 Bits and Boolean variables
405(28)
14.1 Single bit operators
405(5)
14.2 How to operate on bits
410(3)
14.3 A small multiple adder of bits
413(3)
14.4 Von Neumann and Ulam cellular automatons
416(10)
14.5 The game of life
426(7)
Programming advanced algorithms
433(232)
15 Recursion and data sorting
435(34)
15.1 Analysis of the performance of an algorithm
436(5)
15.2 A first sorting algorithm: Insertion sort
441(8)
15.2.1 Insertion sort analysis
444(1)
15.2.2 Improving Insertion sort
445(2)
15.2.3 Estimating the execution times
447(2)
15.3 The recursive "Divide and Conquer" strategy
449(20)
15.3.1 The recursive logic
451(1)
15.3.2 A recursive algorithm: Quicksort
452(4)
15.3.3 Representations of a recursive process
456(2)
15.3.4 How to write a good recursive function
458(3)
15.3.5 Quicksort analysis
461(8)
16 Dynamic data structures
469(32)
16.1 Linear structures
470(7)
16.1.1 Queues and stacks
473(2)
16.1.2 Linked lists
475(2)
16.2 Priority queues
477(12)
16.2.1 Heaps
477(3)
16.2.2 Building a heap
480(2)
16.2.3 Maintaining a heap
482(5)
16.2.4 Sorting with a heap: Heapsort
487(2)
16.3 Elementary search methods
489(12)
16.3.1 Binary search trees
489(3)
16.3.2 Inserting and searching in a binary search tree
492(4)
16.3.3 Deleting elements from a binary search tree
496(5)
17 Graphs and graph algorithms
501(38)
17.1 Graph definition and its main properties
502(5)
17.2 From graphs to data structures
507(4)
17.2.1 Adjacency matrix
508(1)
17.2.2 Adjacency lists
509(2)
17.3 Graph algorithms
511(10)
17.3.1 Searching a graph
511(4)
17.3.2 Minimum spanning tree
515(6)
17.4 Percolation again
521(6)
17.4.1 Random graphs
522(2)
17.4.2 Percolation in random graphs
524(3)
17.5 Numerical percolation study
527(12)
17.5.1 What, how, how often and when to measure
531(2)
17.5.2 Numerical data analysis: finite size effects
533(6)
18 Optimization methods
539(40)
18.1 Functions of a single variable
540(6)
18.2 Minimizing functions of more variables
546(13)
18.2.1 Sequential descent rule
547(1)
18.2.2 The gradient method
548(5)
18.2.3 Functions with a variable number of arguments
553(3)
18.2.4 Conjugate gradient method
556(3)
18.3 Linear programming
559(9)
18.3.1 Definition of the canonical problem
560(1)
18.3.2 The simplex method
561(6)
18.3.3 The simplex method in practice
567(1)
18.4 Optimization with discrete variables
568(11)
18.4.1 Satisfability problems
569(1)
18.4.2 Exhaustive enumeration
570(3)
18.4.3 A search by construction
573(6)
19 The Monte Carlo method
579(42)
19.1 Numeric integration with the Monte Carlo method
580(5)
19.1.1 Multidimensional integration
581(1)
19.1.2 Uniform sampling
582(2)
19.1.3 Importance sampling
584(1)
19.2 The Markov chain Monte Carlo method
585(17)
19.2.1 Markov chains
586(4)
19.2.2 Convergence towards the asymptotic distribution
590(4)
19.2.3 Detailed balance
594(2)
19.2.4 The Metropolis algorithm
596(3)
19.2.5 Barriers ad ergodicity breaking
599(3)
19.3 The Ising model
602(6)
19.4 Code optimization
608(13)
19.4.1 Use of look-up tables
610(1)
19.4.2 Update in random or sequential order
611(2)
19.4.3 Optimizing the memory accesses
613(3)
19.4.4 Optimizing the sequence of statements
616(5)
20 How to use stochastic algorithms
621(44)
20.1 Examples where Monte Carlo methods are needed
621(4)
20.2 How to run a good Monte Carlo simulation
625(12)
20.2.1 Convergence towards equilibrium
627(4)
20.2.2 Correlations at equilibrium
631(4)
20.2.3 How to identify a phase transition
635(2)
20.3 Data analysis
637(15)
20.3.1 Block averages
638(4)
20.3.2 Jackknife
642(3)
20.3.3 Scaling laws and critical exponents
645(4)
20.3.4 Finite size effects and rescaling
649(3)
20.4 Optimization with stochastic methods
652(13)
20.4.1 Genetic algorithms
653(7)
20.4.2 The simulated annealing method
660(5)
A The main C statements 665(6)
B The ASCII codes 671(2)
Bibliography 673(4)
Index 677