Quick query of C language Algorithms

Source: Internet
Author: User

 

 

Chapter 1 Introduction 1
1.1 programming language Overview 1
1.1.1 machine language 1
1.1.2 assembly language 2
1.1.3 advanced language 2
1.1.4 C language 3
1.2 Advantages and Disadvantages of C language 4
1.2.1 advantages of C language 4
1.2.2 disadvantages of C language 6
1.3 algorithm OVERVIEW 7
1.3.1 basic features of the algorithm 7
1.3.2 algorithm complexity 8
1.3.3 algorithm accuracy 10
1.3.4 algorithm stability 14

Chapter 2 complex operations 18
2.1 arithmetic operation of the four operators in the plural number 18
2.1.1 [algorithm 1] multiplication of plural numbers 18
2.1.2 [algorithm 2] plural division 20
2.1.3 four arithmetic operations of the number of instance 5: 22
2.2 Common Function operations for plural numbers 23
2.2.1 [algorithm 3] multiplication of the plural number 23
2.2.2 [algorithm 4] The N-power root of the plural number 25
2.2.3 [algorithm 5] plural index 27
2.2.4 [algorithm 6] plural logarithm 29
2.2.5 [algorithm 7] plural sine 30
2.2.6 [algorithm 8] plural cosine 32
2.2.7 [instance 6] function operation of the plural number 34

Chapter 2 polynomial computation 37
3.1 polynomial Representation Method 37
3.1.1 coefficient representation 37
3.1.2 point representation 38
3.1.3 [algorithm 9] coefficient representation converted to point representation 38
3.1.4 [algorithm 10] point representation converted to coefficient representation 42
3.1.5 [Example 7] conversion of coefficient notation and dot notation 46
3.2 polynomial operation 47
3.2.1 [algorithm 11] complex polynomial multiplication 47
3.2.2 [algorithm 12] multiplication of real-system number polynomials 50
3.2.3 [algorithm 13] complex polynomial division 52
3.2.4 [algorithm 14] division of real-system number polynomials 54
3.2.5 [instance 8] multiplication and division of complex polynomial 56
3.2.6 [instance 9] multiplication and division of real-system number polynomials 57
3.3 polynomial evaluation 59
3.3.1 [algorithm 15] mona1 polynomial evaluation 59
3.3.2 [algorithm 16] multiple groups of Polynomial evaluate 60
3.3.3 [algorithm 17] binary polynomial evaluation value 63
3.3.4 [instance 10] 1-dimensional polynomial evaluation value 65
3.3.5 [instance 11] binary polynomial evaluation value 66

Chapter 1 matrix computing 68
4.1 matrix multiplication 68
4.1.1 [algorithm 18] multiplication of real matrices 68
4.1.2 [algorithm 19] multiplication of complex matrices by 70
4.1.3 [Example 12] multiplication of real and complex matrices 72
4.2 rank and determinant value of the matrix 73
4.2.1 [algorithm 20] calculate the rank 73 of the matrix
4.2.2 [algorithm 21] finding the maximum value of a general matrix 76
4.2.3 [algorithm 22] finding the maximum value of the symmetric positive definite matrix 80
4.2.4 [instance 13] calculate the rank and determinant value of the matrix 82
4.3 matrix inverse 84
4.3.1 [algorithm 23] finding the inverse 84 of A General Complex Matrix
4.3.2 [algorithm 24] calculate the inverse 90 of symmetric positive definite matrix
4.3.3 [algorithm 25] trench method 92 for finding the inverse of the toberlitz Matrix
4.3.4 [example 14] verifying the inverse algorithm of the matrix 97
4.3.5 [Example 15] verifying the T matrix inverse algorithm 99
4.4 matrix decomposition and similarity transformation 102
4.4.1 [algorithm 26] LDL decomposition of real symmetric matrix 102
4.4.2 [algorithm 27] Cholesky Decomposition of symmetric positive definite matrix 104
4.4.3 [algorithm 28] General real matrix all-selected Principal Component Lu decomposition 107
4.4.4 [algorithm 29] Normal real matrix QR decomposition 112
4.4.5 [algorithm 30] symmetric Real Matrix Similarity Transformation to symmetric tridiagonal matrix 116
4.4.6 [algorithm 31] General Real Matrix Similarity Transformation to Hessen-burg matrix 121
4.4.7 [instance 16] perform QR decomposition on the general real matrix by 126
4.4.8 [instance 17] 127 similarity transformation of Symmetric Matrices
4.4.9 [instance 18] General Real Matrix Similarity Transformation 129
4.5 Calculation of matrix feature values 130
4.5.1 [algorithm 32] obtaining the QR method of all feature values of Hessen-burg matrix 130
4.5.2 [algorithm 33] evaluate all feature values of symmetric three diagonal arrays 137
4.5.3 [algorithm 34] Find the feature value of the symmetric matrix using the yaolun method 143
4.5.4 [algorithm 35] obtaining the feature value of the symmetric matrix using the KNN pass method 147
4.5.5 [instance 19] calculate Hessen-burg matrix feature value 151
4.5.6 [instance 20] calculate the feature value 152 of the symmetric matrix using the two jacks method respectively

