solidcore

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 functionDefined atLinesRust (from the file header)
N_Combine2CPtsNL_Math.cpp:6127[CPoint::combine2]
N_Combine2PtsNL_Math.cpp:1827[combine2_pts] / [combine4_pts]
N_TranslateSum2PtsNL_Math.cpp:2667[translate_sum2_pts]
N_TranslateSum2CPtsNL_Math.cpp:31130[CPoint::translate_sum2]
N_Combine4PtsNL_Math.cpp:3797[combine2_pts] / [combine4_pts]
N_Combine4CPtsNL_Math.cpp:42724[CPoint::combine4]
N_CopyCPtNL_Math.cpp:4799Copy of [CPoint] / [Vec3]
N_CopyPtNL_Math.cpp:5177Copy of [CPoint] / [Vec3]
N_CPtToPtEuclidNL_Math.cpp:55424[CPoint::to_euclid]
N_CPtToPtAndWNL_Math.cpp:6136[CPoint::to_euclid_and_w]
N_WeightNL_Math.cpp:65120[CPoint::weighted]
N_VectorBlendCPtNL_Math.cpp:70518[CPoint::blend]
N_ScaleCPtNL_Math.cpp:75319[CPoint::scale]
N_ScaleCPtXYZNL_Math.cpp:80212[CPoint::scale_xyz]
N_VectorBlendPtNL_Math.cpp:8477[blend_pt]
N_ScalePtNL_Math.cpp:8847Vec3 * f64, +, -
N_TransformCPtNL_Math.cpp:93264[CPoint::transform]
N_TranslateCPtNL_Math.cpp:108640[CPoint::translate]
N_ScaleCPtWithPtAndVectorNL_Math.cpp:116040[CPoint::scale_about]
N_PtToCPtNL_Math.cpp:12298[CPoint::from_point]
N_CPtGetWNL_Math.cpp:12675field w / z
N_PtToXYZNL_Math.cpp:13027[Vec3::new], [Vec3::to_array]
N_PtFromXYZNL_Math.cpp:13397[Vec3::new], [Vec3::to_array]
N_CPtToWxWyWzNL_Math.cpp:137613[CPoint::new], [CPoint::to_array]
N_CPtFromWxWyWzNL_Math.cpp:142013[CPoint::new], [CPoint::to_array]
N_CPtSetXNL_Math.cpp:14635
N_CPtSetYNL_Math.cpp:14995
N_CPtSetZNL_Math.cpp:15345
N_CPtSetWNL_Math.cpp:15705
N_Sum2PtsNL_Math.cpp:16067Vec3 * f64, +, -
N_Sum2CPtsNL_Math.cpp:164323[CPoint::sum] / [CPoint::diff]
N_Diff2PtsNL_Math.cpp:17417Vec3 * f64, +, -
N_Diff2CPtsNL_Math.cpp:177826[CPoint::sum] / [CPoint::diff]
N_Dot2PtsNL_Math.cpp:18795[Vec3::dot] / [Vec3::length]
N_Dot2CPtsIn4DNL_Math.cpp:191717[CPoint::dot_4d]
N_PtMagnitudeNL_Math.cpp:21209[Vec3::dot] / [Vec3::length]
N_CPtMagnitudeNL_Math.cpp:215711[CPoint::magnitude]
N_CPtRatDerivNL_Math.cpp:220819[CPoint::rat_deriv]
N_CPtToPtNoWNL_Math.cpp:231226[CPoint::unweighted]
N_CPtGetZNL_Math.cpp:23685field w / z
N_CPtToPtNL_Math.cpp:244511[CPoint::drop_w]
N_SolveQuadraticEqNL_Math.cpp:2496176[solve_quadratic], [QuadraticRoots]
N_FloatOpIsBadNL_Math.cpp:2708143[float_op_is_bad], [FloatOp]
N_SwapIntegersNL_Math.cpp:29089core::mem::swap
N_SwapRealsNL_Math.cpp:29459core::mem::swap
N_SwapCPtsNL_Math.cpp:33949core::mem::swap
N_PascalTriRowNL_Math.cpp:351438[pascal_triangle]
N_InitRealMatrixNL_Math.cpp:36178[RealMatrix::null]
N_CreateRealMatrixNL_Math.cpp:37839[RealMatrix::from_rows]
N_RealMatrixDefineNL_Math.cpp:39668[RealMatrix::define]
N_GetRealMatrixDataNL_Math.cpp:41399[RealMatrix::n] etc., [RealMatrix::get]
N_GetMaxIndexRealMatrixNL_Math.cpp:42986[RealMatrix::max_index]
N_GetRealMatrixPtrNL_Math.cpp:44375[RealMatrix::n] etc., [RealMatrix::get]
N_RealMatrixIsNULLNL_Math.cpp:470724[RealMatrix::is_null]
N_SetRealMatrixNL_Math.cpp:519039[RealMatrix::new]
N_CheckMemRealMatrixNL_Math.cpp:549328[RealMatrix::ensure]
N_RealMatrixMultiplyNL_Math.cpp:5714188[RealMatrix::multiply_into] / [RealMatrix::multiply]
N_RealMatrixTransposeNL_Math.cpp:6300128[RealMatrix::transpose_into], [RealMatrix::transpose], [RealMatrix::transpose_in_place]
N_RealMatrixMultiplyPtArrayNL_Math.cpp:646388[RealMatrix::multiply_points]
N_RealMatrixMultiplyCPtArrayNL_Math.cpp:658788[RealMatrix::multiply_cpoints]
N_PowerBasisSrfEvalPtsNL_Math.cpp:705628[power_basis_srf_eval_pts]
N_RealMatrixLuDecomposeNL_Math.cpp:729898[RealMatrix::lu_decompose]
N_RealMatrixLuDecomposePivotNL_Math.cpp:7432125[RealMatrix::lu_decompose_pivot]
N_RealMatrixForBackNL_Math.cpp:7605209[RealMatrix::for_back_points] / [RealMatrix::for_back_cpoints]
N_RealMatrixRightForBackNL_Math.cpp:7852101[RealMatrix::right_for_back]
N_RealMatrixForBackPivotNL_Math.cpp:799164[RealMatrix::for_back_pivot]
N_RealMatrixInverseNL_Math.cpp:809788[RealMatrix::inverse_into] / [RealMatrix::inverse]
N_RealMatrixLstSqSolveNL_Math.cpp:833782[RealMatrix::lst_sq_solve]
N_SrfPowerBasisEvalPtNL_SrfPoly.cpp:5143[srf_power_basis_eval_pt]
N_SrfPowerBasisEvalDerivsNL_SrfPoly.cpp:276250[srf_power_basis_eval_derivs]
N_Realloc1dFlagArrayNL_Util.cpp:581234[realloc_1d]
N_Realloc1dRealArrayNL_Util.cpp:622434[realloc_1d]
N_Realloc2dRealArrayNL_Util.cpp:629138[realloc_2d]
N_Realloc1dPtArrayNL_Util.cpp:636134[realloc_1d]
N_Realloc1dCPtArrayNL_Util.cpp:649934[realloc_1d]
N_Realloc2dCPtArrayNL_Util.cpp:656638[realloc_2d]
N_CPtsAreEqualNL_Util.cpp:717018[CPoint::approx_eq]
N_ErrClearNL_Util.cpp:86035(none: errors are values)
N_CheckRealMatStorageNL_Util.cpp:869822[RealMatrix::check_storage]
Module file-header table (66 rows)
RustUpstream
[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 / zN_CPtGetW / N_CPtGetZ
[CPoint::new], [CPoint::to_array]N_CPtFromWxWyWz, N_CPtToWxWyWz
fields x, y, z, wN_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::swapN_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