Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch reduce propertyaccess wrap #3301

Closed
wants to merge 36 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9a708e0
Refactored WrapCylinder::_calc_spiral_wrap_point for const-correctnes…
Mar 16, 2022
4db52a0
Reimplemented WrapCylinder::_make_spiral_path for perf
Mar 16, 2022
f628028
Cleaned up wrap angle calc
Mar 19, 2022
637b0b8
Cleaned up _make_spiral_path comment
Mar 19, 2022
c51eb7f
Added extremely appropriate TODOs into the wrapping implementation
Mar 19, 2022
764f70e
Add test case for testWrappingAlgorithm.cpp
aymanhab Aug 18, 2022
a24a33c
test cyliinder, sphere, ellpsoid path length and moment arms for corr…
aymanhab Aug 18, 2022
1ef8383
Reduce number of steps and move body COM to allow for path to wrap un…
aymanhab Aug 18, 2022
c6c45c1
Add non-perpendicular wrapping case
aymanhab Aug 22, 2022
27106c3
Merge branch 'master' into test_wrapping_algorithm
aymanhab Aug 27, 2022
01f3723
disable rotation tests in-progress
aymanhab Aug 27, 2022
f5b9d28
Add test comapre cylinder to ellipsoid wrapping
aymanhab Aug 29, 2022
097c925
Update continuous_integration.yml
aymanhab Aug 30, 2022
07d8240
Update testWrappingAlgorithm.cpp
aymanhab Aug 30, 2022
4df447a
Use angles of -30 to 30 degrees for comparing cylinder vs. ellipsoid …
aymanhab Aug 30, 2022
1c5ba70
Merge branch 'test_wrapping_algorithm' of https://github.com/opensim-…
aymanhab Aug 30, 2022
3a26f15
Merge branch 'test_wrapping_algorithm' of https://github.com/opensim-…
aymanhab Aug 30, 2022
6c44a91
Merge remote-tracking branch 'remotes/origin/master' into test_wrappi…
aymanhab Sep 8, 2022
710f6aa
Compare length with analytical answer in every iteration
aymanhab Sep 8, 2022
31e3a26
Merge branch 'test_wrapping_algorithm' of https://github.com/opensim-…
aymanhab Sep 8, 2022
1ffdda4
Address feedback on PR, clarify comments and some cleanup
aymanhab Sep 8, 2022
f24787d
Merge branch 'master' into test_wrapping_algorithm
aymanhab Sep 26, 2022
f9c84a7
Merge branch 'test_wrapping_algorithm' of https://github.com/opensim-…
aymanhab Sep 29, 2022
c875103
Clarify comments and address feedback on test case
aymanhab Oct 4, 2022
416b9a4
cache property radius into a member variable _radius
aymanhab Oct 4, 2022
3dfc820
Merge remote-tracking branch 'remotes/origin/perf_optimize-wrapcylind…
aymanhab Oct 6, 2022
e85d736
Cache property in local variable for speedup
aymanhab Oct 13, 2022
9e91120
cache properties and call ensureCapacity when size is known to avoid …
aymanhab Oct 13, 2022
62d29bf
Fix index 1->i error, cache properties and ensureCapacity on arrays o…
aymanhab Oct 13, 2022
b7792bf
Vary xyz rotations to exercise quadrants
aymanhab Oct 16, 2022
bb34cbd
Remove MAX, MIN macros and replace with inline std replacement
aymanhab Oct 16, 2022
49f1497
Fix visualization bug due to radian/degree conversion, cache properti…
aymanhab Oct 16, 2022
bd5beef
Comment debugging line (leaving behind for future change/debugging)
aymanhab Oct 17, 2022
58c70b0
Clarifying comments and minor rearrangement
aymanhab Oct 17, 2022
dd866ee
Fix compilation errors on *nixes due to initialization across gotos
aymanhab Oct 20, 2022
af75908
Performance, leverage the fact that wrapping is computed in cylinder'…
aymanhab Oct 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove MAX, MIN macros and replace with inline std replacement
aymanhab committed Oct 16, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit bb34cbd0e79a1748d7145ee5b4b794304d4e3680
4 changes: 2 additions & 2 deletions OpenSim/Common/MarkerData.cpp
Original file line number Diff line number Diff line change
@@ -777,8 +777,8 @@ void MarkerData::averageFrames(double aThreshold, double aStartTime, double aEnd
maxZ[i] - minZ[i] > aThreshold)
{
double maxDim = maxX[i] - minX[i];
maxDim = MAX(maxDim, (maxY[i] - minY[i]));
maxDim = MAX(maxDim, (maxZ[i] - minZ[i]));
maxDim = std::max(maxDim, (maxY[i] - minY[i]));
maxDim = std::max(maxDim, (maxZ[i] - minZ[i]));
log_warn("Movement of marker {} in {} is {} (threshold = {})",
_markerNames[i], _fileName, maxDim, aThreshold);
}
2 changes: 1 addition & 1 deletion OpenSim/Common/PiecewiseLinearFunction.cpp
Original file line number Diff line number Diff line change
@@ -421,7 +421,7 @@ void PiecewiseLinearFunction::calcCoefficients()
_b.setSize(n);

