Define matrices in an array element C++

  4d, arrays, c++, matrix

I have written some c++ code that receives a Matrix as input and now I want to create a 2D array with matrices in each element so that I can send the individual matrices to the function.

typedef vector< vector > Matrix;
double a[2][2] = Matrix(2, vector(2));

so that each element of a is a 2×2 Matrix.

The reason I don’t want to just create a 4D array with vectors is that I want to keep all of the original functions that I have already created with matrices as input.

Any way this is possible?

Source: Windows Questions C++

LEAVE A COMMENT