Package edu.pdx.cs410J.rmi
Class Matrix
java.lang.Object
edu.pdx.cs410J.rmi.Matrix
Represents a matrix of
double
s. Contains methods to
create special matrices for this assignment. It also contains
general methods to multiply matrices.- Author:
- David Whitlock
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
countColumns
(double[][] m) Returns the number of columns in a matrixstatic int
countRows
(double[][] m) Returns the number of rows in a matrixstatic double[][]
multiply
(double[][] a, double[][] b) Multiplies two matrices and returns their product.static void
print
(String name, double[][] m, PrintWriter out) Prints this a matrixstatic void
print
(String name, double[] v, PrintWriter out) Prints a vector in column formstatic void
setPrecision
(int n) Sets the number of decimal places to be displayed.
-
Constructor Details
-
Matrix
public Matrix()
-
-
Method Details
-
setPrecision
Sets the number of decimal places to be displayed. -
countRows
Returns the number of rows in a matrix -
countColumns
Returns the number of columns in a matrix- Throws:
IllegalArgumentException
- The columns are not length-consistent
-
multiply
Multiplies two matrices and returns their product. -
print
Prints this a matrix -
print
Prints a vector in column form
-