Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<vector<float>> transpose(vector<vector<float>> input){
- float input_rows = input.size();
- float input_cols = input[0].size();
- vector<vector<float>> output (input_cols, vector<float>(input_rows));
- for(short i = 0; i < input_rows;){
- for(short k = 0; k < input_cols;){
- output[k][i] = input[i][k];
- ++k;
- }
- ++i;
- }
- return output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement