#ifndef _MATHS_H_ #define _MATHS_H_ #include #include #include #include using json = nlohmann::json; #include "../connections/common/common.h" #include "../connections/sql/db_handle.h" namespace norm { float norm(cycle_t); cycle_t history_to_cycle(ws_msg_parsed); cycle_t diff_vector(cycle_t, cycle_t); std::map diff_all( pqxx::connection *C, cycle_t base_cycle, std::map cycles, std::vector userid_list, long ts_high, long ts_low, float threshold); std::map> diff_map( pqxx::connection *C, std::vector userid_list, long, long, float); void diff_save_json( pqxx::connection *, std::map>); } namespace optimizer{ std::tuple get_last_nth_cycle_ts(int); float get_last_n_weighted_slope( pqxx::connection*, std::string, int, int); } #endif