Modify

Opened 3 years ago

Last modified 3 years ago

#11441 new Bugs

Documentation sample error

Reported by: ampoznyak@… Owned by: Eric Niebler
Milestone: To Be Determined Component: accumulator
Version: Boost 1.58.0 Severity: Not Applicable
Keywords: Cc:

Description

User'd guide.

Accumulators sample program:

#include <iostream> #include <boost/accumulators/accumulators.hpp> #include <boost/accumulators/statistics/stats.hpp> #include <boost/accumulators/statistics/mean.hpp> #include <boost/accumulators/statistics/moment.hpp> using namespace boost::accumulators;

int main() {

Define an accumulator set for calculating the mean and the 2nd moment ... accumulator_set<double, stats<tag::mean, tag::moment<2> > > acc;

push in some data ... acc(1.2); acc(2.3); acc(3.4); acc(4.5);

Display the results ... std::cout << "Mean: " << mean(acc) << std::endl; std::cout << "Moment: " << accumulators::moment<2>(acc) << std::endl;

return 0;

}

In a line "std::cout << "Moment: " << accumulators::moment<2>(acc) << std::endl;" name of namespace "accumulators" should be removed because namespace "accumulators" is already used.

Attachments (0)

Change History (1)

comment:1 Changed 3 years ago by Daniel James

Component: Documentationaccumulator
Owner: changed from Matias Capeletto to Eric Niebler

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Eric Niebler.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.