March 2014 update

This commit is contained in:
Ingy döt Net 2014-04-02 16:56:35 +00:00
parent 09687c4926
commit a25938f123
1846 changed files with 21876 additions and 5203 deletions

View file

@ -0,0 +1,16 @@
Multiply_Matrix(A,B){
if (A[1].MaxIndex() <> B.MaxIndex())
return
RCols := A[1].MaxIndex()>B[1].MaxIndex()?A[1].MaxIndex():B[1].MaxIndex()
RRows := A.MaxIndex()>B.MaxIndex()?A.MaxIndex():B.MaxIndex(), R := []
Loop, % RRows {
RRow:=A_Index
loop, % RCols {
RCol:=A_Index, v := 0
loop % A[1].MaxIndex()
col := A_Index, v += A[RRow, col] * B[col,RCol]
R[RRow,RCol] := v
}
}
return R
}

View file

@ -0,0 +1,19 @@
A := [[1,2]
, [3,4]
, [5,6]
, [7,8]]
B := [[1,2,3]
, [4,5,6]]
if Res := Multiply_Matrix(A,B)
MsgBox % Print(Res)
else
MsgBox Error
return
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")
}