COMP 3400 Project 2: Multithreaded Java Matrix Multiplication
Spring 2017
Due: Tuesday February 14
Worth 35 points
This assignment will gently introduce you to user threads provided by Java. You will produce a Java solution to the Matrix Multiplication project described in a separate handout. Also refer to the Java Threads Example handout.
Again, follow the "individual with partner" approach. Feel free to help and advise each other but produce an individual solution.
File Format: A matrix data file is a text file consisting of all integer values formatted something like this
R | C | ||
M11 | M12 | ... | M1C |
M21 | M22 | ... | M2C |
... | ... | ... | ... |
MR1 | MR2 | ... | MRC |
R is the number of rows, C is the number of columns, and the M's are the data themselves. All numbers are separated by one or more spaces. This format is used for both reading and writing a matrix.
Here are example contents of a text file containing such a matrix:2 | 3 | |
27 | -8 | 15 |
36 | 94 | -526 |
Using your Program:
Robustness: Besides the matrix dimension mismatch described above, your program should also deal with the problem of non-existing input files - this should result in an error message followed by program termination. You may assume that the contents of input files are correctly formatted. If the output file already exists, have the user confirm before overwriting it (for confirmation input, use either the Scanner class in java.util or the static JOptionPane.showConfirmDialog() method in javax.swing - it does not require a frame if you use null for the first argument).
Documentation: Each of your classes and methods needs to be appropriately documented with comments. Make sure your name is at the top of each file.
Threads: Refer to the handout problem description for information about how threads are to be used in your solution. I will add one additional requirement: the thread class must implement Runnable, not extend Thread. See the Java Threads Example handout. This topic is also covered in my threads lecture notes. For your reference, Java Standard Edition 6 API documentation is found at http://docs.oracle.com/javase/6/docs/api/
psanderson@otterbein.edu
[ COMP 3400
| Peter Sanderson
| Math Sciences home page
| Otterbein
]
Last updated:
Peter Sanderson (PSanderson@otterbein.edu)