OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExtensionFunctionsArrayTesting.hpp File Reference
#include "heavydbTypes.h"
+ Include dependency graph for ExtensionFunctionsArrayTesting.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

EXTENSION_NOINLINE int64_t raw_array_as_scalar_same_type (const int64_t *in_arr, const int64_t val)
 
EXTENSION_NOINLINE int32_t raw_array_as_scalar_diff_type (const int64_t *in_arr, const int64_t val)
 
EXTENSION_NOINLINE Array< int64_t > raw_array_as_array_same_type (const int64_t *in_arr, const int64_t val)
 
EXTENSION_NOINLINE Array< int32_t > raw_array_as_array_diff_type (const int64_t *in_arr, const int64_t val)
 

Function Documentation

EXTENSION_NOINLINE Array<int32_t> raw_array_as_array_diff_type ( const int64_t *  in_arr,
const int64_t  val 
)

Definition at line 36 of file ExtensionFunctionsArrayTesting.hpp.

References Array< T >::ptr.

37  {
38  // return array with val appended as array
39  auto array = Array<int32_t>(val + 1, false);
40  for (int64_t i = 0; i < val; i++) {
41  array.ptr[i] = static_cast<int32_t>(in_arr[i]);
42  }
43  array.ptr[val] = static_cast<int32_t>(val);
44  return array;
45 }
T * ptr
Definition: heavydbTypes.h:224
EXTENSION_NOINLINE Array<int64_t> raw_array_as_array_same_type ( const int64_t *  in_arr,
const int64_t  val 
)

Definition at line 25 of file ExtensionFunctionsArrayTesting.hpp.

References Array< T >::ptr.

26  {
27  // return array with val appended as array
28  auto array = Array<int64_t>(val + 1, false);
29  for (int64_t i = 0; i < val; i++) {
30  array.ptr[i] = in_arr[i];
31  }
32  array.ptr[val] = val;
33  return array;
34 }
T * ptr
Definition: heavydbTypes.h:224
EXTENSION_NOINLINE int32_t raw_array_as_scalar_diff_type ( const int64_t *  in_arr,
const int64_t  val 
)

Definition at line 14 of file ExtensionFunctionsArrayTesting.hpp.

15  {
16  // return sum of array and val as array
17  int32_t scalar{};
18  for (int64_t i = 0; i < val; i++) {
19  scalar += static_cast<int32_t>(in_arr[i]);
20  }
21  scalar += static_cast<int32_t>(val);
22  return scalar;
23 }
EXTENSION_NOINLINE int64_t raw_array_as_scalar_same_type ( const int64_t *  in_arr,
const int64_t  val 
)

Definition at line 3 of file ExtensionFunctionsArrayTesting.hpp.

4  {
5  // return sum of array and val as array
6  int64_t scalar{};
7  for (int64_t i = 0; i < val; i++) {
8  scalar += in_arr[i];
9  }
10  scalar += val;
11  return scalar;
12 }