Boost logo

Boost Users :

From: Olivier Tournaire (olitour_at_[hidden])
Date: 2007-12-12 17:42:28


Thank you Eric. I finally found the answer thanks to the doc. However in
the doc, you use

typedef iterator_range<std::vector<std::pair<double, double> >::iterator
histogram_type;

And it does not compile because iterator_range is in the boost namespace
that I did not defined earlier. I had to declare the histogram_type this
way :

typedef boost::iterator_range<std::vector<std::pair<double, double>
>::iterator histogram_type;
And, finally, extract the result

histogram_type histogram = density(angular_acc);

Now, it works and compile fine. Thank you for this very usefull lib !

Regards,

Olivier

Eric Niebler a écrit :
> Olivier Tournaire wrote:
>
>> Thank you Eric, it now compiles fine.
>> However, I am still having problem to acces the histogram :
>>
>> typedef iterator_range<std::vector<std::pair<double, double> >::iterator
>> > histogram_type;
>> histogram_type histogram =
>> tag::density(angular_acc); // error C2143: erreur de syntaxe : absence
>> de ';' avant '<' (--> "syntax error : missing ';' before '<'")
>>
>
> Your problem is here, but I bet you can find it yourself if you read the
> docs on extracting results: http://tinyurl.com/2q2ttl
> (http://boost-sandbox.sourceforge.net/libs/accumulators/doc/html/accumulators/user_s_guide.html#accumulators.user_s_guide.the_accumulators_framework.extracting_results)
>
> Hint: feature tags are in the "tags" namespace, but extractors are not.
>
> And for the return type of the density extractor, you should look at the
> docs for density: http://tinyurl.com/3ycetz
> (http://boost-sandbox.sourceforge.net/libs/accumulators/doc/html/accumulators/user_s_guide/the_statistical_accumulators_library.html#accumulators.user_s_guide.the_statistical_accumulators_library.density)
>
>

-- 
Le temps des cerises reviendra. Dans l'immédiat, c'est le temps des noyaux. Courage.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net