/
githubmirror
/
the-algorithm
Обзор
Документация
Войти
/
githubmirror
/
the-algorithm
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
twml/libtwml/src/lib/internal/linear_search.h
17 строк
353 B
twitter-team
Twitter Recommendation Algorithm
01 апр 2023, 01:36
01 апр 2023, 01:36
ef4c5eb
Код
Авторство
О чём код?
#pragma once #ifdef __cplusplus #include <twml/optim.h> namespace twml { template<typename Tx> static int64_t linear_search(const Tx *xsData, const Tx val, const int64_t mainSize) { int64_t left = 0; int64_t right = mainSize-1; while(left <= right && val > xsData[left]) left++; return left; } } // namespace twml #endif