Chapter 1 solving linear algebra equations 5th
5.1 Gaussian elimination method 154
5.1.1 [algorithm 36] algorithm for solving the complex coefficient equations using the all-selected Principal Component Gaussian elimination method 155
5.1.2 [algorithm 37] Completely selected Principal Component Gaussian elimination method for solving real system number equations 160
5.1.3 [algorithm 38] algorithm for solving the complex coefficient equations using the fully-selected Principal Component Gaussian-appointment elimination method 163
5.1.4 [algorithm 39] algorithm for solving real-system number equations using the fully-selected Principal Component Gaussian-appointment elimination method 168
5.1.5 [algorithm 40] Gaussian-appointment elimination method for solving large-scale Sparse Coefficient Matrix Equations 171
5.1.6 [algorithm 41] Catch-up method for solving the Three-diagonal line equations 174
5.1.7 [algorithm 42] Method for Solving Equations with a model 176
5.1.8 [instance 21] Solving Linear real-system number equations 179
5.1.9 [instance 22] solving linear coefficient equations 180
5.1.10 [instance 23] solutions to three-diagonal line equations 182
5.2 matrix decomposition method 184
5.2.1 [algorithm 43] LDL Decomposition Method for Solving symmetric equations 184
5.2.2 [algorithm 44] Cholesky Decomposition Method for Solving symmetric positive definite equations 186
5.2.3 [algorithm 45] QR Decomposition Method for Solving Linear Least Square problem 188
5.2.4 [instance 24] solving symmetric positive definite equations 191
5.2.5 [instance 25] Solving Linear Least Square problem 192
5.3 iteration method 193
5.3.1 [algorithm 46] solution to pathological equations 193
5.3.2 [algorithm 47] Yaki iteration method 197
5.3.3 [algorithm 48] Gaussian-seader Iteration Method 200
5.3.4 [algorithm 49] Over-relaxation method 203
5.3.5 [algorithm 50] How to Solve Symmetric Definite definite equations using the method of the bounded gradient 205
5.3.6 [algorithm 51] levensun Method for Solving the toberlitz equations 209
5.3.7 [instance 26] solutions to pathological equations 214
5.3.8 [instance 27] solving equations by iterative method 215
5.3.9 [instance 28] solving the Tober-litz equations 217

