OmniSciDB  a5dc49c757
 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 >::size().

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.size() + 1);
15  for (size_t i = 0; i < in_arr.size(); i++) {
16  out_arr[i] = in_arr(i);
17  }
18  out_arr[in_arr.size()] = val;
19  return out_arr;
20 }
DEVICE ALWAYS_INLINE size_t size() const
Definition: heavydbTypes.h:520

+ 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 >::isNull(), and Array< T >::size().

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.size();
39  Array<T> out_arr(sz / 2, in_arr.isNull());
40  for (size_t i = 0; i < sz / 2; i++) {
41  out_arr[i] = in_arr(i);
42  }
43  return out_arr;
44 }
DEVICE ALWAYS_INLINE size_t size() const
Definition: heavydbTypes.h:520
DEVICE bool isNull() const
Definition: heavydbTypes.h:556

+ 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 >::isNull(), and Array< T >::size().

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.size();
49  Array<T> out_arr(sz - sz / 2, in_arr.isNull());
50  for (size_t i = sz / 2; i < sz; i++) {
51  out_arr[i - sz / 2] = in_arr(i);
52  }
53  return out_arr;
54 }
DEVICE ALWAYS_INLINE size_t size() const
Definition: heavydbTypes.h:520
DEVICE bool isNull() const
Definition: heavydbTypes.h:556

+ 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 >::data(), and Array< T >::size().

Referenced by barray_append().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function: