OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{ExtensionFunctionsArray.hpp} Namespace Reference

Functions

template<typename T >
DEVICE ALWAYS_INLINE Array< T > array_append_impl (const Array< T > &in_arr, T val)
 
DEVICE ALWAYS_INLINE Array< bool > barray_append_impl (const Array< bool > &in_arr, const int8_t val)
 
template<typename T >
DEVICE ALWAYS_INLINE Array< T > array_first_half_impl (const Array< T > &in_arr)
 
template<typename T >
DEVICE ALWAYS_INLINE Array< T > array_second_half_impl (const Array< T > &in_arr)
 

Function Documentation

template<typename T >
DEVICE ALWAYS_INLINE Array<T> anonymous_namespace{ExtensionFunctionsArray.hpp}::array_append_impl ( const Array< T > &  in_arr,
val 
)

Definition at line 13 of file ExtensionFunctionsArray.hpp.

References Array< T >::getSize().

Referenced by array_append(), array_append__(), array_append__1(), array_append__2(), array_append__3(), and array_append__4().

13  {
14  Array<T> out_arr(in_arr.getSize() + 1);
15  for (int64_t i = 0; i < in_arr.getSize(); i++) {
16  out_arr[i] = in_arr(i);
17  }
18  out_arr[in_arr.getSize()] = val;
19  return out_arr;
20 }
DEVICE int64_t getSize() const
Definition: heavydbTypes.h:231

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
DEVICE ALWAYS_INLINE Array<T> anonymous_namespace{ExtensionFunctionsArray.hpp}::array_first_half_impl ( const Array< T > &  in_arr)

Definition at line 37 of file ExtensionFunctionsArray.hpp.

References Array< T >::getSize(), and Array< T >::isNull().

Referenced by array_first_half__b8(), array_first_half__f32(), array_first_half__f64(), array_first_half__i16(), array_first_half__i32(), array_first_half__i64(), array_first_half__i8(), and array_first_half__t32().

37  {
38  auto sz = in_arr.getSize();
39  Array<T> out_arr(sz / 2, in_arr.isNull());
40  for (int64_t i = 0; i < sz / 2; i++) {
41  out_arr[i] = in_arr(i);
42  }
43  return out_arr;
44 }
DEVICE int64_t getSize() const
Definition: heavydbTypes.h:231
DEVICE bool isNull() const
Definition: heavydbTypes.h:233

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
DEVICE ALWAYS_INLINE Array<T> anonymous_namespace{ExtensionFunctionsArray.hpp}::array_second_half_impl ( const Array< T > &  in_arr)

Definition at line 47 of file ExtensionFunctionsArray.hpp.

References Array< T >::getSize(), and Array< T >::isNull().

Referenced by array_second_half__b8(), array_second_half__f32(), array_second_half__f64(), array_second_half__i16(), array_second_half__i32(), array_second_half__i64(), array_second_half__i8(), and array_second_half__t32().

47  {
48  auto sz = in_arr.getSize();
49  Array<T> out_arr(sz - sz / 2, in_arr.isNull());
50  for (int64_t i = sz / 2; i < sz; i++) {
51  out_arr[i - sz / 2] = in_arr(i);
52  }
53  return out_arr;
54 }
DEVICE int64_t getSize() const
Definition: heavydbTypes.h:231
DEVICE bool isNull() const
Definition: heavydbTypes.h:233

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE ALWAYS_INLINE Array<bool> anonymous_namespace{ExtensionFunctionsArray.hpp}::barray_append_impl ( const Array< bool > &  in_arr,
const int8_t  val 
)

Definition at line 24 of file ExtensionFunctionsArray.hpp.

References Array< T >::getSize(), and Array< T >::ptr.

Referenced by barray_append().

25  {
26  Array<bool> out_arr(in_arr.getSize() + 1);
27  // cast bool array storage to int8_t type to mask null elem correctly
28  auto casted_out_arr = (int8_t*)out_arr.ptr;
29  for (int64_t i = 0; i < in_arr.getSize(); i++) {
30  casted_out_arr[i] = in_arr(i);
31  }
32  casted_out_arr[in_arr.getSize()] = val;
33  return out_arr;
34 }
DEVICE int64_t getSize() const
Definition: heavydbTypes.h:231
T * ptr
Definition: heavydbTypes.h:199

+ Here is the call graph for this function:

+ Here is the caller graph for this function: