@@ -922,10 +922,10 @@ using LightGBM::SingleRowPredictor;
922922// some help functions used to convert data
923923
924924std::function<std::vector<double >(int row_idx)>
925- RowFunctionFromDenseMatric (const void * data, int num_row, int num_col, int data_type, int is_row_major);
925+ RowFunctionFromDenseMatrix (const void * data, int num_row, int num_col, int data_type, int is_row_major);
926926
927927std::function<std::vector<std::pair<int , double >>(int row_idx)>
928- RowPairFunctionFromDenseMatric (const void * data, int num_row, int num_col, int data_type, int is_row_major);
928+ RowPairFunctionFromDenseMatrix (const void * data, int num_row, int num_col, int data_type, int is_row_major);
929929
930930std::function<std::vector<std::pair<int , double >>(int row_idx)>
931931RowPairFunctionFromDenseRows (const void ** data, int num_col, int data_type);
@@ -1140,7 +1140,7 @@ int LGBM_DatasetPushRows(DatasetHandle dataset,
11401140 int32_t start_row) {
11411141 API_BEGIN ();
11421142 auto p_dataset = reinterpret_cast <Dataset*>(dataset);
1143- auto get_row_fun = RowFunctionFromDenseMatric (data, nrow, ncol, data_type, 1 );
1143+ auto get_row_fun = RowFunctionFromDenseMatrix (data, nrow, ncol, data_type, 1 );
11441144 if (p_dataset->has_raw ()) {
11451145 p_dataset->ResizeRaw (p_dataset->num_numeric_features () + nrow);
11461146 }
@@ -1179,7 +1179,7 @@ int LGBM_DatasetPushRowsWithMetadata(DatasetHandle dataset,
11791179 Log::Fatal (" data cannot be null." );
11801180 }
11811181 auto p_dataset = reinterpret_cast <Dataset*>(dataset);
1182- auto get_row_fun = RowFunctionFromDenseMatric (data, nrow, ncol, data_type, 1 );
1182+ auto get_row_fun = RowFunctionFromDenseMatrix (data, nrow, ncol, data_type, 1 );
11831183 if (p_dataset->has_raw ()) {
11841184 p_dataset->ResizeRaw (p_dataset->num_numeric_features () + nrow);
11851185 }
@@ -1344,7 +1344,7 @@ int LGBM_DatasetCreateFromMats(int32_t nmat,
13441344
13451345 std::vector<std::function<std::vector<double >(int row_idx)>> get_row_fun;
13461346 for (int j = 0 ; j < nmat; ++j) {
1347- get_row_fun.push_back (RowFunctionFromDenseMatric (data[j], nrow[j], ncol, data_type, is_row_major[j]));
1347+ get_row_fun.push_back (RowFunctionFromDenseMatrix (data[j], nrow[j], ncol, data_type, is_row_major[j]));
13481348 }
13491349
13501350 if (reference == nullptr ) {
@@ -1614,7 +1614,7 @@ int LGBM_DatasetCreateFromCSC(const void* col_ptr,
16141614 continue ;
16151615 }
16161616 int group = ret->Feature2Group (feature_idx);
1617- int sub_feature = ret->Feture2SubFeature (feature_idx);
1617+ int sub_feature = ret->Feature2SubFeature (feature_idx);
16181618 CSC_RowIterator col_it (col_ptr, col_ptr_type, indices, data, data_type, ncol_ptr, nelem, i);
16191619 auto bin_mapper = ret->FeatureBinMapper (feature_idx);
16201620 if (bin_mapper->GetDefaultBin () == bin_mapper->GetMostFreqBin ()) {
@@ -2531,7 +2531,7 @@ int LGBM_BoosterPredictForMat(BoosterHandle handle,
25312531 config.Set (param);
25322532 OMP_SET_NUM_THREADS (config.num_threads );
25332533 Booster* ref_booster = reinterpret_cast <Booster*>(handle);
2534- auto get_row_fun = RowPairFunctionFromDenseMatric (data, nrow, ncol, data_type, is_row_major);
2534+ auto get_row_fun = RowPairFunctionFromDenseMatrix (data, nrow, ncol, data_type, is_row_major);
25352535 ref_booster->Predict (start_iteration, num_iteration, predict_type, nrow, ncol, get_row_fun,
25362536 config, out_result, out_len);
25372537 API_END ();
@@ -2554,7 +2554,7 @@ int LGBM_BoosterPredictForMatSingleRow(BoosterHandle handle,
25542554 config.Set (param);
25552555 OMP_SET_NUM_THREADS (config.num_threads );
25562556 Booster* ref_booster = reinterpret_cast <Booster*>(handle);
2557- auto get_row_fun = RowPairFunctionFromDenseMatric (data, 1 , ncol, data_type, is_row_major);
2557+ auto get_row_fun = RowPairFunctionFromDenseMatrix (data, 1 , ncol, data_type, is_row_major);
25582558 ref_booster->SetSingleRowPredictorInner (start_iteration, num_iteration, predict_type, config);
25592559 ref_booster->PredictSingleRow (predict_type, ncol, get_row_fun, config, out_result, out_len);
25602560 API_END ();
@@ -2587,7 +2587,7 @@ int LGBM_BoosterPredictForMatSingleRowFast(FastConfigHandle fastConfig_handle,
25872587 API_BEGIN ();
25882588 SingleRowPredictor *single_row_predictor = reinterpret_cast <SingleRowPredictor*>(fastConfig_handle);
25892589 // Single row in row-major format:
2590- auto get_row_fun = RowPairFunctionFromDenseMatric (data, 1 , single_row_predictor->num_cols , single_row_predictor->data_type , 1 );
2590+ auto get_row_fun = RowPairFunctionFromDenseMatrix (data, 1 , single_row_predictor->num_cols , single_row_predictor->data_type , 1 );
25912591 single_row_predictor->Predict (get_row_fun, out_result, out_len);
25922592 API_END ();
25932593}
@@ -2819,7 +2819,7 @@ int LGBM_GetMaxThreads(int* out) {
28192819
28202820template <typename T>
28212821std::function<std::vector<double >(int row_idx)>
2822- RowFunctionFromDenseMatric_helper (const void * data, int num_row, int num_col, int is_row_major) {
2822+ RowFunctionFromDenseMatrix_helper (const void * data, int num_row, int num_col, int is_row_major) {
28232823 const T* data_ptr = reinterpret_cast <const T*>(data);
28242824 if (is_row_major) {
28252825 return [=] (int row_idx) {
@@ -2842,19 +2842,19 @@ RowFunctionFromDenseMatric_helper(const void* data, int num_row, int num_col, in
28422842}
28432843
28442844std::function<std::vector<double >(int row_idx)>
2845- RowFunctionFromDenseMatric (const void * data, int num_row, int num_col, int data_type, int is_row_major) {
2845+ RowFunctionFromDenseMatrix (const void * data, int num_row, int num_col, int data_type, int is_row_major) {
28462846 if (data_type == C_API_DTYPE_FLOAT32) {
2847- return RowFunctionFromDenseMatric_helper <float >(data, num_row, num_col, is_row_major);
2847+ return RowFunctionFromDenseMatrix_helper <float >(data, num_row, num_col, is_row_major);
28482848 } else if (data_type == C_API_DTYPE_FLOAT64) {
2849- return RowFunctionFromDenseMatric_helper <double >(data, num_row, num_col, is_row_major);
2849+ return RowFunctionFromDenseMatrix_helper <double >(data, num_row, num_col, is_row_major);
28502850 }
2851- Log::Fatal (" Unknown data type in RowFunctionFromDenseMatric " );
2851+ Log::Fatal (" Unknown data type in RowFunctionFromDenseMatrix " );
28522852 return nullptr ;
28532853}
28542854
28552855std::function<std::vector<std::pair<int , double >>(int row_idx)>
2856- RowPairFunctionFromDenseMatric (const void * data, int num_row, int num_col, int data_type, int is_row_major) {
2857- auto inner_function = RowFunctionFromDenseMatric (data, num_row, num_col, data_type, is_row_major);
2856+ RowPairFunctionFromDenseMatrix (const void * data, int num_row, int num_col, int data_type, int is_row_major) {
2857+ auto inner_function = RowFunctionFromDenseMatrix (data, num_row, num_col, data_type, is_row_major);
28582858 if (inner_function != nullptr ) {
28592859 return [inner_function] (int row_idx) {
28602860 auto raw_values = inner_function (row_idx);
@@ -2875,7 +2875,7 @@ RowPairFunctionFromDenseMatric(const void* data, int num_row, int num_col, int d
28752875std::function<std::vector<std::pair<int , double >>(int row_idx)>
28762876RowPairFunctionFromDenseRows (const void ** data, int num_col, int data_type) {
28772877 return [=](int row_idx) {
2878- auto inner_function = RowFunctionFromDenseMatric (data[row_idx], 1 , num_col, data_type, /* is_row_major */ true );
2878+ auto inner_function = RowFunctionFromDenseMatrix (data[row_idx], 1 , num_col, data_type, /* is_row_major */ true );
28792879 auto raw_values = inner_function (0 );
28802880 std::vector<std::pair<int , double >> ret;
28812881 ret.reserve (raw_values.size ());
0 commit comments