Chapter 2 solutions to nonlinear equations and equations 6th
6.1 root process of nonlinear equations 219
6.1.1 determine the initial approximate value of the real root of the nonlinear equation or the Inter-zone 219 of the root
6.1.2 exact solution to the root of the nonlinear equation 221
6.2 method for finding a real root of nonlinear equations 221
6.2.1 [algorithm 52] division method 221
6.2.2 [algorithm 53] Newton method 223
6.2.3 [algorithms 54] interpolation method 226
6.2.4 [algorithm 55] eterkin iteration 229
6.2.5 [instance 29] calculate the real root of the nonlinear equations by using the method 232
6.2.6 [instance 30] using the Newton method to obtain the solid root 233 of the Nonlinear Equations
6.2.7 [instance 31] Use interpolation to obtain the real root 235 of the Nonlinear Equations
6.2.8 [instance 32] using the eterkin iteration method to obtain the real root of the nonlinear equations 237
6.3 Method for Finding All root of a coefficient polynomial equation 238
6.3.1 [algorithm 56] The QR method 238
6.3.2 [instance 33] solving all the root 240 of Polynomial using the QR method
6.4 method for finding a set of solid roots of nonlinear equations 241
6.4.1 [algorithm 57] gradient method 241
6.4.2 [algorithm 58] quasi-Newton method 244
6.4.3 [Example 34] using gradient method to calculate a set of solid roots of nonlinear equations 250
6.4.4 [instance 35] A set of solid roots 252 for the calculation of nonlinear equations using the quasi-Newton Method

Chapter 2 algebraic interpolation 7th
7.1 Laplace interpolation method 254
7.1.1 [algorithm 59] linear interpolation 255
7.1.2 [algorithm 60] quadratic parabolic interpolation 256
7.1.3 [algorithm 61] intra-region interpolation 259
7.1.4 [instance 36] Laplace interpolation 262
7.2 hermit interpolation 263
7.2.1 [algorithm 62] elmit unequal distance interpolation 263
7.2.2 [algorithm 63] hermit offset interpolation 267
7.2.3 [Example 37] hermit interpolation method 270
7.3 Etkin step-by-step interpolation 271
7.3.1 [algorithm 64] Etkin unequal distance interpolation 272
7.3.2 [algorithm 65] Etkin offset interpolation 275
7.3.3 [instance 38] Etkin interpolation 278
7.4 smooth interpolation 279
7.4.1 [algorithm 66] Smooth and unequal distance interpolation 279
7.4.2 [algorithm 67] Smooth and offset interpolation 283
7.4.3 [instance 39] smooth interpolation 286
7.5 cubic spline interpolation 287
7.5.1 [algorithm 68] Cubic Spline Interpolation of first-class boundary conditions 287
7.5.2 [algorithm 69] cubic spline interpolation of the second type of boundary conditions 292
7.5.3 [algorithm 70] cubic spline interpolation for the third-class boundary condition 296
7.5.4 [instance 40] spline interpolation method 301
7.6 fractional interpolation 303
7.6.1 [algorithm 71] fractional interpolation 304
7.6.2 [instance 41] Verify the continuous fractional interpolation function 308.

Chapter 2 Numerical Integration Method 8th
8.1 incremental step calculation method 310
8.1.1 [algorithm 72] Step-changing trapezoid product method 310
8.1.2 [algorithm 73] adaptive ladder product method 313
8.1.3 [algorithm 74] Variable Step-by-Step xinbu generative product method 316
8.1.4 [algorithm 75] method of changing the step-by-step xinbu Sheng dual-integral 318
8.1.5 [algorithm 76] longberger points 322
8.1.6 [instance 42] incremental integration method for one-key-point calculation 325
8.1.7 [instance 43] Variable Step-by-Step xinbu Sheng Integral Method for dual point 326
8.2 Gaussian product method 328
8.2.1 [algorithm 77] lepead-Gaussian product method 328
8.2.2 [algorithm 78] cherbixuefu product calculation method 331
8.2.3 [algorithm 79] lagel-Gaussian product calculation method 334
8.2.4 [algorithm 80] hermit-Gaussian product calculation method 336
8.2.5 [algorithm 81] adaptive Gaussian product method 337
8.2.6 [instance 44] finite interval Gaussian product method 342
8.2.7 [instance 45] Gaussian Product Method in semi-infinite interval 343
8.2.8 [instance 46] Gaussian product method 345 in an infinite interval
8.3 continued fraction method 346
8.3.1 [algorithm 82] Method for Calculating the continuous fraction of a key point 346
8.3.2 [algorithm 83] Method for Calculating the dual-point continuous fraction 350
8.3.3 [instance 47] perform a one-key-point 354 using the fractional Addition Method
8.3.4 [instance 48] dual integral 355 using the fractional Addition Method
8.4 Monte Carlo method 356
8.4.1 [algorithm 84] Monte Carlo Method for an integral of 356
8.4.2 [algorithm 85] Monte Carlo Method for dual integral 358
8.4.3 [instance 49] Monte Carlo Method for one integral 360
8.4.4 [instance 50] Monte Carlo Method of dual point 361

