Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused BinMapper::SizeForSpecificBin() #4643

Merged
merged 3 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions include/LightGBM/bin.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,6 @@ class BinMapper {
void FindBin(double* values, int num_values, size_t total_sample_cnt, int max_bin, int min_data_in_bin, int min_split_data, bool pre_filter, BinType bin_type,
bool use_missing, bool zero_as_missing, const std::vector<double>& forced_upper_bounds);

/*!
* \brief Use specific number of bin to calculate the size of this class
* \param bin The number of bin
* \return Size
*/
static int SizeForSpecificBin(int bin);

/*!
* \brief Serializing this object to buffer
* \param buffer The destination
Expand Down
15 changes: 0 additions & 15 deletions src/io/bin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,21 +519,6 @@ namespace LightGBM {
}
}


int BinMapper::SizeForSpecificBin(int bin) {
int size = 0;
size += static_cast<int>(VirtualFileWriter::AlignedSize(sizeof(int)));
size +=
static_cast<int>(VirtualFileWriter::AlignedSize(sizeof(MissingType)));
size += static_cast<int>(VirtualFileWriter::AlignedSize(sizeof(bool)));
size += sizeof(double);
size += static_cast<int>(VirtualFileWriter::AlignedSize(sizeof(BinType)));
size += 2 * sizeof(double);
size += bin * sizeof(double);
size += static_cast<int>(VirtualFileWriter::AlignedSize(sizeof(uint32_t))) * 2;
return size;
}

void BinMapper::CopyTo(char * buffer) const {
std::memcpy(buffer, &num_bin_, sizeof(num_bin_));
buffer += VirtualFileWriter::AlignedSize(sizeof(num_bin_));
Expand Down