I'm trying to populate an arma::mat data_mat(n,n) from a streaming data of size n in each time step. Its a high frequency real time system. So, efficiency and thread safety are very important design goals. With this in mind, 1) What is the best (efficient,threadsafe) way to populate the data_mat with a vector (double/float) in each time step until it is finished populating n rows. 2)After n rows are populated,the rows should be circularly buffered with row elements being shifted upward or downward.
I can do it for a column using data_mat.col(i)=vec however, there is no such method for rows And I'm emulating circular buffer by copying in a loop but I guess its not very efficient. Any advice would be highly appreciated.
Aucun commentaire:
Enregistrer un commentaire