Chapter 1 solving the initial value problem of ordinary differential equations (groups) 9th
9.1 Euler's method 364
9.1.1 [algorithm 86] fixed step Euler's method 364
9.1.2 [algorithm 87] variable-step Euler's method 366
9.1.3 [algorithm 88] improved Euler's method 370
9.1.4 [Example 51] Euler's method for finding the numerical solution of ordinary differential equations 372
9.2 longge-Kuta method 376
9.2.1 [algorithm 89] fixed step long Ge-Kuta method 376
9.2.2 [algorithm 90] variable step long-box-Kuta method 379
9.2.3 [algorithm 91] Variable Step kill method 383
9.2.4 [instance 52] Initial Value Problem of the constant differential equation obtained by the long Lattice-Kuta method 386
9.3 linear multi-step method 390
9.3.1 [algorithm 92] allenames Prediction Correction Method 390
9.3.2 [algorithm 93] Hamming method 394
9.3.3 [algorithm 94] bilateral method of intra-region integration 399
9.3.4 [instance 53] Initial Value Problem of ordinary differential equations obtained by linear multi-step method 401

Chapter 1 fitting and approximation 10th
10.1 one-dimensional polynomial fitting 405
10.1.1 [algorithm 95] least squares fit 405
10.1.2 [algorithm 96] The best consistent approximation of the limiz method 412
10.1.3 [instance 54] One-dimensional polynomials fit 417
10.2 rectangular area curved surface fitting 419
10.2.1 [algorithm 97] fitting a rectangular area least square surface 419
10.2.2 [instance 55] binary polynomials fit 428

Chapter 2 special functions 11th
11.1 continuous fraction series and exponential integral 430
11.1.1 [algorithm 98] calculation of the continuous fraction level 430
11.1.2 [algorithm 99] index points 433
11.1.3 [instance 56] returns the continuous fraction level of 436.
11.1.4 [instance 57] exponential points evaluate 438
11.2 Gamma function 439
11.2.1 [algorithm 100] Gamma function 439
11.2.2 [algorithm 101] beta function 441
11.2.3 [algorithm 102] factorial 442
11.2.4 [instance 58] calculate the gamma and beta functions by 443
11.2.5 [instance 59] factorial value: 444
11.3 incomplete Gamma functions 445
11.3.1 [algorithm 103] incomplete Gamma function 445
11.3.2 [algorithm 104] Error Function 448
11.3.3 [algorithm 105] Chi-square distribution function 450
11.3.4 [instance 60] incomplete Gamma function evaluate 451
11.3.5 [instance 61] Error Function evaluate 452
11.3.6 [instance 62] the chi-square distribution function evaluates to 453.
11.4 incomplete beta function 454
11.4.1 [algorithm 106] Incomplete beta function 454
11.4.2 [algorithm 107] Student distribution function 457
11.4.3 [algorithm 108] cumulative binary Distribution Function 458
11.4.4 [instance 63] Incomplete beta function evaluate 459
11.5 besell function 461
11.5.1 [algorithm 109] first-class integer-level besell function 461
11.5.2 [algorithm 110] second-class integer-level besell function 466
11.5.3 [algorithm 111] variants of the first-class integer-level besell function 469
11.5.4 [algorithm 112] variant second-class integer-level besell function 473
11.5.5 [instance 64] evaluate the besell function by 476
11.5.6 [instance 65] evaluate the modified besell function by 477
11.6 Carlson elliptical points 479
11.6.1 [algorithm 113] First Class elliptical integral 479
11.6.2 [algorithm 114] degradation form of first class elliptical integral 481
11.6.3 [algorithm 115] Class 2 elliptical integral 483
11.6.4 [algorithm 116] Third Class elliptical integral 486
11.6.5 [instance 66] evaluate the integral value of the first-class leap elliptic function by 490
11.6.6 [instance 67] evaluate the integral value of the second type lepead elliptic function by 492

