Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Iterate over multiple vectors of uneven Mat


I have two vectors with uneven Mat

vector<Mat> delta_nabla_w = GetWeightsMatDelta();  // [Mat(10, 20), Mat(20, 40), Mat(40, 10)]
vector<Mat> nabla_w = GetWeightsMatZeros(); // [Mat(10, 20), Mat(20, 40), Mat(40, 10)]

I need to iterate over both of them at the same time and sum them up. I've tried this:

for(int j = 0; j < nabla_w.size(); j++) {<Mat>(j) +=<Mat>(j);

But it gives me an error Mat does not refer to a value, which kind of make sense. Could you please help me on this one?