## 3 Filtering Algorithm
### Thomas Method
LS-line fitting was conducted to remove the form deviation, as shown in Figure 10b. The fitting time of the Gaussian elimination method is 0.125 um and the measuring speed is 0.25 mm/s. LS-line fitting was conducted to remove the form deviation, as shown in Figure 10c. The fitting time of the Gaussian elimination method is 0.125 um and the measuring speed is 0.25 mm/s. LS-line fitting was conducted to remove the form deviation, as shown in Figure 10d. The fitting time of the Gaussian elimination  
Figure 10b. The roughness parameter \(Ra\) and \(Rq\) were chosen for characterization and calculated according to the ISO 4288 [30]. The sampling length was set as 2.5 mm in this experiment, the evaluation length was 12.5 mm, and the cut-off wavelength was 2.5 mm which was numerically equivalent to the sampling length. In order to better compare the differences brought by different algorithms, four algorithms were applied to the standard cubic spline. Gaussian filter and spline filter in commercial software Mountains(r) were taken as the reference in this experiment. The roughness parameter \(Ra\), \(Rq\) were obtained as shown in Table 3. It can be calculated that the errors of parameter values \(Ra\) and parameter values \(Rq\) obtained by Gaussian filter and spline filter in the evaluation software were 0.06178% and 0.06413% respectively. This was due to the difference of filtering algorithm and transmission characteristics between the two filters. As shown in Table 4, the roughness parameter value obtained by the cubic spline filter in the software was different from the results of the cubic spline filter realized by the four algorithms. In fact, the difference was caused by the implementation algorithm of spline filter. In 2011, [PERSON] et al. pointed out that the calculation errors of roughness parameters after using a spline filter was bigger than using a Gaussian regression filter [31], which further proved the evaluation difference between the Gaussian filter and spline filter in the software Mountains(r). Therefore, this study takes the output value of the Gaussian filter as the final reference. Compared with the spline filter in the software, the implementation algorithm reduces the evaluation difference between the spline filter and the Gaussian filter as shown in Table 5. The roughness value obtained by the LDLT algorithm is the closest to the Gaussian filter, and the error were only 0.002667% and 0.03484%. The roughness values obtained by Gauss elimination method and LU decomposition method are the same. In fact, the LU decomposition is based on the idea of the Gaussian elimination, which is highly affected by the rounding error. Therefore, with the increase in the matrix order, the error accumulates significantly. The LDLT avoids the square root operation and further reduces the error accumulation. The result shows that the roughness value obtained by the LDLT is the closest to the reference value. In essence, Thomas method is the Gaussian elimination method without selecting the principal elements. When the main diagonal elements are dominant, the calculation process of the Thomas method will not introduce a large increase in the order of magnitude of the intermediate results and will not cause a severe accumulation of rounding errors. The approximate spline matrix is not a strictly diagonally dominant matrix. Therefore, the catch-up method will cause serious error accumulation in the face of massive data. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Matrix Algorithm**} & \multicolumn{5}{c}{**Profile Size (Points)**} \\ \cline{2-6}  & **1000** & **10,000** & **100,000** & **1,000,000** & **5,000,000** \\ \hline Gauss elimination & 0.0202 s & 0.0286 s & 0.105 s & 0.887 s & 4.411 s \\ LU decomposition & 0.0202 s & 0.0442 s & 0.150 s & 1.576 s & 7.197 s \\ LDLT & 0.0216 s & 0.0392 s & 0.160 s & 1.182 s & 5.283 s \\ Thomas & 0.0246 s & 0.0396 s & 0.179 s & 1.327 s & 5.939 s \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Time consumption results of the profile filtering test.