Changes between Version 9 and Version 10 of soc/2007/VisualizationOfContainers


Ignore:
Timestamp:
Jun 4, 2007, 1:44:25 PM (15 years ago)
Author:
Matias Capeletto
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • soc/2007/VisualizationOfContainers

    v9 v10  
    9595''By Matias Capaletto:''
    9696 * Be able to choose a log scale for either the X or the Y axis
     97 * Proposal to include a plugable extractor to `plot_range()`
     98
     99   In general, containers will store other things than double. Starting simple, I want to be able to
     100   plot `std::vector<int>`. This is very easy to support. Add a function:
     101
     102   {{{
     103   #!cpp
     104   template<class Iter, class DoubleExtractor >
     105   plot& plot_range( Iter start, Iter end, DoubleExtractor double_extractor)
     106   {
     107       return your_old_plot_range(
     108          boost::make_transform_iterator(start, double_extractor),
     109          boost::make_transform_iterator(end  , double_extractor)
     110       );
     111   }
     112   }}}   
     113
     114   This have other implications, for example if we have list<Human> hl, and struct get_age_functor { ... };
     115   We can:
     116
     117   {{{
     118   #!cpp
     119   svg << plot_range( hl.begin(), hl.end(), get_age_functor() ); // fun stuff :)
     120   }}}
    97121
    98122''By Paul Bristow''