MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / ArgMax

Method ArgMax

include/LightGBM/utils/array_args.h:52–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 return ret;
51 }
52 inline static size_t ArgMax(const std::vector<VAL_T>& array) {
53 if (array.empty()) {
54 return 0;
55 }
56 if (array.size() > 1024) {
57 return ArgMaxMT(array);
58 } else {
59 size_t arg_max = 0;
60 for (size_t i = 1; i < array.size(); ++i) {
61 if (array[i] > array[arg_max]) {
62 arg_max = i;
63 }
64 }
65 return arg_max;
66 }
67 }
68
69 inline static size_t ArgMin(const std::vector<VAL_T>& array) {
70 if (array.empty()) {

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected