@@ -324,7 +324,7 @@ BOOST_AUTO_TEST_CASE(testStrikeDependence) {
324324 Real tol = 1.0e-12 ;
325325
326326 // check that variance matches at each strike point
327- for (double strike : strikes) {
327+ for (Real strike : strikes) {
328328 Real expected = section->variance (strike);
329329 Real calculated = surface.blackVariance (d1, strike);
330330 Real diff = std::fabs (calculated - expected);
@@ -388,7 +388,7 @@ BOOST_AUTO_TEST_CASE(testMultiTenorSmileInterpolation) {
388388 Real alpha = (tMid - t1) / (t2 - t1);
389389 Real tol = 1.0e-12 ;
390390
391- for (double strike : strikes) {
391+ for (Real strike : strikes) {
392392 Real var1 = section1->variance (strike);
393393 Real var2 = section2->variance (strike);
394394 Real expected = var1 + (var2 - var1) * alpha;
@@ -417,7 +417,7 @@ BOOST_AUTO_TEST_CASE(testMultiTenorSmileInterpolation) {
417417 << " \n var(120): " << varMid120);
418418
419419 // calendar arbitrage check: total variance must be non-decreasing in time
420- for (double strike : strikes) {
420+ for (Real strike : strikes) {
421421 Real var_d1 = surface.blackVariance (d1, strike);
422422 Real var_dMid = surface.blackVariance (dMid, strike);
423423 Real var_d2 = surface.blackVariance (d2, strike);
@@ -442,7 +442,7 @@ BOOST_AUTO_TEST_CASE(testMultiTenorSmileInterpolation) {
442442 std::vector<Real> butterflyStrikes = {85.0 , 90.0 , 95.0 , 100.0 ,
443443 105.0 , 110.0 , 115.0 };
444444
445- for (double K : butterflyStrikes) {
445+ for (Real K : butterflyStrikes) {
446446 Real w = surface.blackVariance (dMid, K);
447447 Real w_p = surface.blackVariance (dMid, K + dK);
448448 Real w_m = surface.blackVariance (dMid, K - dK);
@@ -806,7 +806,7 @@ BOOST_AUTO_TEST_CASE(testRaggedStrikeGrids) {
806806 Real tol = 1.0e-12 ;
807807
808808 // exact repricing at each tenor's own strike grid
809- for (double i : strikes1) {
809+ for (Real i : strikes1) {
810810 Real expected = section1->variance (i);
811811 Real calculated = surface.blackVariance (d1, i);
812812 Real diff = std::fabs (calculated - expected);
@@ -817,7 +817,7 @@ BOOST_AUTO_TEST_CASE(testRaggedStrikeGrids) {
817817 << std::scientific << calculated
818818 << " \n expected: " << expected);
819819 }
820- for (double i : strikes2) {
820+ for (Real i : strikes2) {
821821 Real expected = section2->variance (i);
822822 Real calculated = surface.blackVariance (d2, i);
823823 Real diff = std::fabs (calculated - expected);
@@ -855,7 +855,7 @@ BOOST_AUTO_TEST_CASE(testRaggedStrikeGrids) {
855855
856856 // calendar arbitrage: variance non-decreasing across tenors
857857 std::vector<Real> testStrikes = {70.0 , 80.0 , 90.0 , 100.0 , 110.0 , 120.0 , 130.0 };
858- for (double testStrike : testStrikes) {
858+ for (Real testStrike : testStrikes) {
859859 Real var_d1 = surface.blackVariance (d1, testStrike, true );
860860 Real var_dMid = surface.blackVariance (dMid, testStrike, true );
861861 Real var_d2 = surface.blackVariance (d2, testStrike, true );
0 commit comments