playing with inverting Matrices
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
b1db4b75eb
commit
cf3137cea9
2 changed files with 38 additions and 1 deletions
BIN
lib/jmat.core-1.1.0.jar
Normal file
BIN
lib/jmat.core-1.1.0.jar
Normal file
Binary file not shown.
|
@ -1,7 +1,44 @@
|
||||||
package hbb;
|
package hbb;
|
||||||
|
|
||||||
|
import java.lang.Double;
|
||||||
|
import main.java.matrices.util.MatMaths;
|
||||||
|
import main.java.matrices.DMatrix;
|
||||||
|
|
||||||
public class HelloWorld {
|
public class HelloWorld {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
System.out.println("Hello World");
|
Double[][] array = {{1.,3.},{2.,7.}};
|
||||||
|
Double[][] arrOne = {{1.,1.,1.},{1.,1.,1.},{1.,1.,1.}};
|
||||||
|
Double[][] arrTwo = {{2.,2.,2.},{2.,2.,2.},{2.,2.,2.}};
|
||||||
|
Double[][] mArray = {{2.},{3.},{4.}};
|
||||||
|
Double[][] pArray = {{1.,6.}};
|
||||||
|
|
||||||
|
DMatrix matrix = new DMatrix(array);
|
||||||
|
DMatrix matrixOne = new DMatrix(arrOne);
|
||||||
|
DMatrix matrixTwo = new DMatrix(arrTwo);
|
||||||
|
DMatrix m = new DMatrix(mArray);
|
||||||
|
DMatrix p = new DMatrix(pArray);
|
||||||
|
DMatrix inverseMatrix = MatMaths.inverseOf(matrix);
|
||||||
|
DMatrix addMatrix = MatMaths.add(matrixOne,matrixTwo);
|
||||||
|
DMatrix multMatrix = MatMaths.mul(m,p);
|
||||||
|
|
||||||
|
System.out.println("First Matrix:");
|
||||||
|
/*
|
||||||
|
for (Double matValue : matrix) {
|
||||||
|
System.out.println(matValue);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
matrix.show();
|
||||||
|
|
||||||
|
System.out.println("Inverted Matrix:");
|
||||||
|
inverseMatrix.show();
|
||||||
|
|
||||||
|
System.out.println("Add Matrix:");
|
||||||
|
addMatrix.show();
|
||||||
|
System.out.println("m Matrix:");
|
||||||
|
m.show();
|
||||||
|
System.out.println("p Matrix:");
|
||||||
|
p.show();
|
||||||
|
System.out.println("Multiply Matrix:");
|
||||||
|
multMatrix.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue