Programming in lua
$30-250 USD
Paid on delivery
Programming language is lua, matrix problem
Matrix Multiplication
Matrices are two dimensional arrays of numbers. Matrix dimension are typically listed in row, column order as are their indices. An m × p matrix has m rows and p columns. Two matrices can be multiplied if their inner dimensions match. That is, if matrix A has dimensions m × p, and matrix B has dimensions p × q then the result of their multiplication will have dimension m × q. If the number of columns in A does not match the number of rows in B, the matrices cannot be multiplied.
The multiplication itself is a combination of multiplication and addition. The simplest way to accomplish this multiplication is via an O(n3
) algorithm as shown:
C = new matrix of size [login to view URL], [login to view URL] Set all entries in C to zero For i = 1 to [login to view URL] For j = 1 to [login to view URL] For k = 1 to [login to view URL] C[i,j] = C[i,j] + A[i,k] * B[k,j]
End For End For End For
Note that the above assumes that the for loops include both the beginning and end of their range, and that the arrays have an index beginning at 1 (as is standard mathematics notation). Also C[i,j] refers to the entry at row i column j in matrix C.
Your program should ask for the dimensions of A followed by the variables in A. It should then follow suit for B. If the two arrays are not compatible, your program should indicate that they cannot be multiplied. Otherwise it should carry out the multiplication.
The first example run is of two incompatible matrices: Matrix A ========Rows: 2
Cols: 2
Values:
1 2
3 4
Matrix B
========
Rows: 3
Cols: 1
Values:
1
2
3
Incompatible Dimensions
And here is a run with compatible matrices:
Matrix A
========
Rows: 2
Cols: 2
Values:1 2 3 4
Matrix B ======== Rows: 2 Cols: 3 Values: 1 2 0 0 3 4
A x B = 1 8 8 3 18 16
Note that for the final display, you can do something simple like put tabs in between the numbers. Make it look as neat as possible, but I will not be counting spaces in between for exactness. Note that your matrices should allow for floating point values.
Project ID: #32111530
About the project
10 freelancers are bidding on average $129 for this job
Good day, I've complete Phd Software Engineering. I've 5-Year experience in C++ and Lua development and algorithm implementation. My Core Expertise in Java - C++ - C - object-oriented - Data Structure - Swing - OpenGL More
Hi, I am interested in your offer as a developer with 10 years of experience. I wanna do my best to you with my experience and diligent efforts. For a cheap price, you'll get more than you want in a short period of t More
Hello, I hope this finds you well. I have just seen your project requiring; Java Algorithm C++ Programming Assembly Lua I believe that my 10-year experience in this field is what you need right away. Avoid the headach More
Hello, I read your description in detail. I have experiences at web security and can help you. I am very excited on your project, and I am ready to start work immediately. I have skills: C language and C++ language I More
Hi there, i have gone through your project description, i'm an experts in this i can help you with your project, kindly send me a message. I'm a senior engineer with rich experience in Python, Java, Algorithm, C++ Pro More
Hi There...! Note : I give you 25% off on my all services. So grabs this special limited discount offer. Let’s get to the Project. I came to know that your Looking a developer which have rich knowledge about web an More
Hi,I carefully read your bid description and i know your intension. I am mathematicians and partition in algorithm competition such as codechef I have sufficient experience in algorithm development that you want. I am More