Units / nurbs
nlib.math green
- Layer
- 0
- Upstream lines
- 2,971
- Functions
- 79
- Rust module
nurbs::math
Source: crates/solidcore/src/nurbs/math.rs
Upstream: source/SMLib/src/NL_Math.cpp, source/SMLib/src/NL_SrfPoly.cpp, source/SMLib/src/NL_Util.cpp
Notes
green: 3076 difftest cases (76 fixture + 3000 generated), 0 deferred, max_rel_err 0 (bit-identical; a 100,076-case run was also clean). N_SrfPowerBasisEvalPt back-edge into nlib.srf_basic removed (Rust takes the control net; see plan/findings.md). 79 fns; largest: N_SrfPowerBasisEvalDerivs, N_RealMatrixForBack, N_RealMatrixMultiply, N_SolveQuadraticEq; unit-SCC #2 (3 units); 317 upstream test entry points reach this unit
Difftest
- Cases
- 3,076
- Passed
- 3,076
- Deferred
- 0
- Failed
- 0
- Both errored
- 275
- Max rel. error
- 0.0
- Tolerance
- 1e-09 rel.
- Seeds
- 16
Blocked by
Nothing: no deferred cases.
Report JSON (per-case results)
Dependencies
Depends on: none
Soft dependencies: none
Dependents: curve.curve_cache green nlib.bezier green nlib.crv_adv_p1 green nlib.crv_adv_p2 green nlib.crv_approx green nlib.crv_basic green nlib.crv_common green nlib.crv_fit_p1 green nlib.crv_fit_p2 green nlib.crv_fit_p3 green nlib.crv_geom green nlib.crv_nurb green nlib.crv_tool_p1 green nlib.crv_tool_p2 green nlib.funcs_adv green nlib.geom green nlib.iges green nlib.srf_adv_p1 green nlib.srf_adv_p2 green nlib.srf_adv_p3 green nlib.srf_adv_p4 green nlib.srf_adv_p5 green nlib.srf_adv_p6 green nlib.srf_basic green nlib.srf_common green nlib.srf_fit green nlib.srf_nurb green nlib.srf_offset green nlib.srf_tool_p2 green nlib.srf_tool_p3 green nlib.srf_tool_p4 green nurbs.b_spline_curve_n_lib green nurbs.b_spline_surface_n_lib_p1 green nurbs.b_spline_surface_p1 green nurbs.nurbs_crv green
Soft dependents: nlib.basis_adv green nlib.basis_basic green nlib.crv_offset green nlib.srf_tool_p1 green nurbs.b_spline_curve_p1 green nurbs.b_spline_curve_p2 green nurbs.b_spline_curve_p3 partial nurbs.b_spline_surface_n_lib_p2 partial nurbs.nurbs_srf green surface.b_spline_volume green
Upstream functions
| Upstream function | Defined at | Lines | Rust (from the file header) |
|---|---|---|---|
N_Combine2CPts | NL_Math.cpp:61 | 27 | [CPoint::combine2] |
N_Combine2Pts | NL_Math.cpp:182 | 7 | [combine2_pts] / [combine4_pts] |
N_TranslateSum2Pts | NL_Math.cpp:266 | 7 | [translate_sum2_pts] |
N_TranslateSum2CPts | NL_Math.cpp:311 | 30 | [CPoint::translate_sum2] |
N_Combine4Pts | NL_Math.cpp:379 | 7 | [combine2_pts] / [combine4_pts] |
N_Combine4CPts | NL_Math.cpp:427 | 24 | [CPoint::combine4] |
N_CopyCPt | NL_Math.cpp:479 | 9 | Copy of [CPoint] / [Vec3] |
N_CopyPt | NL_Math.cpp:517 | 7 | Copy of [CPoint] / [Vec3] |
N_CPtToPtEuclid | NL_Math.cpp:554 | 24 | [CPoint::to_euclid] |
N_CPtToPtAndW | NL_Math.cpp:613 | 6 | [CPoint::to_euclid_and_w] |
N_Weight | NL_Math.cpp:651 | 20 | [CPoint::weighted] |
N_VectorBlendCPt | NL_Math.cpp:705 | 18 | [CPoint::blend] |
N_ScaleCPt | NL_Math.cpp:753 | 19 | [CPoint::scale] |
N_ScaleCPtXYZ | NL_Math.cpp:802 | 12 | [CPoint::scale_xyz] |
N_VectorBlendPt | NL_Math.cpp:847 | 7 | [blend_pt] |
N_ScalePt | NL_Math.cpp:884 | 7 | Vec3 * f64, +, - |
N_TransformCPt | NL_Math.cpp:932 | 64 | [CPoint::transform] |
N_TranslateCPt | NL_Math.cpp:1086 | 40 | [CPoint::translate] |
N_ScaleCPtWithPtAndVector | NL_Math.cpp:1160 | 40 | [CPoint::scale_about] |
N_PtToCPt | NL_Math.cpp:1229 | 8 | [CPoint::from_point] |
N_CPtGetW | NL_Math.cpp:1267 | 5 | field w / z |
N_PtToXYZ | NL_Math.cpp:1302 | 7 | [Vec3::new], [Vec3::to_array] |
N_PtFromXYZ | NL_Math.cpp:1339 | 7 | [Vec3::new], [Vec3::to_array] |
N_CPtToWxWyWz | NL_Math.cpp:1376 | 13 | [CPoint::new], [CPoint::to_array] |
N_CPtFromWxWyWz | NL_Math.cpp:1420 | 13 | [CPoint::new], [CPoint::to_array] |
N_CPtSetX | NL_Math.cpp:1463 | 5 | |
N_CPtSetY | NL_Math.cpp:1499 | 5 | |
N_CPtSetZ | NL_Math.cpp:1534 | 5 | |
N_CPtSetW | NL_Math.cpp:1570 | 5 | |
N_Sum2Pts | NL_Math.cpp:1606 | 7 | Vec3 * f64, +, - |
N_Sum2CPts | NL_Math.cpp:1643 | 23 | [CPoint::sum] / [CPoint::diff] |
N_Diff2Pts | NL_Math.cpp:1741 | 7 | Vec3 * f64, +, - |
N_Diff2CPts | NL_Math.cpp:1778 | 26 | [CPoint::sum] / [CPoint::diff] |
N_Dot2Pts | NL_Math.cpp:1879 | 5 | [Vec3::dot] / [Vec3::length] |
N_Dot2CPtsIn4D | NL_Math.cpp:1917 | 17 | [CPoint::dot_4d] |
N_PtMagnitude | NL_Math.cpp:2120 | 9 | [Vec3::dot] / [Vec3::length] |
N_CPtMagnitude | NL_Math.cpp:2157 | 11 | [CPoint::magnitude] |
N_CPtRatDeriv | NL_Math.cpp:2208 | 19 | [CPoint::rat_deriv] |
N_CPtToPtNoW | NL_Math.cpp:2312 | 26 | [CPoint::unweighted] |
N_CPtGetZ | NL_Math.cpp:2368 | 5 | field w / z |
N_CPtToPt | NL_Math.cpp:2445 | 11 | [CPoint::drop_w] |
N_SolveQuadraticEq | NL_Math.cpp:2496 | 176 | [solve_quadratic], [QuadraticRoots] |
N_FloatOpIsBad | NL_Math.cpp:2708 | 143 | [float_op_is_bad], [FloatOp] |
N_SwapIntegers | NL_Math.cpp:2908 | 9 | core::mem::swap |
N_SwapReals | NL_Math.cpp:2945 | 9 | core::mem::swap |
N_SwapCPts | NL_Math.cpp:3394 | 9 | core::mem::swap |
N_PascalTriRow | NL_Math.cpp:3514 | 38 | [pascal_triangle] |
N_InitRealMatrix | NL_Math.cpp:3617 | 8 | [RealMatrix::null] |
N_CreateRealMatrix | NL_Math.cpp:3783 | 9 | [RealMatrix::from_rows] |
N_RealMatrixDefine | NL_Math.cpp:3966 | 8 | [RealMatrix::define] |
N_GetRealMatrixData | NL_Math.cpp:4139 | 9 | [RealMatrix::n] etc., [RealMatrix::get] |
N_GetMaxIndexRealMatrix | NL_Math.cpp:4298 | 6 | [RealMatrix::max_index] |
N_GetRealMatrixPtr | NL_Math.cpp:4437 | 5 | [RealMatrix::n] etc., [RealMatrix::get] |
N_RealMatrixIsNULL | NL_Math.cpp:4707 | 24 | [RealMatrix::is_null] |
N_SetRealMatrix | NL_Math.cpp:5190 | 39 | [RealMatrix::new] |
N_CheckMemRealMatrix | NL_Math.cpp:5493 | 28 | [RealMatrix::ensure] |
N_RealMatrixMultiply | NL_Math.cpp:5714 | 188 | [RealMatrix::multiply_into] / [RealMatrix::multiply] |
N_RealMatrixTranspose | NL_Math.cpp:6300 | 128 | [RealMatrix::transpose_into], [RealMatrix::transpose], [RealMatrix::transpose_in_place] |
N_RealMatrixMultiplyPtArray | NL_Math.cpp:6463 | 88 | [RealMatrix::multiply_points] |
N_RealMatrixMultiplyCPtArray | NL_Math.cpp:6587 | 88 | [RealMatrix::multiply_cpoints] |
N_PowerBasisSrfEvalPts | NL_Math.cpp:7056 | 28 | [power_basis_srf_eval_pts] |
N_RealMatrixLuDecompose | NL_Math.cpp:7298 | 98 | [RealMatrix::lu_decompose] |
N_RealMatrixLuDecomposePivot | NL_Math.cpp:7432 | 125 | [RealMatrix::lu_decompose_pivot] |
N_RealMatrixForBack | NL_Math.cpp:7605 | 209 | [RealMatrix::for_back_points] / [RealMatrix::for_back_cpoints] |
N_RealMatrixRightForBack | NL_Math.cpp:7852 | 101 | [RealMatrix::right_for_back] |
N_RealMatrixForBackPivot | NL_Math.cpp:7991 | 64 | [RealMatrix::for_back_pivot] |
N_RealMatrixInverse | NL_Math.cpp:8097 | 88 | [RealMatrix::inverse_into] / [RealMatrix::inverse] |
N_RealMatrixLstSqSolve | NL_Math.cpp:8337 | 82 | [RealMatrix::lst_sq_solve] |
N_SrfPowerBasisEvalPt | NL_SrfPoly.cpp:51 | 43 | [srf_power_basis_eval_pt] |
N_SrfPowerBasisEvalDerivs | NL_SrfPoly.cpp:276 | 250 | [srf_power_basis_eval_derivs] |
N_Realloc1dFlagArray | NL_Util.cpp:5812 | 34 | [realloc_1d] |
N_Realloc1dRealArray | NL_Util.cpp:6224 | 34 | [realloc_1d] |
N_Realloc2dRealArray | NL_Util.cpp:6291 | 38 | [realloc_2d] |
N_Realloc1dPtArray | NL_Util.cpp:6361 | 34 | [realloc_1d] |
N_Realloc1dCPtArray | NL_Util.cpp:6499 | 34 | [realloc_1d] |
N_Realloc2dCPtArray | NL_Util.cpp:6566 | 38 | [realloc_2d] |
N_CPtsAreEqual | NL_Util.cpp:7170 | 18 | [CPoint::approx_eq] |
N_ErrClear | NL_Util.cpp:8603 | 5 | (none: errors are values) |
N_CheckRealMatStorage | NL_Util.cpp:8698 | 22 | [RealMatrix::check_storage] |
Module file-header table (66 rows)
| Rust | Upstream |
|---|---|
[CPoint] | NL_CPOINT |
[NOZ] / [NOW] | NL_NOZ / NL_NOW |
[CPoint::ZERO] | NL_CZERO |
[CPoint::combine2] | N_Combine2CPts |
[CPoint::translate_sum2] | N_TranslateSum2CPts |
[CPoint::combine4] | N_Combine4CPts |
Copy of [CPoint] / [Vec3] | N_CopyCPt / N_CopyPt |
[CPoint::to_euclid] | N_CPtToPtEuclid |
[CPoint::to_euclid_and_w] | N_CPtToPtAndW |
[CPoint::weighted] | N_Weight |
[CPoint::blend] | N_VectorBlendCPt |
[CPoint::scale] | N_ScaleCPt |
[CPoint::scale_xyz] | N_ScaleCPtXYZ |
[CPoint::transform] | N_TransformCPt |
[CPoint::translate] | N_TranslateCPt |
[CPoint::scale_about] | N_ScaleCPtWithPtAndVector |
[CPoint::from_point] | N_PtToCPt |
field w / z | N_CPtGetW / N_CPtGetZ |
[CPoint::new], [CPoint::to_array] | N_CPtFromWxWyWz, N_CPtToWxWyWz |
fields x, y, z, w | N_CPtSetX/Y/Z/W |
[CPoint::sum] / [CPoint::diff] | N_Sum2CPts / N_Diff2CPts |
[CPoint::dot_4d] | N_Dot2CPtsIn4D |
[CPoint::magnitude] | N_CPtMagnitude |
[CPoint::rat_deriv] | N_CPtRatDeriv |
[CPoint::unweighted] | N_CPtToPtNoW |
[CPoint::drop_w] | N_CPtToPt |
[CPoint::approx_eq] | N_CPtsAreEqual (NL_MTOL) |
[combine2_pts] / [combine4_pts] | N_Combine2Pts / N_Combine4Pts |
[translate_sum2_pts] | N_TranslateSum2Pts |
[blend_pt] | N_VectorBlendPt |
Vec3 * f64, +, - | N_ScalePt, N_Sum2Pts, N_Diff2Pts |
[Vec3::dot] / [Vec3::length] | N_Dot2Pts / N_PtMagnitude |
[Vec3::new], [Vec3::to_array] | N_PtFromXYZ, N_PtToXYZ |
[solve_quadratic], [QuadraticRoots] | N_SolveQuadraticEq |
[float_op_is_bad], [FloatOp] | N_FloatOpIsBad |
core::mem::swap | N_SwapIntegers, N_SwapReals, N_SwapCPts |
[pascal_triangle] | N_PascalTriRow |
[RealMatrix], [MatrixType] | NL_RMATRIX, NL_MATRIXTYPE |
[RealMatrix::null] | N_InitRealMatrix |
[RealMatrix::from_rows] | N_CreateRealMatrix |
[RealMatrix::define] | N_RealMatrixDefine |
[RealMatrix::n] etc., [RealMatrix::get] | N_GetRealMatrixData, N_GetRealMatrixPtr |
[RealMatrix::max_index] | N_GetMaxIndexRealMatrix |
[RealMatrix::is_null] | N_RealMatrixIsNULL |
[RealMatrix::new] | N_SetRealMatrix |
[RealMatrix::ensure] | N_CheckMemRealMatrix |
[RealMatrix::check_storage] | N_CheckRealMatStorage |
[RealMatrix::multiply_into] / [RealMatrix::multiply] | N_RealMatrixMultiply |
[RealMatrix::transpose_into], [RealMatrix::transpose], [RealMatrix::transpose_in_place] | N_RealMatrixTranspose |
[RealMatrix::multiply_points] | N_RealMatrixMultiplyPtArray |
[RealMatrix::multiply_cpoints] | N_RealMatrixMultiplyCPtArray |
[RealMatrix::lu_decompose] | N_RealMatrixLuDecompose |
[RealMatrix::lu_decompose_pivot] | N_RealMatrixLuDecomposePivot |
[RealMatrix::for_back_points] / [RealMatrix::for_back_cpoints] | N_RealMatrixForBack (NL_EPOINT / NL_HPOINT) |
[RealMatrix::right_for_back] | N_RealMatrixRightForBack |
[RealMatrix::for_back_pivot] | N_RealMatrixForBackPivot |
[RealMatrix::inverse_into] / [RealMatrix::inverse] | N_RealMatrixInverse |
[RealMatrix::lst_sq_solve] | N_RealMatrixLstSqSolve |
[power_basis_srf_eval_pts] | N_PowerBasisSrfEvalPts |
[srf_power_basis_eval_pt] | N_SrfPowerBasisEvalPt |
[srf_power_basis_eval_derivs] | N_SrfPowerBasisEvalDerivs |
[realloc_1d] | N_Realloc1dFlagArray, N_Realloc1dRealArray, N_Realloc1dPtArray, N_Realloc1dCPtArray |
[realloc_2d] | N_Realloc2dRealArray, N_Realloc2dCPtArray |
| (none: errors are values) | N_ErrClear |
[LU_TOL], [ZERO_DISCRIMINANT_TOL], [ZERO_COEFFICIENT_TOL], [MODEL_TOL] | NL_LUDT, NL_ZDTL, NL_ZCTL, NL_MTOL |
[MAX_DERIVATIVE] | NL_MAXDER |
Upstream tests reaching this unit
prog_test:my_test_surface_closest_point, prog_test:my_test_drop_point, prog_test:my_test_matrix, prog_test:my_test_reversed_line_join, SM_API_test:TestSmCreateRectangle, SM_API_test:TestSmCreateRegularPolygon