I am having trouble devising a method to multiply 2 matricies that are formed by dynamic one dimensional arrays, for this case i just used matrix1 and matrix2 To access elements that are on rows 0 to n-1 in either matrix i have to use this method:
((rows - 1) x number of columns) + column number element is on - 1.
I have tried to implement this in a for loop, but i cant get the first row in matrix1 to multiply with the first columnof matrix2. I am having trouble grasping how i would code this for dynamic one dimensional arrays.
By "multiply", do you mean "multiply" from a linear algebra sense? If so, if you multiply an a x n matrix (a rows, n columns) by an n x b matrix (n rows, b columns) , you end with an a x b matrix result (a rows, b columns).
I assume you mean by "array" a one-dimensional array and by "matrix" you mean a two-dimensional array, though technically you can have a matrix with 1 row or 1 column, which is the equivalent of an array. I don't see, mathematically, why it would matter whether the arrays are dynamically sized or static. The principal would seem to be the same to me, as would the method. You'd probably have to code it slightly differently, but not much. You'd almost certainly have a nested for loop. Anyway, post what you have for the static matrix size case, along with possibly an example of what you're going for in the matrix multiplication.