23 #include <shared_mutex>
26 #include <unordered_map>
31 #ifdef HAVE_SYSTEM_TFS
39 #else // Define stubs to allow build to complete when ENABLE_SYSTEM_TFS=off.
43 throw std::runtime_error(
"Table function called but built with ENABLE_SYSTEM_TFS=off.");
47 throw std::runtime_error(
"Table function called but built with ENABLE_SYSTEM_TFS=off.");
63 const int64_t num_rows,
70 const int64_t num_rows,
72 const double std_dev);
77 const int64_t num_rows);
82 const std::vector<T>&
means,
93 const std::vector<T*>& input_data,
94 const int64_t num_rows);
102 template <
typename T1,
typename T2>
104 distance_in_meters(
const T1 fromlon,
const T1 fromlat,
const T2 tolon,
const T2 tolat);
108 const int64_t num_x_bins) {
109 return y_bin * num_x_bins + x_bin;
113 const int64_t num_x_bins) {
114 return std::make_pair(bin % num_x_bins, bin / num_x_bins);
117 namespace FileUtilities {
118 std::vector<std::filesystem::path>
get_fs_paths(
const std::string& file_or_directory);
125 template <
typename T>
NEVER_INLINE HOST std::pair< T, T > get_column_min_max(const Column< T > &col)
void z_std_normalize_col(const T *input_data, T *output_data, const int64_t num_rows, const double mean, const double std_dev)
std::vector< std::filesystem::path > get_fs_paths(const std::string &file_or_directory)
std::vector< std::vector< T > > normalized_data
ZStdNormalizationSummaryStats(const std::vector< std::vector< T >> &normalized_data, const std::vector< T > &means, const std::vector< T > &std_devs)
int64_t x_y_bin_to_bin_index(const int64_t x_bin, const int64_t y_bin, const int64_t num_x_bins)
std::vector< T > std_devs
std::pair< int64_t, int64_t > bin_to_x_y_bin_indexes(const int64_t bin, const int64_t num_x_bins)
EXTENSION_NOINLINE double distance_in_meters(const double fromlon, const double fromlat, const double tolon, const double tolat)
Computes the distance, in meters, between two WGS-84 positions.
NEVER_INLINE HOST std::tuple< T, T, bool > get_column_metadata(const Column< T > &col)
std::vector< std::vector< T > > z_std_normalize_data(const std::vector< T * > &input_data, const int64_t num_rows)
NEVER_INLINE HOST double get_column_std_dev(const Column< T > &col, const double mean)
ZStdNormalizationSummaryStats< T > z_std_normalize_data_with_summary_stats(const std::vector< T * > &input_data, const int64_t num_rows)
NEVER_INLINE HOST bool is_valid_tf_input(const T input, const T bounds_val, const BoundsType bounds_type, const IntervalType interval_type)
NEVER_INLINE HOST double get_column_mean(const T *data, const int64_t num_rows)