started code on dot

This commit is contained in:
array-in-a-matrix 2022-11-17 22:39:05 -05:00
parent 501502f00b
commit e6feb58f79

View file

@ -31,7 +31,13 @@ var m2 = newSeqWith(r2, newSeq[float](c2))
procedures.fillMatrix(m2, r2, c2)
var m = newSeqWith(0, newSeq[float](0)) # ? double check this
# TODO: calculate dot product (in procedures)
for i in countup(1, r1):
for j in countup(1, c1):
m[i-1].add( m1[i-1][j-1] * m2[j-1][i-1] + m1[i][j] * m2[j][i] ) # ? double check this
m[i-1].delete(0)
# TODO: calculate cross product (in procedures)
@ -41,4 +47,4 @@ echo "\nSecond matrix is:"
procedures.printMatrix(m2, r2)
# TODO: print result to stdout
procedures.printMatrix(m, r1)