public class MatrixOperations
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static double |
num_prec |
| Constructor and Description |
|---|
MatrixOperations() |
| Modifier and Type | Method and Description |
|---|---|
static double[][][] |
eig_jacobi(double[][] m,
boolean prec)
Performs the eigen decomposition of a symmetric matrix:
A = Q * L * Q'
with Q orthonormal and L diagonal
|
static double[][][] |
eig_qr(double[][] A)
Performs the eigen decomposition of a symmetric matrix:
A = Q * L * Q'
with Q orthonormal and L diagonal
|
static double[][][] |
eig(double[][] A)
Performs the eigen decomposition of a symmetric matrix:
A = Q * L * Q'
with Q orthonormal and L diagonal
|
static double[][] |
givensRoti(double[][] matrix,
double[][] G,
int i,
int j)
Performs the Givens rotation that nullifies component (i,j) of a matrix, accumulated on previous Rotation matrices
|
static double[][] |
inv(double[][] A)
Compute the inverse matrix
|
static boolean |
is_tri(double[][] A) |
static boolean |
isSquare(double[][] A)
Tests if a matrix is square
|
static boolean |
isSymmetric(double[][] A)
Checks if a matrix is symmetric
|
static boolean |
isTriDiagonal(double[][] A) |
static double[][][] |
lancsos_iteration(double[][] m) |
static double[][] |
mul(double[][] A,
double[][] B)
Performs the matrix multiplication between two double matrices
C = A * B
|
static double[][] |
muli(double[][] C,
double[][] A,
double[][] B)
Performs the matrix multiplication between two double matrices
C = A * B
|
static void |
print(double[][] A)
outputs the matrix on System.out
|
static double[][][] |
qr(double[][] A)
Performs the QR decomposition of a symmetric matrix, such that Q is orthonormal
and R is an upper triangular matrix:
A = Q*R
|
static void |
qri_givens(double[][] Q,
double[][] R,
double[][] m)
Performs the in place QR decomposition of a symmetric matrix using Givens rotation matrices,
such that Q is orthonormal and R is an upper triangular matrix:
A = Q*R
|
static void |
qri_gramschmidt(double[][] Q,
double[][] R,
double[][] A)
Performs the in place QR decomposition of a symmetric matrix, such that Q is orthonormal
and R is an upper triangular matrix:
A = Q*R
|
static void |
qri(double[][] Q,
double[][] R,
double[][] A)
Performs the in place QR decomposition of a symmetric matrix, such that Q is orthonormal
and R is an upper triangular matrix:
A = Q*R
|
static double[][] |
trans(double[][] A)
Computes the transposed matrix of a matrix
|
static double[][] |
transi(double[][] A)
Computes the transposed matrix of a symmetric matrix in place
|
static double[][] |
transi(double[][] C,
double[][] A)
Computes the transposed matrix of a matrix in place
|
static double[][] |
transMul(double[][] A,
double[][] B)
Computes the transpose multiplication between two matrices :
C = A' * B
|
static double[][] |
transMuli(double[][] C,
double[][] A,
double[][] B)
Computes the transpose multiplication between two matrices :
C = A' * B
|
static double[][][] |
tri_givens(double[][] m,
boolean prec) |
static double[][][] |
tri_householder(double[][] m) |
static double[][][] |
tri_lancsos(double[][] m) |
static double[][][] |
tri(double[][] m)
Performs the trigonalization of a symmetric matrix:
A = Q * T * Q'
with Q orthonormal and T tridiagonal
|
public static final double num_prec
public static boolean isSquare(double[][] A)
A - the input matrixpublic static boolean isSymmetric(double[][] A)
A - the matrixpublic static boolean isTriDiagonal(double[][] A)
public static double[][] trans(double[][] A)
A - the input matrixpublic static double[][] transi(double[][] A)
A - the input matrix to transposepublic static double[][] transi(double[][] C,
double[][] A)
C - the output matrixA - the input matrixpublic static double[][] mul(double[][] A,
double[][] B)
throws java.lang.ArithmeticException
A - first matrixB - second matrixjava.lang.ArithmeticExceptionpublic static double[][] muli(double[][] C,
double[][] A,
double[][] B)
throws java.lang.ArithmeticException
A - first matrixB - second matrixC - the result matrixjava.lang.ArithmeticExceptionpublic static double[][] transMul(double[][] A,
double[][] B)
A - first matrixB - second matrixpublic static double[][] transMuli(double[][] C,
double[][] A,
double[][] B)
A - first matrixB - second matrixpublic static double[][] givensRoti(double[][] matrix,
double[][] G,
int i,
int j)
matrix - the input/output matrixG - the input/output rotation matrixi - component one the linesj - component on the columnspublic static double[][][] qr(double[][] A)
A - input matrixpublic static void qri(double[][] Q,
double[][] R,
double[][] A)
Q - output matrix QR - output matrix RA - input matrix Apublic static void qri_givens(double[][] Q,
double[][] R,
double[][] m)
Q - output matrix QR - output matrix Rm - input matrix mpublic static void qri_gramschmidt(double[][] Q,
double[][] R,
double[][] A)
Q - output matrix QR - output matrix RA - input matrix Apublic static double[][] inv(double[][] A)
A - input matrixpublic static double[][][] eig(double[][] A)
A - input matrixpublic static final double[][][] eig_jacobi(double[][] m,
boolean prec)
m - input matrixpublic static double[][][] eig_qr(double[][] A)
A - input matrixpublic static double[][][] tri(double[][] m)
m - input matrixpublic static double[][][] tri_householder(double[][] m)
public static double[][][] tri_lancsos(double[][] m)
public static double[][][] lancsos_iteration(double[][] m)
public static double[][][] tri_givens(double[][] m,
boolean prec)
public static void print(double[][] A)
A - public static boolean is_tri(double[][] A)