mercredi 17 août 2016

Efficient copying/casting of large matrix std::vector

Is there an efficient copying mechanism between

            std::vector<std::vector<double>> std_mat 
            arma::mat arma_mat

where arma::mat arma_mat refers to armadillo matrix/math library.

http://ift.tt/1fZC3nb

My project is dependent on two separate matrix/data acquisition libraries where matrix is defined as above respectively. However, at certain stage of the processing pipeline, I need to copy one to another to avoid breaking legacy code. I'm wondering if there is some kind of casting operator from one to the other (so we don't have to copy) or if not, an efficient copying mechanism (something similar to the vector.emplace_back concept). Right now I'm using a double for loop but I believe it can be more efficient.

Aucun commentaire:

Enregistrer un commentaire