@@ -1154,14 +1154,14 @@ TEST_CASE("Test statistics - combine_magnitude") {
1154
1154
CHECK (combine_magnitude (measurements | take (2 )).variance == doctest::Approx (3.0 / 25.0 ));
1155
1155
1156
1156
CHECK (combine_magnitude (measurements | take (3 )).value .real () ==
1157
- doctest::Approx ((3.0 * std::sqrt (26.0 ) + 5.0 ) / 6.0 ));
1157
+ doctest::Approx ((8.0 + 3.0 * std::sqrt (26.0 )) / 6.0 ));
1158
1158
CHECK (is_nan (combine_magnitude (measurements | take (3 )).value .imag ()));
1159
1159
CHECK (combine_magnitude (measurements | take (3 )).variance == doctest::Approx (1.0 / 10.0 ));
1160
1160
}
1161
1161
1162
1162
SUBCASE (" UniformComplexRandVar<asymmetric_t>" ) {
1163
1163
std::vector<UniformComplexRandVar<asymmetric_t >> const measurements{
1164
- {.value = {RealValue<asymmetric_t >{1.0 , 2.0 , -1.0 }, RealValue<asymmetric_t >{5.0 , nan , 7.0 }},
1164
+ {.value = {RealValue<asymmetric_t >{1.0 , 2.0 , -1.0 }, RealValue<asymmetric_t >{5.0 , 6.0 , 7.0 }},
1165
1165
.variance = 0.2 },
1166
1166
{.value = {RealValue<asymmetric_t >{2.0 , 4.0 , 3.0 }, RealValue<asymmetric_t >{nan}}, .variance = 0.3 },
1167
1167
{.value = {RealValue<asymmetric_t >{4.0 , 5.0 , 6.0 }, RealValue<asymmetric_t >{nan}}, .variance = 0.6 }};
@@ -1174,17 +1174,21 @@ TEST_CASE("Test statistics - combine_magnitude") {
1174
1174
CHECK (is_nan (combine_magnitude (measurements | take (0 )).value (0 ).imag ()));
1175
1175
CHECK (is_inf (combine_magnitude (measurements | take (0 )).variance ));
1176
1176
1177
- CHECK (combine_magnitude (measurements | take (1 )).value (0 ).real () == cabs (measurements.front ().value (0 )));
1178
- CHECK (combine_magnitude (measurements | take (1 )).value (1 ).real () == cabs (measurements.front ().value (1 )));
1179
- CHECK (combine_magnitude (measurements | take (1 )).value (2 ).real () == cabs (measurements.front ().value (2 )));
1177
+ CHECK (combine_magnitude (measurements | take (1 )).value (0 ).real () ==
1178
+ doctest::Approx (cabs (measurements.front ().value (0 ))));
1179
+ CHECK (combine_magnitude (measurements | take (1 )).value (1 ).real () ==
1180
+ doctest::Approx (cabs (measurements.front ().value (1 ))));
1181
+ CHECK (combine_magnitude (measurements | take (1 )).value (2 ).real () ==
1182
+ doctest::Approx (cabs (measurements.front ().value (2 ))));
1180
1183
CHECK (is_nan (combine_magnitude (measurements | take (1 )).value (0 ).imag ()));
1181
1184
CHECK (is_nan (combine_magnitude (measurements | take (1 )).value (1 ).imag ()));
1182
1185
CHECK (is_nan (combine_magnitude (measurements | take (1 )).value (2 ).imag ()));
1183
1186
CHECK (combine_magnitude (measurements | take (1 )).variance == measurements.front ().variance );
1184
1187
1185
1188
CHECK (combine_magnitude (measurements | take (2 )).value (0 ).real () ==
1186
1189
doctest::Approx ((3.0 * std::sqrt (26.0 ) + 4.0 ) / 5.0 ));
1187
- CHECK (combine_magnitude (measurements | take (2 )).value (1 ).real () == doctest::Approx (14.0 / 5.0 ));
1190
+ CHECK (combine_magnitude (measurements | take (2 )).value (1 ).real () ==
1191
+ doctest::Approx ((8.0 + 6.0 * std::sqrt (10.0 )) / 5.0 ));
1188
1192
CHECK (combine_magnitude (measurements | take (2 )).value (2 ).real () ==
1189
1193
doctest::Approx ((6.0 + 15.0 * std::sqrt (2.0 )) / 5.0 ));
1190
1194
CHECK (is_nan (combine_magnitude (measurements | take (2 )).value (0 ).imag ()));
@@ -1193,8 +1197,9 @@ TEST_CASE("Test statistics - combine_magnitude") {
1193
1197
CHECK (combine_magnitude (measurements | take (2 )).variance == doctest::Approx (3.0 / 25.0 ));
1194
1198
1195
1199
CHECK (combine_magnitude (measurements | take (3 )).value (0 ).real () ==
1196
- doctest::Approx ((3.0 * std::sqrt (26.0 ) + 5.0 ) / 6.0 ));
1197
- CHECK (combine_magnitude (measurements | take (3 )).value (1 ).real () == doctest::Approx (19.0 / 6.0 ));
1200
+ doctest::Approx ((8.0 + 3.0 * std::sqrt (26.0 )) / 6.0 ));
1201
+ CHECK (combine_magnitude (measurements | take (3 )).value (1 ).real () ==
1202
+ doctest::Approx ((13.0 + 6.0 * std::sqrt (10.0 )) / 6.0 ));
1198
1203
CHECK (combine_magnitude (measurements | take (3 )).value (2 ).real () ==
1199
1204
doctest::Approx ((4.0 + 5.0 * std::sqrt (2.0 )) / 2.0 ));
1200
1205
CHECK (is_nan (combine_magnitude (measurements | take (3 )).value (0 ).imag ()));
0 commit comments