termo.matrix.Matrix Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of materia Show documentation
Show all versions of materia Show documentation
Thermodynamics properties and
equilibria calculations for
chemical engineering.
package termo.matrix;
/**
*
* @author Hugo
*/
public class Matrix {
protected double[][] matrix;
public Matrix(double[][] matrix ){
this.matrix = matrix;
}
public double a(int i , int j){
return matrix[i-1][j-1];
}
public double determinant(){
double result =0;
if(matrix.length==1){
result = a(1,1);
}else{
//determinante usando menores de la primer fila
int firstRow =1;
for(int col =1; col <= matrix.length; col++){
double minor = menor(firstRow,col);
result += a(firstRow,col) * minor;
}
}
return result;
}
public double[][] cofactorMatrix(){
double[][] cofactor = new double[matrix.length][matrix[0].length];
for(int i=0;i
© 2015 - 2024 Weber Informatics LLC | Privacy Policy