Skip to content

Commit

Permalink
add debug check for increasing cut indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbkoch committed Dec 25, 2024
1 parent fcb70c2 commit 81a2f83
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions shared/libebm/PartitionOneDimensionalBoosting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,16 @@ static ErrorEbm Flatten(BoosterShell* const pBoosterShell,

EBM_ASSERT(bNominal || pSplit == cSlices - 1 + pInnerTermUpdate->GetSplitPointer(iDimension));

#ifndef NDEBUG
UIntSplit prevDebug = 0;
for(size_t iDebug = 0; iDebug < cSlices - 1; ++iDebug) {
UIntSplit curDebug = pInnerTermUpdate->GetSplitPointer(iDimension)[iDebug];
EBM_ASSERT(prevDebug < curDebug);
prevDebug = curDebug;
}
EBM_ASSERT(prevDebug < cBins);
#endif

LOG_0(Trace_Verbose, "Exited Flatten");
return Error_None;
}
Expand Down

0 comments on commit 81a2f83

Please sign in to comment.