By Daniel · January 1, 2009
Returns the transpose of some matrix M. This should be a ds_grid filled with real entries.
/* matrix_transpose(M)
*
* Returns the transpose of some matrix M. This should be a ds_grid filled
* with real entries.
*/
var w, h, T, xx, yy;
w = ds_grid_height(argument0);
h = ds_grid_width(argument0);
T = ds_grid_create(w, h);
for (xx = 0; xx < w; xx += 1)
for (yy = 0; yy < h; yy += 1)
ds_grid_set(T, xx, yy, ds_grid_get(argument0, yy, xx));
return T;
Categories: Mathematics
There are no comments to display.
You must be signed in to post comments.