Class Matrix


  • public class Matrix
    extends Object
    *********************************************************************** Compilation: javac Matrix.java Execution: java Matrix A bare-bones collection of static methods for manipulating matrices.
    • Constructor Summary

      Constructors 
      Constructor Description
      Matrix()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double[] abs​(double[] A)  
      static double[][] abs​(double[][] A)  
      static double[][] add​(double[][] A, double[][] B)  
      static double[][] diag​(double[] A)  
      static double[] diag​(double[][] A)  
      static double dot​(double[] x, double[] y)  
      static double[][] identity​(int n)  
      static void main​(String[] args)  
      static double[] multiply​(double[][] A, double[] x)  
      static double[][] multiply​(double[][] A, double[][] B)  
      static double[] multiply​(double[] x, double[][] A)  
      static double[] oneDivide​(double[] A)  
      static double[][] oneDivide​(double[][] A)  
      static double[][] random​(int m, int n)  
      static double[][] scale​(double[][] A, double x)  
      static double[][] scale​(double[][] A, double[] x)  
      static double[] sqrt​(double[] A)  
      static double[][] sqrt​(double[][] A)  
      static double[][] subtract​(double[][] A, double[][] B)  
      static double[][] transpose​(double[][] A)  
    • Constructor Detail

    • Method Detail

      • sqrt

        public static double[][] sqrt​(double[][] A)
        Parameters:
        A -
        Returns:
      • sqrt

        public static double[] sqrt​(double[] A)
        Parameters:
        A -
        Returns:
      • oneDivide

        public static double[][] oneDivide​(double[][] A)
        Parameters:
        A -
        Returns:
      • oneDivide

        public static double[] oneDivide​(double[] A)
        Parameters:
        A -
        Returns:
      • diag

        public static double[] diag​(double[][] A)
        Parameters:
        A -
        Returns:
      • diag

        public static double[][] diag​(double[] A)
        Parameters:
        A -
        Returns:
      • abs

        public static double[][] abs​(double[][] A)
        Parameters:
        A -
        Returns:
      • abs

        public static double[] abs​(double[] A)
        Parameters:
        A -
        Returns:
      • random

        public static double[][] random​(int m,
                                        int n)
        Parameters:
        m -
        n -
        Returns:
      • identity

        public static double[][] identity​(int n)
        Parameters:
        n -
        Returns:
      • dot

        public static double dot​(double[] x,
                                 double[] y)
        Parameters:
        x -
        y -
        Returns:
      • transpose

        public static double[][] transpose​(double[][] A)
        Parameters:
        A -
        Returns:
      • add

        public static double[][] add​(double[][] A,
                                     double[][] B)
        Parameters:
        A -
        B -
        Returns:
      • subtract

        public static double[][] subtract​(double[][] A,
                                          double[][] B)
        Parameters:
        A -
        B -
        Returns:
      • multiply

        public static double[][] multiply​(double[][] A,
                                          double[][] B)
        Parameters:
        A -
        B -
        Returns:
      • multiply

        public static double[] multiply​(double[][] A,
                                        double[] x)
        Parameters:
        A -
        x -
        Returns:
      • scale

        public static double[][] scale​(double[][] A,
                                       double[] x)
        Parameters:
        A -
        x -
        Returns:
      • scale

        public static double[][] scale​(double[][] A,
                                       double x)
        Parameters:
        A -
        x -
        Returns:
      • multiply

        public static double[] multiply​(double[] x,
                                        double[][] A)
        Parameters:
        x -
        A -
        Returns:
      • main

        public static void main​(String[] args)
        Parameters:
        args -