Skip to content

Commit

Permalink
Implement visitors for creating statistics backed by a `BitDecomposab…
Browse files Browse the repository at this point in the history
…leStatisticView`.
  • Loading branch information
michael-rapp committed Aug 30, 2024
1 parent 29aad72 commit 1c84a97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ namespace boosting {
};
auto bitDecomposableMatrixVisitor =
[&](std::unique_ptr<IQuantizationMatrix<BitDecomposableStatisticView>>& quantizationMatrixPtr) {
// TODO Implement
throw std::runtime_error("not implemented");
statisticsPtr = std::make_unique<
DenseDecomposableStatistics<Loss, OutputMatrix, IQuantizationMatrix<BitDecomposableStatisticView>,
BitDecomposableStatisticVector, EvaluationMeasure>>(
std::move(quantizationMatrixPtr), std::move(lossPtr), std::move(evaluationMeasurePtr),
ruleEvaluationFactory, outputMatrix, std::move(statisticMatrixPtr), std::move(scoreMatrixPtr));
};
quantizationPtr->visitQuantizationMatrix(denseDecomposableMatrixVisitor, bitDecomposableMatrixVisitor, {}, {});
return statisticsPtr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,12 @@ namespace boosting {
};
auto bitDecomposableMatrixVisitor =
[&](std::unique_ptr<IQuantizationMatrix<BitDecomposableStatisticView>>& quantizationMatrixPtr) {
// TODO Implement
throw std::runtime_error("not implemented");
statisticsPtr = std::make_unique<
DenseDecomposableStatistics<Loss, OutputMatrix, IQuantizationMatrix<BitDecomposableStatisticView>,
BitDecomposableStatisticVector, EvaluationMeasure>>(
std::move(quantizationMatrixPtr), std::move(this->lossPtr_),
std::move(this->evaluationMeasurePtr_), ruleEvaluationFactory, this->outputMatrix_,
std::move(decomposableStatisticMatrixPtr), std::move(this->scoreMatrixPtr_));
};
quantizationPtr->visitQuantizationMatrix(denseDecomposableMatrixVisitor, bitDecomposableMatrixVisitor,
{}, {});
Expand Down

0 comments on commit 1c84a97

Please sign in to comment.