/* ## class FPoBand ## ## This class contains the routines for positive definite matrices ## in banded form. ## */ package edu.rice.linpack.Matrix.FMatrix; import edu.rice.linpack.LNumber.*; import edu.rice.linpack.util.*; import edu.rice.linpack.Vector.*; public class FPoBand extends FBanded { private int M; public FPoBand() { super(); } public FPoBand(int c, int M2) { super(0,M2,c); mu = M2; ml = 0; M = M2; } public FPoBand(float[][] f, int ML, int MU) { mu = MU; M = mu; ml = 0; rows = M+1; cols = f[0].length; Mat = band(f); } public FPoBand(float[][] f, int M2) { mu = M2; M = M2; ml = 0; rows = M+1; cols = f[0].length; Mat = new float[rows][cols]; for(int i=0;i this.Mat[M][k]) { float S = this.Mat[M][k]/Math.abs(ek-Z[k]); FUtil.scal(cols,S,Z,1); ek *= S; } float wk = ek - Z[k]; float wkm = -ek - Z[k]; float S = Math.abs(wk); float SM = Math.abs(wkm); wk = wk/this.Mat[M][k]; wkm = wkm/this.Mat[M][k]; int kp = k+1; int J2 = Math.min(kp+M,cols); int i = M-1; if(kp < J2) { for(int j=kp;j=0;k--) { if(Math.abs(Z[k]) > Math.abs(this.Mat[M][k])) { float S = Math.abs(this.Mat[M][k])/Math.abs(Z[k]); FUtil.scal(cols,S,Z,1); } if(this.Mat[M][k] != 0) Z[k] /= this.Mat[M][k]; else Z[k] = 1; int lm = Math.min(k,M); int la = M - lm; int lz = k - lm; float T = -Z[k]; this.axpy(lm,T,1,la,k,Z,1,lz); } float S = (float)1.0/FUtil.asum(cols,Z,1); FUtil.scal(cols,S,Z,1); } private float solveTrans (int M, float[] Z) { float ynorm = 1; for(int k=0;k this.Mat[M][k]) { float S = this.Mat[M][k]/Math.abs(Z[k]); FUtil.scal(cols,S,Z,1); ynorm *= S; } Z[k] /= this.Mat[M][k]; } float S = 1/FUtil.asum(cols,Z,1); FUtil.scal(cols,S,Z,1); ynorm *= S; return ynorm; } public void solve(Vector B, int J) throws WrongDataTypeException { this.solve(B); } public void solve(Vector Be) throws WrongDataTypeException { float[] B = Be.getFloatArray(); this.solveTransRY(M,B); this.solveRX(M,B); } public Vector determ() { float[] Det = new float[2]; Det[0] = 1; Det[1] = 0; for(int i=0;i