|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jmatrices.dbl.operator.MatrixOperator
MatrixOperator provides important operations that can be performed on two or more matrices
Given two matrices A,B -yields-> C ,where C is another matrix. All operations on a matrix fitting this pattern can be found here! Author: purangp Date: 07.03.2004 Time: 18:09:51
Method Summary | |
static Matrix |
add(Matrix a,
Matrix b)
Matrix Addition Matrices must be of the same dimensions! |
static Matrix |
applyEBEOperation(Matrix a,
Matrix b,
MatrixEBEOperation mo)
Applies element-by-element operation combining the elements of the two matrices Note: Matrix a 's underlying implementation is propogated in the resulting matrix
Usage: from add(org.jmatrices.dbl.Matrix, org.jmatrices.dbl.Matrix)
public static Matrix add(Matrix a, Matrix b) {
return applyEBEOperation(a, b, new MatrixEBEOperation() {
public double apply(double a, double b) {
return a + b;
}
});
}
Hypothetical Usage:
public static Matrix doSomeThing(Matrix a, Matrix b, final double n) {
return applyEBEOperation(a, b, new MatrixEBEOperation() {
public double apply(double a, double b) {
return (a^2 + b^2)^n;
}
});
}
|
static Matrix |
divideEBE(Matrix a,
Matrix b)
Element-by-elemnt Matrix division Matrices must be of the same dimensions! |
static Matrix |
horizontalConcatenation(Matrix a,
Matrix b)
Concatenates a and b horizontally with
b 's columns attached to the end of a
rows of a must be equal to rows of b
Note: Matrix a 's underlying implementation is propogated in the resulting matrix
|
static Matrix |
horizontalDirectProduct(Matrix a,
Matrix b)
Gets the Horizontal Direct Product. |
static Matrix |
kroneckerProduct(Matrix a,
Matrix b)
Gets the Kronecker (tensor) product of the two matrices, every element of a has been multiplied (scalar multilication)
by the matrix b
a =
1 2
3 4
b =
4 5 6
7 8 9
kroneckerProduct(a, b)=
4 5 6 8 10 12
7 8 9 14 16 18
12 15 18 16 20 24
21 24 27 28 32 36
|
static Matrix |
multiply(Matrix a,
Matrix b)
Matrix multiplication Note: Matrix a 's underlying implementation is propogated in the resulting matrix
Matrix dimensions must conform with the rules of matrix multiplication! |
static Matrix |
multiplyEBE(Matrix a,
Matrix b)
Element-by-elemnt Matrix Multiplication Matrices must be of the same dimensions! |
static Matrix |
solve(Matrix x,
Matrix b)
Solves the system of equations. |
static Matrix |
subtract(Matrix a,
Matrix b)
Matrix Subtraction Matrices must be of the same dimensions! |
static Matrix |
verticalConcatenation(Matrix a,
Matrix b)
Concatenates a and b vertically with
b 's rows following the a 's rows
cols of a must be equal to colss of b
Note: Matrix a 's underlying implementation is propogated in the resulting matrix
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static Matrix applyEBEOperation(Matrix a, Matrix b, MatrixEBEOperation mo)
a
's underlying implementation is propogated in the resulting matrix
add(org.jmatrices.dbl.Matrix, org.jmatrices.dbl.Matrix)
public static Matrix add(Matrix a, Matrix b) { return applyEBEOperation(a, b, new MatrixEBEOperation() { public double apply(double a, double b) { return a + b; } }); }Hypothetical Usage:
public static Matrix doSomeThing(Matrix a, Matrix b, final double n) { return applyEBEOperation(a, b, new MatrixEBEOperation() { public double apply(double a, double b) { return (a^2 + b^2)^n; } }); }
a
- Matrixb
- Matrixmo
- Class
public static Matrix solve(Matrix x, Matrix b)
x
- The coefficient matrixb
- The constant vector
public static Matrix add(Matrix a, Matrix b)
a
- Matrixb
- Matrix
public static Matrix subtract(Matrix a, Matrix b)
a
- Matrixb
- Matrix
public static Matrix multiply(Matrix a, Matrix b)
a
's underlying implementation is propogated in the resulting matrix
a
- Matrixb
- Matrix
public static Matrix multiplyEBE(Matrix a, Matrix b)
a
- Matrixb
- Matrix
public static Matrix divideEBE(Matrix a, Matrix b)
a
- Matrixb
- Matrix
public static Matrix horizontalConcatenation(Matrix a, Matrix b)
a
and b
horizontally with
b
's columns attached to the end of a
rows of a
must be equal to rows of b
a
's underlying implementation is propogated in the resulting matrix
a
- Matrixb
- Matrix
public static Matrix verticalConcatenation(Matrix a, Matrix b)
a
and b
vertically with
b
's rows following the a
's rows
cols of a
must be equal to colss of b
a
's underlying implementation is propogated in the resulting matrix
a
- Matrixb
- Matrix
public static Matrix kroneckerProduct(Matrix a, Matrix b)
a
has been multiplied (scalar multilication)
by the matrix b
a = 1 2 3 4 b = 4 5 6 7 8 9 kroneckerProduct(a, b)= 4 5 6 8 10 12 7 8 9 14 16 18 12 15 18 16 20 24 21 24 27 28 32 36
a
- b
-
public static Matrix horizontalDirectProduct(Matrix a, Matrix b)
a = 1 2 3 4 b = 5 6 7 8 horizontalDirectProduct(a, b)= 5 6 10 12 21 24 28 32
a
- b
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |