|
Boost Users : |
Subject: [Boost-users] multi-index:Q - Space and time efficiency
From: dhruva (dhruva_at_[hidden])
Date: 2009-03-27 02:02:45
Hi,
I have a struct with 2 members as follows:
typedef struct time_series {
time_t _time;
double _value;
} time_series_t;
The data I get is sorted by time as it is a time series. I would like to maintain another index sorted by value. Since I need to keep removing the oldest records, I need the time based order and since I need to compute percentile, I need to sort it based on value. Would using multi-index save space (and time in insertion and removal) compared to having 2 vectors with different sort order?
This is related to my implementation of percentile using boost::accumulators. I could not use the 'tail' or other equivalents as they expect window size (number of data) in advance and I will not know that. Hence, I need a container that can grow.
-dhruva
Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
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