Class Matrix

java.lang.Object
edu.pdx.cs410J.rmi.Matrix

public class Matrix extends Object
Represents a matrix of doubles. Contains methods to create special matrices for this assignment. It also contains general methods to multiply matrices.
Author:
David Whitlock
  • Constructor Details

  • Method Details

    • setPrecision

      public static void setPrecision(int n)
      Sets the number of decimal places to be displayed.
    • countRows

      public static int countRows(double[][] m)
      Returns the number of rows in a matrix
    • countColumns

      public static int countColumns(double[][] m)
      Returns the number of columns in a matrix
      Throws:
      IllegalArgumentException - The columns are not length-consistent
    • multiply

      public static double[][] multiply(double[][] a, double[][] b)
      Multiplies two matrices and returns their product.
    • print

      public static void print(String name, double[][] m, PrintWriter out)
      Prints this a matrix
    • print

      public static void print(String name, double[] v, PrintWriter out)
      Prints a vector in column form