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

Function CheckVarStd

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

Source from the content-addressed store, hash-verified

3331//
3332
3333void CheckVarStd(const Datum& array, const VarianceOptions& options,
3334 double expected_var) {
3335 ASSERT_OK_AND_ASSIGN(Datum out_var, Variance(array, options));
3336 ASSERT_OK_AND_ASSIGN(Datum out_std, Stddev(array, options));
3337 auto var = checked_cast<const DoubleScalar*>(out_var.scalar().get());
3338 auto std = checked_cast<const DoubleScalar*>(out_std.scalar().get());
3339 ASSERT_TRUE(var->is_valid && std->is_valid);
3340 AssertWithinUlp(std->value * std->value, var->value, /*n_ulps=*/2);
3341 AssertWithinUlp(var->value, expected_var, /*n_ulps=*/5);
3342}
3343
3344template <typename ArrowType>
3345class 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