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

Function LGBM_BoosterUpdateOneIterCustom_R

src/lightgbm_R.cpp:390–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390LGBM_SE LGBM_BoosterUpdateOneIterCustom_R(LGBM_SE handle,
391 LGBM_SE grad,
392 LGBM_SE hess,
393 LGBM_SE len,
394 LGBM_SE call_state) {
395 int is_finished = 0;
396 R_API_BEGIN();
397 int int_len = R_AS_INT(len);
398 std::vector<float> tgrad(int_len), thess(int_len);
399#pragma omp parallel for schedule(static)
400 for (int j = 0; j < int_len; ++j) {
401 tgrad[j] = static_cast<float>(R_REAL_PTR(grad)[j]);
402 thess[j] = static_cast<float>(R_REAL_PTR(hess)[j]);
403 }
404 CHECK_CALL(LGBM_BoosterUpdateOneIterCustom(R_GET_PTR(handle), tgrad.data(), thess.data(), &is_finished));
405 R_API_END();
406}
407
408LGBM_SE LGBM_BoosterRollbackOneIter_R(LGBM_SE handle,
409 LGBM_SE call_state) {

Callers

nothing calls this directly

Calls 3

dataMethod · 0.80
R_GET_PTRFunction · 0.50

Tested by

no test coverage detected