Changes between Version 8 and Version 9 of LibrariesUnderConstruction
- Timestamp:
- Jan 3, 2009, 9:03:29 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
LibrariesUnderConstruction
v8 v9 316 316 317 317 --------------------------------------------------------------------------------------------------- 318 == !Accummulators Ext ==318 == !Accummulators.Ext == 319 319 * '''Suggested by:''' Vicente J. Botet Escriba 320 320 * '''Description:''' Adding sliding, dependable and cyclic accumulators to Boost.Accumulators. … … 364 364 operator+()(dependable_accumulator_set<T,F,W>,dependable_accumulator_set<T,F,W>); 365 365 }}} 366 In addition another variant could allow to cumulate on a sliding window, e.g. on the last N cumulated values. There is already a tail accumulator, but I don't know how to define a min_tail accumulator with the current framework. This class could behaves like: 367 {{{ 368 #!cpp 369 typedef sliding_accumulator_set <double, ...> sliding_acc_type; 370 sliding_acc_type c(window=2); 371 c(1); 372 c(5); 373 c(2); 374 assert(count(c)==3); 375 assert(sum(c)==7); 376 assert(min(c)==2); 377 }}} 378 We can state the sliding window at compile (template parameter) or run time 379 (constructor parameter). 380 {{{ 381 #!cpp 382 template <std::size Window, typename T, typename F, typename W> 383 class static_sliding_accumulator_set; 384 385 template <typename T, typename F, typename W> 386 class sliding_accumulator_set; 387 }}} 388 Of course the complexity of the sliding accumulators operations is increased. 366 389 367 Another variant could be also to have a temporary accumulator that cyclically push its current value on another accumulator. 390 It will also interesting to have a sliding, dependable and cyclic accumulator set. It would be great to integrate these features on a unique class (accumulator_set?) in a clean way. 368 369 It will also interesting to have a dependable and cyclic accumulator set. It would be great to integrate these features on a unique class (accumulator_set?) in a clean way. 391 370 {{{ 392 371 #!cpp 393 372 template <typename T, typename F, typename W, 394 373 typename DependablePolicy, 395 typename SlicingPolicy,396 374 typename CyclicPolicy> 397 375 class accumulator_set; … … 472 450 --------------------------------------------------------------------------------------------------- 473 451 == Math and numerics == 474 * [#Accummulators Ext AccummulatorsExt]452 * [#Accummulators.Ext Accummulators.Ext] 475 453 * [#Boost.Euclid Euclid] 476 454