Chapter 1 Extreme Value Problem 12th
12.1 one-dimensional Extreme Value Solution Method 494
12.1.1 [algorithm 117] determine the interval of the minimum vertex 494
12.1.2 [algorithm 118] One-dimensional golden segmentation search 499
12.1.3 [algorithm 119] One-dimensional Brent method 502
12.1.4 [algorithm 120] Brent method using first derivative 506
12.1.5 [instance 68] calculate the Extreme Value 511 using the golden segmentation Search Method
12.1.6 [instance 69] use the Brent method to obtain an extreme value of 513.
12.1.7 [instance 70] use the Brent method with derivative to obtain the maximum value of 515
12.2 evaluate the Extreme Value of a multivariate function: 517
12.2.1 [algorithm 121] One-dimensional search without derivative 517
12.2.2 [algorithm 122] One-dimensional search for derivatives 519
12.2.3 [algorithm 123] powell method 522
12.2.4 [algorithm 124] gradient method 525
12.2.5 [algorithm 125] quasi-Newton method 531
12.2.6 [instance 71] verification of one-dimensional search without derivative 536
12.2.7 [instance 72] calculate the Extreme Value 537 using the Powell algorithm
12.2.8 [instance 73] calculate the Extreme Value 539 using the Gradient Method
12.2.9 [instance 74] use quasi-Newton method to calculate the Extreme Value 540
12.3 simple form method 542
12.3.1 [algorithm 126] Simple Method for Finding n-dimensional extreme values without constraints 542
12.3.2 [algorithm 127] Simple Method for Finding the n-dimensional extreme values under Constraints 548
12.3.3 [algorithm 128] Simple Method for Solving Linear Programming Problems 556
12.3.4 [instance 75] An Extreme Value of 568 in n-dimensional networks without constraints is obtained using the simple form method.
12.3.5 [instance 76] An Extreme Value of 569 in n-dimension under constraints is obtained by the simple form method.
12.3.6 [instance 77] Solving Linear Programming Problem 571

Chapter 2 random number generation and statistical description 13th
13.1 evenly distributed random sequence 574
13.1.1 [algorithm 129] generates a random number 574 evenly distributed between 0 and 1.
13.1.2 [algorithm 130] generates a random number sequence of 576 evenly distributed between 0 and 1
13.1.3 [algorithm 131] generates a random integer of 577 with an even distribution in any interval
13.1.4 [algorithm 132] generates a random integer sequence of 578 evenly distributed in any interval
13.1.5 [instance 78] generates a random number sequence of 580 evenly distributed between 0 and 1
13.1.6 [instance 79] generates a random integer sequence of 581 evenly distributed in any interval.
13.2 Normal Distribution Random Sequence 582
13.2.1 [algorithm 133] a random number of 582 that generates a normal distribution of any mean and variance
13.2.2 [algorithm 134] Random Number Sequence 585 that generates a normal distribution of any mean and variance
13.2.3 [instance 80] generates a random number of 587 for the normal distribution of any mean and variance
13.2.4 [instance 81] Random Number Sequence 588 that generates a normal distribution of any mean and variance
13.3 statistical description 589
13.3.1 [algorithm 135] Moment 589 of distribution
13.3.2 [algorithm 136] tdistribution test with the Same Variance 591
13.3.3 [algorithm 137] tdistribution test with different variance 594
13.3.4 [algorithm 138] F test of variance 596
13.3.5 [algorithm 139] Chi-square test 599
13.3.6 [instance 82] calculate the moment 601 of random samples
13.3.7 [instance 83] tdistribution test 602
13.3.8 [instance 84] F distribution test 605
13.3.9 [instance 85] test the chi-square test algorithm 607

