I am trying to calculate the correlation and store the values in an array of arrays. It seems like the problem is filling vectors into a vector. I have tried some solutions but no luck. I appreciate your help.
void BuildCorrelationForMatrix()
{
std::vector<std::unique_ptr<correlation>> m_correlationMatrix;
std::vector<std::vector<float>> m_correlationValues;
std::vector<float> row_values;
float value_inrow ;
for(int col_idx = 0; col_idx < (int) m_correlationData.size(); ++col_idx){
for(int col_idy = 0; col_idy < (int) m_correlationData.size();++col_idy){
auto data1= m_correlationData[col_idx];
auto data2= m_correlationData[col_idy];
m_correlationMatrix.push_back(std::make_unique<correlation>(data1, data2);
value_inrow = m_correlationMatrix[col_idy]->CalculateCorrelation();
row_values.push_back(value_inrow);
// m_correlationValues[col_idx][col_idy]=value_inrow; //not works
}
m_correlationValues[col_idx].push_back(row_values); // problem is here!
//m_correlationValues[col_idx]=row_values; // not works
}
}