/* ## class DPoBand ## ## This class contains the routines for positive definite matrices ## in banded form. ## */ package edu.rice.linpack.Matrix.DMatrix; import edu.rice.linpack.LNumber.*; import edu.rice.linpack.util.*; import edu.rice.linpack.Vector.*; public class DPoBand extends DBanded { private int M; public DPoBand() { super(); } public DPoBand(int c, int M2) { super(0,M2,c); mu = M2; ml = 0; M = M2; } public DPoBand(double[][] f, int ML, int MU) { mu = MU; M = mu; ml = 0; rows = M+1; cols = f[0].length; Mat = band(f); } public DPoBand(double[][] f, int M2) { mu = M2; M = M2; ml = 0; rows = M+1; cols = f[0].length; Mat = new double[rows][cols]; for(int i=0;i this.Mat[M][k]) { double S = this.Mat[M][k]/Math.abs(ek-Z[k]); DUtil.scal(cols,S,Z,1); ek *= S; } double wk = ek - Z[k]; double wkm = -ek - Z[k]; double S = Math.abs(wk); double 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])) { double S = Math.abs(this.Mat[M][k])/Math.abs(Z[k]); DUtil.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; double T = -Z[k]; this.axpy(lm,T,1,la,k,Z,1,lz); } double S = 1.0/DUtil.asum(cols,Z,1); DUtil.scal(cols,S,Z,1); } private double solveTrans (int M, double[] Z) { double ynorm = 1; for(int k=0;k this.Mat[M][k]) { double S = this.Mat[M][k]/Math.abs(Z[k]); DUtil.scal(cols,S,Z,1); ynorm *= S; } Z[k] /= this.Mat[M][k]; } double S = 1/DUtil.asum(cols,Z,1); DUtil.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 { double[] B = Be.getDoubleArray(); this.solveTransRY(M,B); this.solveRX(M,B); } public Vector determ() { double[] Det = new double[2]; Det[0] = 1; Det[1] = 0; for(int i=0;i