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

Function GetRandomNumbers

cpp/src/arrow/util/decimal_test.cc:1467–1478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1465
1466template <typename ArrowType, typename CType = typename ArrowType::c_type>
1467std::vector<CType> GetRandomNumbers(int32_t size) {
1468 auto rand = random::RandomArrayGenerator(0x5487655);
1469 auto x_array = rand.Numeric<ArrowType>(size, static_cast<CType>(0),
1470 std::numeric_limits<CType>::max(), 0);
1471
1472 auto x_ptr = x_array->data()->template GetValues<CType>(1);
1473 std::vector<CType> ret;
1474 for (int i = 0; i < size; ++i) {
1475 ret.push_back(x_ptr[i]);
1476 }
1477 return ret;
1478}
1479
1480TYPED_TEST(TestBasicDecimalFunctionality, Multiply) {
1481 ASSERT_EQ(TypeParam(60501), TypeParam(301) * TypeParam(201));

Callers

nothing calls this directly

Calls 2

push_backMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected