Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
vlvovch committed Aug 1, 2024
2 parents 74d1c8e + c98820e commit 9b44829
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/NumberStatistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,17 @@ namespace SampleMoments {
CalculateMoments();
}

/// Set the moments externally
void SetMomentSumsExternally(const std::vector<double> &momentSums, int64_t nobservations) {
Reset(momentSums.size() + 1);
m_MomentSums[0] = static_cast<double>(nobservations);
for(int i = 0; i < momentSums.size(); ++i) {
m_MomentSums[i + 1] = momentSums[i];
}
m_NumberOfObservations = nobservations;
m_MomentsComputed = false;
}

protected:
/// Pre-compute the needed binomial coefficients
void CalculateBinomialCoefficients() {
Expand Down

0 comments on commit 9b44829

Please sign in to comment.