package edu.rice.linpack.Matrix.FMatrix; import edu.rice.linpack.util.*; import edu.rice.linpack.Vector.*; import edu.rice.linpack.LNumber.*; public class FTriLow extends FTriFull { public FTriLow() { super(); } public FTriLow(int i, int j) { Mat = new float[i][j]; rows = i; cols = j; } public FTriLow(float[][] F) { rows = F.length; cols = (F[0]).length; Mat = F; } public FTriLow(FTriLow M) { rows = M.rows; cols = M.cols; Mat = new float[rows][cols]; for(int i=0;i=0;k--) { if(Z[k] != 0) ek = FUtil.signOf(ek,-Z[k]); if(Math.abs(ek-Z[k]) > Math.abs(this.Mat[k][k])) { S = Math.abs(this.Mat[k][k])/Math.abs(ek-Z[k]); FUtil.scal(cols,S,Z,1); ek *= S; } float wk = ek - Z[k]; float wkm = -ek - Z[k]; S = Math.abs(wk); float SM = Math.abs(wkm); if(this.Mat[k][k] != 0) { wk = wk/this.Mat[k][k]; wkm = wkm/this.Mat[k][k]; } else { wk = 1; wkm = 1; } if(k > 0) { for(int j=0;j Math.abs(this.Mat[k][k])) { float S = Math.abs(this.Mat[k][k])/Math.abs(Z[k]); FUtil.scal(cols,S,Z,1); ynorm *= S; } if(this.Mat[k][k] != 0) Z[k] = Z[k]/this.Mat[k][k]; else Z[k] = 1; int q = k+1; if(q < cols) this.axpy(cols-q,-Z[k],1,q,k,Z,1,q); } float S = 1/FUtil.asum(cols,Z,1); FUtil.scal(cols,S,Z,1); ynorm *= S; return ynorm; } public void solve(Vector Be, int job) throws WrongDataTypeException { float[] B = Be.getFloatArray(); if(job != 0) { int nm = cols-1; B[nm] = B[nm]/this.Mat[nm][nm]; if(cols > 0) { for(int jj=1;jj=0;k--) { if(this.Mat[k][k] == 0) return; else { this.Mat[k][k] = 1/this.Mat[k][k]; float T = -this.Mat[k][k]; this.scal(cols-k-1,T,1,k+1,k); for(int j=0;j