Loading src/Utilities.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -296,6 +296,12 @@ double brentRoot(double lowerBound, double upperBound, previousPoint = currentPoint; previousFunc = currentFunc; nextFunc = func(nextPoint); // This is a bugfix. Without it, the code gets lost and can't find the solution. // See also the implementation at https://en.wikipedia.org/wiki/Brent%27s_method if (nextFunc == 0) return nextPoint; if (counterFunc * nextFunc < 0) { currentPoint = nextPoint; currentFunc = nextFunc; Loading tests/SarTests.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -84,10 +84,10 @@ TEST_F(SarSensorModel, computeGroundPartials) { ASSERT_EQ(partials.size(), 6); EXPECT_NEAR(partials[0], 6.5128150576280552e-09, 1e-8); EXPECT_NEAR(partials[1], -5.1810407815840636e-15, 1e-8); EXPECT_NEAR(partials[2], -0.13309947654685725, 1e-8); EXPECT_NEAR(partials[2], -0.13333333443071135, 1e-8); EXPECT_NEAR(partials[3], -33.057625791698072, 1e-8); EXPECT_NEAR(partials[4], 6.1985123841926308e-05, 1e-8); EXPECT_NEAR(partials[5], 0.007743051337209989, 1e-8); EXPECT_NEAR(partials[5], 0.0077565105243007169, 1e-8); } TEST_F(SarSensorModel, imageToProximateImagingLocus) { Loading Loading
src/Utilities.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -296,6 +296,12 @@ double brentRoot(double lowerBound, double upperBound, previousPoint = currentPoint; previousFunc = currentFunc; nextFunc = func(nextPoint); // This is a bugfix. Without it, the code gets lost and can't find the solution. // See also the implementation at https://en.wikipedia.org/wiki/Brent%27s_method if (nextFunc == 0) return nextPoint; if (counterFunc * nextFunc < 0) { currentPoint = nextPoint; currentFunc = nextFunc; Loading
tests/SarTests.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -84,10 +84,10 @@ TEST_F(SarSensorModel, computeGroundPartials) { ASSERT_EQ(partials.size(), 6); EXPECT_NEAR(partials[0], 6.5128150576280552e-09, 1e-8); EXPECT_NEAR(partials[1], -5.1810407815840636e-15, 1e-8); EXPECT_NEAR(partials[2], -0.13309947654685725, 1e-8); EXPECT_NEAR(partials[2], -0.13333333443071135, 1e-8); EXPECT_NEAR(partials[3], -33.057625791698072, 1e-8); EXPECT_NEAR(partials[4], 6.1985123841926308e-05, 1e-8); EXPECT_NEAR(partials[5], 0.007743051337209989, 1e-8); EXPECT_NEAR(partials[5], 0.0077565105243007169, 1e-8); } TEST_F(SarSensorModel, imageToProximateImagingLocus) { Loading