shared
Class Matrix

java.lang.Object
  |
  +--shared.Matrix

public class Matrix
extends java.lang.Object

The Matrix class contains functions useful for manipulation of double arrays in MLJ.


Constructor Summary
Matrix()
           
 
Method Summary
static double[][] copy(double[][] matrix)
          Copies the double array into a new double array.
static void initialize(double init_value, double[][] matrix)
          Initializes the double array to the given value.
static double max_in_row(int row, int idx, double[][] matrix)
          Returns the maximum value in the specified row of the given double array.
static double min_in_row(int row, int idx, double[][] matrix)
          Returns the minimum value in the specified row of the given double array.
static void sum_cols(double[] returnRow, double[][] matrix)
          Sums the columns of a double array of double values and returns the sums as an array of summations.
static void sum_rows(double[] returnColumn, double[][] matrix)
          Sums the rows of a double array of double values and returns the sums as an array of summations.
static double total_sum(double[][] matrix)
          Sums all of the values in a double array of double values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Matrix

public Matrix()
Method Detail

sum_cols

public static void sum_cols(double[] returnRow,
                            double[][] matrix)
Sums the columns of a double array of double values and returns the sums as an array of summations.
Parameters:
returnRow - The array containing the summations. Altered as a result of this function.
matrix - The double array containing the values to be summed.

sum_rows

public static void sum_rows(double[] returnColumn,
                            double[][] matrix)
Sums the rows of a double array of double values and returns the sums as an array of summations.
Parameters:
returnColumn - The array containing the summations. Altered as a result of this function.
matrix - The double array containing the values to be summed.

total_sum

public static double total_sum(double[][] matrix)
Sums all of the values in a double array of double values.
Parameters:
matrix - The double array to be summed.
Returns:
The summation of all the elements in the matrix.

initialize

public static void initialize(double init_value,
                              double[][] matrix)
Initializes the double array to the given value.
Parameters:
init_value - The value to be initialized to.
matrix - The double array to be initialized.

copy

public static double[][] copy(double[][] matrix)
Copies the double array into a new double array.
Parameters:
matrix - The double array to be copied.
Returns:
The new copy of the matrix.

max_in_row

public static double max_in_row(int row,
                                int idx,
                                double[][] matrix)
Returns the maximum value in the specified row of the given double array.
Parameters:
row - The row to be searched.
idx - The index value of the greatest value.
matrix - The double array containing the row searched.
Returns:
The maximum value.

min_in_row

public static double min_in_row(int row,
                                int idx,
                                double[][] matrix)
Returns the minimum value in the specified row of the given double array.
Parameters:
row - The row to be searched.
idx - The index value of the smallest value.
matrix - The double array containing the row searched.
Returns:
The minimum value.