OmniSciDB  471d68cefb
 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)
 

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(), and i.

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: OmniSciTypes.h:91

+ 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(), i, 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: OmniSciTypes.h:91
T * ptr
Definition: OmniSciTypes.h:67

+ Here is the call graph for this function:

+ Here is the caller graph for this function: