Google Answers Logo
View Question
 
Q: Matrixx Multipliation Java Program ( No Answer,   0 Comments )
Question  
Subject: Matrixx Multipliation Java Program
Category: Computers > Programming
Asked by: bizmasta-ga
List Price: $20.00
Posted: 19 May 2006 17:51 PDT
Expires: 20 May 2006 12:53 PDT
Question ID: 730576
I already have code that does most of the work but I need some
additional methods and functionality to be added to the program.

I'm trying to make a matrix multiplication program that uses threads
per element computation. The input is 3 matrices and it will take AxB
and store the multiplication to temp matrix C and then take CxD and
store it in E. I've been able to get C to be generated properly but
for some reason when I do CxD and get the result of E, I only get a
partial correct solution. I have to worry about an element of CxD must
wait for ONLY the threads which are only responsible for the exact
elements that the thread needs to do its particular computation. A
thread responsible for calculating E[i][j] must wait for the threads
which are calculating C[i][0], C[i][1], ... C[i][n-1] only. I wanted
to ensure that CxD wait for those responsible for AxB and that might
be an issue with generating the second matrix.

Here are a list of requirements:

Main class called Matrix.java

Static fields for int[][] A,B,C,D, and E in Matrix class

public class MultiplicationThread extends Thread

This class will do the actual multiplication, and somehow you will
tell this class which multiplication it is responsible for and if it
is responsible for CxD multiplication, you need to program it so that
it waits for threads which work on AxB multiplication as stated above.

public class Finished
Finished class will be used to coordinate (synchronize) the threads.

Need to keep track of the number of elements of E that have completed
so that you ensure that you print out the final arrays once E is done.

Implement a nonthreaded method called
public static boolean multiplyCheck(int[][], int[][], int[][]);

This method should multiply the first two matrices passed in and then
compare the resulting matrix with the third matrix passed in. If they
are identical, the method returns true, else it returns false. You
should call this method at the end of main (after you print out the
matrices) for AxB and CxD to verify that C and E are correct -- Print
out a statement about the correctness of C and E (given the return
value of multiplyCheck).

The main routine will create the matrices, initialize A, B, and D,
create the MultiplicationThread object, invoke the multiplications,
printout the matrices, call multiplyCheck and print out its result.

No threading priorities.

If you are intrested I will show you the source code that I have or if
you have a version you would like to write up that does the same job,
that is also okay.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy