create matrix cpp

Solutions on MaxInterview for create matrix cpp by the best coders in the world

showing results for - "create matrix cpp"
Nikita
25 Sep 2016
1typedef std::vector<std::vector<double> > Matrix;
2//with initialization
3Matrix matrix1 = { {0.1,1.1,.2},
4                 {.4,.5,.6}, 
5                 {.8,.9,.10}
6                };
7//just initiation (3x3)
8Matrix matrix2(3, std::vector<double>(3) );