c++ - "Tricks" to filling a "rolling" time-series array absent brute-force pushback of all values each iteration -



c++ - "Tricks" to filling a "rolling" time-series array absent brute-force pushback of all values each iteration -

my applications financial, in c++, visual studio 2003.

i'm trying maintain array of lastly (x) values observation, , each new value arrives have loop first force of other values add together new value in front.

it's computationally intensive, , i've been trying clever , come way around this. i've either stated oxymoronic problem or reached limit of intellect, or both.

here's thought have:

suppose it's 60 seconds of data, , new info arrive each second. suppose have integer between 0 , 59, serve index element of array. suppose each second, when info arrives, first iterate integer overwrite element of array @ index new data. then, suppose in our calculations, refer same integer base, work backwards zero, 59 downwards again. formulas in math bit more tedious write. application lot of these pushback/fills of arrays, each sec several info points, , each array having 3600 elements per info series (one hr of seconds).

does board think idea? or beingness silly here?

what you're describing nil more circular buffer. there's implementation in boost, , in other libraries well, , algorithm description on wikipedia (http://en.wikipedia.org/wiki/circular_buffer).

and yes, it's solution problem describe.

c++ arrays

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -