Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7985693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:37:44+00:00 2026-06-04T11:37:44+00:00

I have recently discovered the excellent library boost::accumulators, and I would like to use

  • 0

I have recently discovered the excellent library boost::accumulators, and I would like to use it to replace some of my code that accumulates statistics.

One thing I cannot find in the documentation is the ability to sum two accumulator sets, as in operator+=

Example:

using namespace boost::accumulators;
typedef accumulator_set<double, features<tag::variance> > AccumSet;

class Foo {
    AccumSet acc;
public:
    Foo& operator+=(const Foo& that) {
        this->acc += that.acc; // error! no such operator
        return *this;
    }
    double GetVariance() { return variance(acc); }
};

How can I achieve this using the available API? I don’t know if this can be implemented for all the types of accumulators in the library (maybe not for tail), but it sure can be for important things, like count, sum, mean, moment, covariance, etc

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:37:45+00:00Added an answer on June 4, 2026 at 11:37 am

    Unfortunately, this feature is not provided by Boost.Accumulators, probably because combining would only work for some statistics.

    There is a ticket on the Boost tracker asking for such a combine function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently discovered that my ScrollPane class code hinting is completely missing. Nevertheless,
I have discovered recently that's possible to call anoymous blocks from jdbc like this:
I'm using libsvm library in my project and have recently discovered that it provides
I have recently discovered that I am affected by this bug http://www.mail-archive.com/mono-bugs@lists.ximian.com/msg71515.html Well, at
I have recently discovered the ability to use WHERE clauses within indexes in SQL
I recently discovered that when you have a page set to session readonly and
I recently discovered that all Windows 7 machines have an handwriting recognition API within
I've recently discovered that MVC is supposed to have two different flavors, model one
I recently have discovered a warning happening in Firefox that says Warning: Unknown pseudo-class
I have a rather large DBML file and recently discovered that Visual Studio's MSLinqToSQLGenerator

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.