16 lines
508 B
Plaintext
16 lines
508 B
Plaintext
/* Matrix transposition, in Jsish */
|
|
require('Matrix');
|
|
|
|
if (Interp.conf('unitTest')) {
|
|
var m = new Matrix([[1,1,1,1],[2,4,8,16],[3,9,27,81],[4,16,64,256],[5,25,125,625]]);
|
|
; m;
|
|
; m.transpose();
|
|
}
|
|
|
|
/*
|
|
=!EXPECTSTART!=
|
|
m ==> { height:5, mtx:[ [ 1, 1, 1, 1 ], [ 2, 4, 8, 16 ], [ 3, 9, 27, 81 ], [ 4, 16, 64, 256 ], [ 5, 25, 125, 625 ] ], width:4 }
|
|
m.transpose() ==> { height:4, mtx:[ [ 1, 2, 3, 4, 5 ], [ 1, 4, 9, 16, 25 ], [ 1, 8, 27, 64, 125 ], [ 1, 16, 81, 256, 625 ] ], width:5 }
|
|
=!EXPECTEND!=
|
|
*/
|