Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,58 @@
|
|||
a = a
|
||||
m = 10
|
||||
n = 10
|
||||
Loop, 10
|
||||
{
|
||||
i := A_Index - 1
|
||||
Loop, 10
|
||||
{
|
||||
j := A_Index - 1
|
||||
%a%%i%%j% := i - j
|
||||
}
|
||||
}
|
||||
before := matrix_print("a", m, n)
|
||||
transpose("a", m, n)
|
||||
after := matrix_print("a", m, n)
|
||||
MsgBox % before . "`ntransposed:`n" . after
|
||||
Return
|
||||
|
||||
transpose(a, m, n)
|
||||
{
|
||||
Local i, j, row, matrix
|
||||
Loop, % m
|
||||
{
|
||||
i := A_Index - 1
|
||||
Loop, % n
|
||||
{
|
||||
j := A_Index - 1
|
||||
temp%i%%j% := %a%%j%%i%
|
||||
}
|
||||
}
|
||||
Loop, % m
|
||||
{
|
||||
i := A_Index - 1
|
||||
Loop, % n
|
||||
{
|
||||
j := A_Index - 1
|
||||
%a%%i%%j% := temp%i%%j%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
matrix_print(a, m, n)
|
||||
{
|
||||
Local i, j, row, matrix
|
||||
Loop, % m
|
||||
{
|
||||
i := A_Index - 1
|
||||
row := ""
|
||||
Loop, % n
|
||||
{
|
||||
j := A_Index - 1
|
||||
row .= %a%%i%%j% . ","
|
||||
}
|
||||
StringTrimRight, row, row, 1
|
||||
matrix .= row . "`n"
|
||||
}
|
||||
Return matrix
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
Transpose(M){
|
||||
R := []
|
||||
for i, row in M
|
||||
for j, col in row
|
||||
R[j,i] := col
|
||||
return R
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
Matrix := [[1,2,3],[4,5,6],[7,8,9],[10,11,12]]
|
||||
MsgBox % ""
|
||||
. "Original Matrix :`n" Print(Matrix)
|
||||
. "`nTransposed Matrix :`n" Print(Transpose(Matrix))
|
||||
|
||||
Print(M){
|
||||
for i, row in M
|
||||
for j, col in row
|
||||
Res .= (A_Index=1?"":"`t") col (Mod(A_Index,M[1].MaxIndex())?"":"`n")
|
||||
return Trim(Res,"`n")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue