/*## ## class NMatrix ## ## This class contains all the BLAS (basic linear algebra subroutines) ## and other low-level functions common to all matrices. ## NMatrix contains no factoring or solving capabilities. ## ##*/ package edu.rice.linpack.Matrix.NMatrix; import java.lang.*; import edu.rice.linpack.LNumber.*; import edu.rice.linpack.util.*; public abstract class NMatrix { protected int rows, cols; protected int[] pivot; protected LNumber[][] Mat; /*## ## These are the default methods for the factoring routines common ## to most subclasses. If a routine is not supported by a ## subclass due to the storage format, an UnsupportedMethodException ## is thrown. ##*/ public void factor() throws SingularMatrixException, UnsupportedMethodException { throw new UnsupportedMethodException(); } public LNumber condition() throws SingularMatrixException, UnsupportedMethodException { throw new UnsupportedMethodException(); } public LNumber condition(LNumber[] Z) throws SingularMatrixException, UnsupportedMethodException { throw new UnsupportedMethodException(); } public void solve(LNumber[] B, int i) throws UnsupportedMethodException, UnsupportedMethodException { throw new UnsupportedMethodException(); } public void solve(LNumber[] B) throws SingularMatrixException, UnsupportedMethodException { throw new UnsupportedMethodException(); } public void inverse() throws UnsupportedMethodException { throw new UnsupportedMethodException(); } public LNumber[] determ() throws UnsupportedMethodException { throw new UnsupportedMethodException(); } public void Factor_and_Solve(LNumber[] B) throws SingularMatrixException, UnsupportedMethodException { this.factor(); this.solve(B); } /*## ## These are used as the constructors for several subclasses ##*/ void cons() { pivot = new int[cols]; } void cons(int i, int j) { Mat = new LNumber[i][j]; rows = i; cols = j; pivot = new int[cols]; } void cons(NMatrix M) { rows = M.numofRows(); cols = M.numofCols(); Mat = new LNumber[rows][cols]; for(int i=0;i 0) { if(incx != 1) { int ix = r+incx; for(int i=1;i= 6) { for(int i=m+1;i 0 && !Da.equals(0)) { if(incx != 1 || incy != 1) { int ix = 0; int iy = 0; if(incx < 0) ix = (-n+1)*incx; if(incy < 0) iy = (-n+1)*incy; for(int i=0;i= 4) { for(int i=m;i 0 && !Da.equals(0)) { if(incx != 1 || incy != 1) { int ix = 0; int iy = 0; if(incx < 0) ix = (-n+1)*incx; if(incy < 0) iy = (-n+1)*incy; for(int i=0;i= 4) { for(int i=m;i 0 && !Da.equals(0)) { if(incx != 1 || incy != 1) { int ix = 0; int iy = 0; if(incx < 0) ix = (-n+1)*incx; if(incy < 0) iy = (-n+1)*incy; for(int i=0;i= 4) { for(int i=m;i 0) { if(incx != 1 || incy != 1) { int ix = 0; int iy = 0; if(incx < 0) ix = (-n+1)*incx; if(incy < 0) iy = (-n+1)*incy; for(int i=0;i= 7) { for(int i=m;i 0) { if(incx != 1 || incy != 1) { int ix = 0; int iy = 0; if(incx < 0) ix = (-n+1)*incx; if(incy < 0) iy = (-n+1)*incy; for(int i=0;i= 7) { for(int i=m;i 0){ if(incy != 1 || incx != 1) { int ix = 0; int iy = 0; if(incx < 0) ix = (-n+1)*incx; if(incy < 0) iy = (-n+1)*incy; // CHANGING THIS - ADDING CONJ() for(int i=0; i= 5) { for(int i=m;i 0){ if(incy != 1 || incx != 1) { int ix = 0; int iy = 0; if(incx < 0) ix = (-n+1)*incx; if(incy < 0) iy = (-n+1)*incy; for(int i=0; i= 5) { for(int i=m;i 0 && !Da.equals(1)) { if(incx != 1) { int ix = 0; for (int i=0;i= 5) { for(int i=m;i 0 && (scale != 1)) { if(incx != 1) { int ix = 0; for (int i=0;i= 5) { for(int i=m;i 0) { if(incx != 1 || incy != 1) { int ix = 0; int iy = 0; if(incx < 0) ix = (-n+1)*incx; if(incy < 0) iy = (-n+1)*incy; LNumber N; for(int i=0;i= 3) { LNumber temp; for(int i=m;i 0) { if(incx != 1) { int ix = incx; Dmax = Mat[r][c].abs(); for(int i=1;i