Chapter 2 search 14th
14.1 Basic Search 609
14.1.1 [algorithm 140] binary search for ordered arrays 609
14.1.2 [algorithm 141] unordered array searches for the largest and smallest element 611 at the same time
14.1.3 [algorithm 142] unordered array searching for elements smaller than m 613
14.1.4 [instance 86] Basic Search 615
14.2 search for struct and disk files 617
14.2.1 [algorithm 143] sequential search of unordered struct arrays 617
14.2.2 [algorithm 144] sequential query of records in Disk Files 618
14.2.3 [instance 87] search 619 in struct arrays and files
14.3 hash query 622
14.3.1 [algorithm 145] string hash function 622
14.3.2 [algorithm 146] hash function 626
14.3.3 [algorithm 147] insert element 628 to the hash table
14.3.4 [algorithm 148] search for element 629 in the hash table
14.3.5 [algorithm 149] Delete element 631 in the hash table
14.3.6 [instance 88] Create a hash table and search for 632

Chapter 1 sorting 15th
15.1 insert sort 636
15.1.1 [algorithm 150] Insert sort 636 directly
15.1.2 [algorithm 151] Hill sorting 637
15.1.3 [instance 89] Insert order 639
15.2 exchange sorting 641
15.2.1 [algorithm 152] Bubble Sorting 641
15.2.2 [algorithm 153] Quick sorting 642
15.2.3 [instance 90] switch order 644
15.3 select sort 646
15.3.1 [algorithm 154] directly select sorting 646
15.3.2 [algorithm 155] heap sorting 647
15.3.3 [instance 91] Select sorting 650
15.4 linear time sorting 651
15.4.1 [algorithm 156] counting sorting 651
15.4.2 [algorithm 157] Base sorting 653
15.4.3 [instance 92] linear time sorting 656
15.5 merge and sort 657
15.5.1 [algorithm 158] binary Merge Sorting 658
15.5.2 [instance 93] sorting by two-way merge 660

Chapter 2 mathematical transformation and filtering 16th
16.1 fast Fourier transformation 662
16.1.1 [algorithm 159] rapid Fourier transformation of complex data 662
16.1.2 [algorithm 160] rapid Fourier inverse transformation of complex data 666
16.1.3 [algorithm 161] Real Data fast Fourier transformation 669
16.1.4 [instance 94] verifies the Fourier transform function 671
16.2 other commonly used transformations 674
16.2.1 [algorithm 162] Fast Multiplication transformation 674
16.2.2 [algorithm 163] fast hadama transformation 678
16.2.3 [algorithm 164] fast cosine transformation 682
16.2.4 [instance 95] Verify the functions of the wallx transform and hadama 684
16.2.5 [instance 96] verifies the discrete cosine transform function 687.
16.3 smoothing and filtering 688
16.3.1 [algorithm 165] 5.3 smoothing times 689
16.3.2 [algorithm 166] α-β-gamma filter 690
16.3.3 [instance 97] Verification 5.3 smooth 692
16.3.4 [instance 98] verifies the α-β-gamma filter algorithm 693

 

This is a good book, find the source code from the Internet, the address is as follows: http://download.csdn.net/source/2280042

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.