MCPcopy Create free account
hub / github.com/apache/arrow / CheckVarStd

Function CheckVarStd

cpp/src/arrow/compute/kernels/aggregate_test.cc:3293–3302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3291//
3292
3293void CheckVarStd(const Datum& array, const VarianceOptions& options,
3294 double expected_var) {
3295 ASSERT_OK_AND_ASSIGN(Datum out_var, Variance(array, options));
3296 ASSERT_OK_AND_ASSIGN(Datum out_std, Stddev(array, options));
3297 auto var = checked_cast<const DoubleScalar*>(out_var.scalar().get());
3298 auto std = checked_cast<const DoubleScalar*>(out_std.scalar().get());
3299 ASSERT_TRUE(var->is_valid && std->is_valid);
3300 AssertWithinUlp(std->value * std->value, var->value, /*n_ulps=*/2);
3301 AssertWithinUlp(var->value, expected_var, /*n_ulps=*/5);
3302}
3303
3304template <typename ArrowType>
3305class TestPrimitiveVarStdKernel : public ::testing::Test {

Callers 2

AssertVarStdIsMethod · 0.85
TESTFunction · 0.85

Calls 3

AssertWithinUlpFunction · 0.85
getMethod · 0.45
scalarMethod · 0.45

Tested by

no test coverage detected