WIP: Use auto keyword for lazy evaluation in EigenStepper
Closes ACTS-483
This is a first step towards fully global error propagation, as a first step the auto keyword is used for lazy evaluation where possible.
Merge request reports
Activity
For job clang_tidy on commit: a21e8d5f
Static analysis results: Accepted
ok pattern count limit readability-inconsistent-declaration-parameter-name
0 0 readability-named-parameter
0 0 readability-container-size-empty
0 0 modernize-use-using
0 0 readability-braces-around-statements
0 0 modernize-use-override
0 0 readability-implicit-bool-cast
0 0 modernize-use-default-member-init
0 0 performance-unnecessary-value-param
0 0 modernize-use-equals-default
0 0 modernize-use-nullptr
0 0 Analysis results at: https://acts.web.cern.ch/ACTS/static_analysis/acts-core/mr/457/clang_tidy
- Resolved by Andreas Salzburger
added 20 commits
Toggle commit listadded 16 commits
Toggle commit listFor job clang_tidy on commit: a53beed8
Static analysis results: Accepted
ok pattern count limit readability-inconsistent-declaration-parameter-name
0 0 readability-named-parameter
0 0 readability-container-size-empty
0 0 modernize-use-using
0 0 readability-braces-around-statements
0 0 modernize-use-override
0 0 readability-implicit-bool-cast
0 0 modernize-use-default-member-init
0 0 performance-unnecessary-value-param
0 0 modernize-use-equals-default
0 0 modernize-use-nullptr
0 0 Analysis results at: https://acts.web.cern.ch/ACTS/static_analysis/acts-core/mr/457/clang_tidy
- Resolved by Andreas Salzburger
For job clang_tidy on commit: 9fae2a6f
Static analysis results: Accepted
ok pattern count limit readability-inconsistent-declaration-parameter-name
0 0 readability-named-parameter
0 0 readability-container-size-empty
0 0 modernize-use-using
0 0 readability-braces-around-statements
0 0 modernize-use-override
0 0 readability-implicit-bool-cast
0 0 modernize-use-default-member-init
0 0 performance-unnecessary-value-param
0 0 modernize-use-equals-default
0 0 modernize-use-nullptr
0 0 Analysis results at: https://acts.web.cern.ch/ACTS/static_analysis/acts-core/mr/457/clang_tidy
256 256 auto rframeT = surface.initJacobianToLocal(jacToLocal, pos, dir); 257 257 // Update the jacobian with the transport from the steps 258 258 jacToGlobal = jacTransport * jacToGlobal; 259 // calculate the form factors for the derivatives 260 const ActsRowVectorD<5> sVec 259 // Calculate the form factors for the derivatives 260 const ActsRowVectorD<5> sfactors 261 261 = surface.derivativeFactors(pos, dir, rframeT, jacToGlobal); 262 // the full jacobian is ([to local] jacobian) * ([transport] jacobian) 263 const ActsMatrixD<5, 5> jacFull 264 = jacToLocal * (jacToGlobal - derivative * sVec); 262 // The full jacobian is ([to local] jacobian) * ([transport] jacobian) 263 // use auto keyword to profit from lazy evaluation 264 auto jacFull = jacToLocal * (jacToGlobal - derivative * sfactors); This is actually counterproductive I think.
jacFull
will be evaluated once (maybe even twice) in line 266 and then again in line 283. Eigen has no way to cache the result, and if the result is used in more than one expression, that might be the right thing.Edited by Paul Gessinger
So the more I think about this, the more I tend to not introduce these changes without measuring thoroughly. The Eigen docs mention
In short: do not use the auto keywords with Eigen's expressions, unless you are 100% sure about what you are doing.
in order not to shoot oneself in the foot.
Sorry to be that guy here, but can we see some numbers?