for (int i=0; i<n-1; i++) {
double range = MAX(TINY_NUMBER, _x[i+1] - _x[i]);
double range = std::max(TINY_NUMBER, _x[i+1] - _x[i]);
_b[i] = (_y[i+1] - _y[i]) / range;
}
_b[n-1] = _b[n-2];
2 changes: 0 additions & 2 deletions OpenSim/Common/SimmMacros.h
Original file line number Diff line number Diff line change
@@ -27,8 +27,6 @@ namespace OpenSim {

#define TINY_NUMBER 0.0000001
#define ROUNDOFF_ERROR 0.0000000000002
#define MAX(a,b) (std::max(a, b))
#define MIN(a,b) (std::min(a, b))
#define DABS(a) (std::abs(a))
#define DSIGN(a) ((a)>=0.0?(1):(-1))
#define SQR(x) ((x) * (x))
18 changes: 9 additions & 9 deletions OpenSim/Common/SimmSpline.cpp
Original file line number Diff line number Diff line change
@@ -333,7 +333,7 @@ void SimmSpline::calcCoefficients()

if (n == 2)
{
t = MAX(TINY_NUMBER,_x[1]-_x[0]);
t = std::max(TINY_NUMBER,_x[1]-_x[0]);
_b[0] = _b[1] = (_y[1]-_y[0])/t;
_c[0] = _c[1] = 0.0;
_d[0] = _d[1] = 0.0;
@@ -347,11 +347,11 @@ void SimmSpline::calcCoefficients()
* b = diagonal, d = offdiagonal, c = right-hand side
*/

_d[0] = MAX(TINY_NUMBER,_x[1] - _x[0]);
_d[0] = std::max(TINY_NUMBER,_x[1] - _x[0]);
_c[1] = (_y[1]-_y[0])/_d[0];
for (i=1; i<nm1; i++)
{
_d[i] = MAX(TINY_NUMBER,_x[i+1] - _x[i]);
_d[i] = std::max(TINY_NUMBER,_x[i+1] - _x[i]);
_b[i] = 2.0*(_d[i-1]+_d[i]);
_c[i+1] = (_y[i+1]-_y[i])/_d[i];
_c[i] = _c[i+1] - _c[i];
@@ -370,12 +370,12 @@ void SimmSpline::calcCoefficients()
{
double d1, d2, d3, d20, d30, d31;

d31 = MAX(TINY_NUMBER,_x[3] - _x[1]);
d20 = MAX(TINY_NUMBER,_x[2] - _x[0]);
d1 = MAX(TINY_NUMBER,_x[nm1]-_x[n-3]);
d2 = MAX(TINY_NUMBER,_x[nm2]-_x[n-4]);
d30 = MAX(TINY_NUMBER,_x[3] - _x[0]);
d3 = MAX(TINY_NUMBER,_x[nm1]-_x[n-4]);
d31 = std::max(TINY_NUMBER,_x[3] - _x[1]);
d20 = std::max(TINY_NUMBER,_x[2] - _x[0]);
d1 = std::max(TINY_NUMBER,_x[nm1]-_x[n-3]);
d2 = std::max(TINY_NUMBER,_x[nm2]-_x[n-4]);
d30 = std::max(TINY_NUMBER,_x[3] - _x[0]);
d3 = std::max(TINY_NUMBER,_x[nm1]-_x[n-4]);
_c[0] = _c[2]/d31 - _c[1]/d20;
_c[nm1] = _c[nm2]/d1 - _c[n-3]/d2;
_c[0] = _c[0]*_d[0]*_d[0]/d30;