logo


util
Class Matrix

java.lang.Object
  extended by util.Matrix

public class Matrix
extends java.lang.Object


Constructor Summary
Matrix()
 
Method Summary
static float[][] change_basis_3x3(float[][] T, float[][] B)
          This changes the basis of the 3x3 linear transformation T to that represented by the 3x3 matrix B
static float[][] invert_3x3(float[][] a)
          This inverts a 3x3 matrix
static float[][] multiply(float[][] A, float[][] B)
          This operation perfoms no checks on the dimensions of A,B but assumes that they are of the correct dimensions for calculation of the matrix product AB A is M x N matrix B is N x P matrix
static float[][] multiply(float[][] A, float[][] B, float[][] result)
          This operation perfoms no checks on the dimensions of A,B but assumes that they are of the correct dimensions for calculation of the matrix product AB.
static float[][] normalise(float[][] A)
          This normalises a matrix
static void print(float[][] A)
          prints a matrix
static float[][] rotation(int N, int K1, int K2, float alpha)
          This returns a standard rotation NxN rotation matrix of the K1 and K2 basis vectors for angle alpha in radians.
static float[][] scale(float[][] A, float x)
          This multiplies matrix A by scalar x
static float[][] translate_3x3(float[][] A, float[][] B)
          This adds the elements of B to those of A element-wise, A is modified.
static float[][] translate(float[][] A, float[][] B)
          This adds the elements of B to those of A element-wise, A is modified.
 
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

multiply

public static float[][] multiply(float[][] A,
                                 float[][] B)
This operation perfoms no checks on the dimensions of A,B but assumes that they are of the correct dimensions for calculation of the matrix product AB A is M x N matrix B is N x P matrix

Parameters:
A -
B -
Returns:

multiply

public static float[][] multiply(float[][] A,
                                 float[][] B,
                                 float[][] result)
This operation perfoms no checks on the dimensions of A,B but assumes that they are of the correct dimensions for calculation of the matrix product AB. The result is stored in the given result array. A is M x N matrix B is N x P matrix

Parameters:
A -
B -
result -
Returns:

rotation

public static float[][] rotation(int N,
                                 int K1,
                                 int K2,
                                 float alpha)
This returns a standard rotation NxN rotation matrix of the K1 and K2 basis vectors for angle alpha in radians. K1 < K2, K1, K2 elements of [0 N-1] N a natural number

Parameters:
N -
K1 -
K2 -
alpha -
Returns:

scale

public static float[][] scale(float[][] A,
                              float x)
This multiplies matrix A by scalar x

Parameters:
A -
x -
Returns:

translate

public static float[][] translate(float[][] A,
                                  float[][] B)
This adds the elements of B to those of A element-wise, A is modified.

Parameters:
A -
B -
Returns:

normalise

public static float[][] normalise(float[][] A)
This normalises a matrix

Parameters:
A -
Returns:

translate_3x3

public static float[][] translate_3x3(float[][] A,
                                      float[][] B)
This adds the elements of B to those of A element-wise, A is modified.

Parameters:
A -
B -
Returns:

change_basis_3x3

public static float[][] change_basis_3x3(float[][] T,
                                         float[][] B)
This changes the basis of the 3x3 linear transformation T to that represented by the 3x3 matrix B

Parameters:
T -
B -
Returns:

invert_3x3

public static float[][] invert_3x3(float[][] a)
This inverts a 3x3 matrix

Parameters:
a -
Returns:

print

public static void print(float[][] A)
prints a matrix

Parameters:
A -