Anonymous user
Matrix multiplication: Difference between revisions
m
→{{header|PureBasic}}: changed formatting
(→{{header|Prolog}}: Added PureBasic) |
m (→{{header|PureBasic}}: changed formatting) |
||
Line 1,021:
Procedure displayMatrix(Array a(2), text.s)
Protected i, j
Protected columns = ArraySize(a(), 2),
PrintN(text + ": (" + Str(
For i = 0 To
For j = 0 To columns
Print(LSet(Str(a(i, j)), 4, " "))
Line 1,034:
Procedure loadMatrix(Array a(2))
Protected
Read.i
Read.i columns
Dim a(
For i = 0 To
For j = 0 To columns - 1
Read.i a(i, j)
Line 1,052:
If OpenConsole()
loadMatrix(a()): displayMatrix(a(), "matrix a")
loadMatrix(b()): displayMatrix(
If multiplyMatrix(a(), b(), c())
displayMatrix(c(), "product of a * b")
|