jlapack-0.8~dfsg.orig/ 0000755 0001750 0001750 00000000000 11734055016 014707 5 ustar osallou osallou jlapack-0.8~dfsg.orig/jlapack-3.1.1/ 0000755 0001750 0001750 00000000000 11734055016 016752 5 ustar osallou osallou jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/ 0000755 0001750 0001750 00000000000 11734055026 017542 5 ustar osallou osallou jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/ 0000755 0001750 0001750 00000000000 11734055026 020517 5 ustar osallou osallou jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/Makefile 0000644 0001750 0001750 00000000604 10616163245 022160 0 ustar osallou osallou .PHONY: util ROOT=../.. include $(ROOT)/make.def $(UTIL_JAR): if test -f $(ROOT)/../util/$(UTIL_JAR); then \ cp $(ROOT)/../util/$(UTIL_JAR) .; \ else \ $(MAKE) util_deprecated;\ fi util_deprecated: $(UTIL_CLASSES) $(UTIL_CLASSES): mkdir -p $(OUTDIR) javac -d $(OUTDIR) $(UTIL_PDIR)/*.java cd $(OUTDIR); $(JAR) cvf ../$(UTIL_JAR) . clean: /bin/rm -rf $(OUTDIR) $(UTIL_JAR) jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/ 0000755 0001750 0001750 00000000000 11734055026 021306 5 ustar osallou osallou jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/ 0000755 0001750 0001750 00000000000 11734055026 022563 5 ustar osallou osallou jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/ 0000755 0001750 0001750 00000000000 11734055026 023540 5 ustar osallou osallou jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/EasyIn.java 0000644 0001750 0001750 00000031617 10616163246 025605 0 ustar osallou osallou package org.netlib.util; import java.io.*; /** * Simple input from the keyboard for all primitive types. ver 1.0 *
* Copyright (c) Peter van der Linden, May 5 1997. * corrected error message 11/21/97 *
* The creator of this software hereby gives you permission to: *
* This is not thread safe, not high performance, and doesn't tell EOF. * It's intended for low-volume easy keyboard input. * An example of use is: *
*
* EasyIn easy = new EasyIn();
*
* int i = easy.readInt(); // reads an int from System.in
* float f = easy.readFloat(); // reads a float from System.in
*
* 2/25/98 - modified by Keith Seymour to be useful with the f2j * translator. *
* @author Peter van der Linden */ public class EasyIn { static String line = null; static int idx, len; static String blank_string = " "; /* not oringinally part of EasyIn.. I added this to make it possible * to interleave calls to EasyIn with another input method, which * didn't work with the previous static buffered reader. */ public static String myCrappyReadLine() throws java.io.IOException { StringBuffer sb = new StringBuffer(); int c = 0; while(c >= 0) { c = System.in.read(); if(c < 0) return null; if((char)c == '\n') break; sb.append((char) c); } return sb.toString(); } /** * Reset the tokenizer. * * @throws IOException if an input or output exception occurred. */ private void initTokenizer() throws IOException { do { line = EasyIn.myCrappyReadLine(); if(line == null) throw new IOException("EOF"); idx = 0; len = line.length(); } while(!hasTokens(line)); } /** * Checks if the string contains any tokens. * * @param str string to check * * @return true if there are tokens, false otherwise. */ private boolean hasTokens(String str) { int i, str_len; str_len = str.length(); for(i=0;i < str_len;i++) if(! isDelim(str.charAt(i))) return true; return false; } /** * Checks if this character is a delimiter. * * @param c character to check * * @return true if this character is a delimiter, false otherwise. */ private boolean isDelim(char c) { return ( (c == ' ') || (c == '\t') || (c == '\r') || (c == '\n')); } /** * Checks if there are more tokens. * * @return true if there are more tokens, false otherwise. */ private boolean moreTokens() { return ( idx < len ); } /** * Gets the next token. * * @throws IOException if an input or output exception occurred. * * @return the token */ private String getToken() throws IOException { int begin,end; if( (line == null) || !moreTokens() ) initTokenizer(); while( (idx < len) && isDelim(line.charAt(idx)) ) idx++; if(idx == len) { initTokenizer(); while( (idx < len) && isDelim(line.charAt(idx)) ) idx++; } begin = idx; while( (idx < len) && !isDelim(line.charAt(idx)) ) idx++; end = idx; return line.substring(begin,end); } /** * Reads the specified number of characters and returns a new String * containing them. * * @param num_chars the number of characters to read * * @throws IOException if an input or output exception occurred. * * @return the String containing the characters read. */ public String readchars(int num_chars) throws IOException { int cp_idx; if( (line == null) || !moreTokens() ) initTokenizer(); cp_idx = idx; if(cp_idx + num_chars < len) { idx += num_chars; return( line.substring(cp_idx,cp_idx+num_chars) ); } else { idx = len; return(line.substring(cp_idx,len) + blank_string.substring(0,num_chars-(len-cp_idx))); } } /** * Reads the specified number of characters and returns a new String * containing them. Unlike readchars(), does not throw IOException. * * @param num_chars the number of characters to read * * @return the String containing the characters read. */ public String readChars(int num_chars) { try{ return readchars(num_chars); }catch (IOException e) { System.err.println("IO Exception in EasyIn.readChars"); return null; } } /** * Skips any tokens remaining on this line. */ public void skipRemaining() { line = null; //may not be needed idx = len; } /** * Gets a boolean value from the next token. * * @return the boolean value * * @throws IOException if an input or output exception occurred. */ public boolean readboolean() throws IOException { char ch = getToken().charAt(0); if((ch == 't') || (ch == 'T')) return true; else return false; } /** * Gets a boolean value from the next token. * Same as readboolean() except it does not throw IOException. * * @return the boolean value */ public boolean readBoolean() { try { char ch = getToken().charAt(0); if((ch == 't') || (ch == 'T')) return true; else return false; } catch (IOException ioe) { System.err.println("IO Exception in EasyIn.readBoolean"); return false; } } /** * Gets a byte value from the next token. * * @return the byte value * * @throws IOException if an input or output exception occurred. */ public byte readbyte() throws IOException { return Byte.parseByte(getToken()); } /** * Gets a byte value from the next token. * Same as readbyte() except it does not throw IOException. * * @return the byte value */ public byte readByte() { try { return Byte.parseByte(getToken()); } catch (IOException ioe) { System.err.println("IO Exception in EasyIn.readByte"); return 0; } } /** * Gets a short value from the next token. * * @return the short value * * @throws IOException if an input or output exception occurred. */ public short readshort() throws IOException { return Short.parseShort(getToken()); } /** * Gets a short value from the next token. * Same as readshort() except it does not throw IOException. * * @return the short value */ public short readShort() { try { return Short.parseShort(getToken()); } catch (IOException ioe) { System.err.println("IO Exception in EasyIn.readShort"); return 0; } } /** * Gets an integer value from the next token. * * @return the integer value * * @throws IOException if an input or output exception occurred. */ public int readint() throws IOException { return Integer.parseInt(getToken()); } /** * Gets an integer value from the next token. * Same as readint() except it does not throw IOException. * * @return the integer value */ public int readInt() { try { return Integer.parseInt(getToken()); } catch (IOException ioe) { System.err.println("IO Exception in EasyIn.readInt"); return 0; } } /** * Gets a long integer value from the next token. * * @return the long integer value * * @throws IOException if an input or output exception occurred. */ public long readlong() throws IOException { return Long.parseLong(getToken()); } /** * Gets a long integer value from the next token. * Same as readlong() except it does not throw IOException. * * @return the long integer value */ public long readLong() { try { return Long.parseLong(getToken()); } catch (IOException ioe) { System.err.println("IO Exception in EasyIn.readLong"); return 0L; } } /** * Gets a float value from the next token. * * @return the float value * * @throws IOException if an input or output exception occurred. */ public float readfloat() throws IOException { return new Float(getToken()).floatValue(); } /** * Gets a float value from the next token. * Same as readfloat() except it does not throw IOException. * * @return the float value */ public float readFloat() { try { return new Float(getToken()).floatValue(); } catch (IOException ioe) { System.err.println("IO Exception in EasyIn.readFloat"); return 0.0F; } } /** * Gets a double value from the next token. * * @return the double value * * @throws IOException if an input or output exception occurred. */ public double readdouble() throws IOException { String tok = getToken(); tok = tok.replace('D', 'E'); tok = tok.replace('d', 'e'); return new Double(tok).doubleValue(); } /** * Gets a double value from the next token. * Same as readdouble() except it does not throw IOException. * * @return the double value */ public double readDouble() { try { String tok = getToken(); tok = tok.replace('D', 'E'); tok = tok.replace('d', 'e'); return new Double(tok).doubleValue(); } catch (IOException ioe) { System.err.println("IO Exception in EasyIn.readDouble"); return 0.0; } } /** * Gets a character value from the next token. * * @return the character value * * @throws IOException if an input or output exception occurred. */ public char readchar() throws IOException { return getToken().charAt(0); } /** * Gets a character value from the next token. * Same as readchar() except it does not throw IOException. * * @return the character value */ public char readChar() { try { return getToken().charAt(0); } catch (IOException ioe) { System.err.println("IO Exception in EasyIn.readChar"); return 0; } } /** * Gets a string value from the next token. * * @return the string value * * @throws IOException if an input or output exception occurred. */ public String readstring() throws IOException { return EasyIn.myCrappyReadLine(); } /** * Gets a string value from the next token. * Same as readstring() except it does not throw IOException. * * @return the string value */ public String readString() { try { return EasyIn.myCrappyReadLine(); } catch (IOException ioe) { System.err.println("IO Exception in EasyIn.readString"); return ""; } } /** * This method is just here to test the class */ public static void main (String args[]){ EasyIn easy = new EasyIn(); System.out.print("enter char: "); System.out.flush(); System.out.println("You entered: " + easy.readChar() ); System.out.print("enter String: "); System.out.flush(); System.out.println("You entered: " + easy.readString() ); System.out.print("enter boolean: "); System.out.flush(); System.out.println("You entered: " + easy.readBoolean() ); System.out.print("enter byte: "); System.out.flush(); System.out.println("You entered: " + easy.readByte() ); System.out.print("enter short: "); System.out.flush(); System.out.println("You entered: " + easy.readShort() ); System.out.print("enter int: "); System.out.flush(); System.out.println("You entered: " + easy.readInt() ); System.out.print("enter long: "); System.out.flush(); System.out.println("You entered: " + easy.readLong() ); System.out.print("enter float: "); System.out.flush(); System.out.println("You entered: " + easy.readFloat() ); System.out.print("enter double: "); System.out.flush(); System.out.println("You entered: " + easy.readDouble() ); } } jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/ArraySpec.java 0000644 0001750 0001750 00000002012 10616163246 026271 0 ustar osallou osallou package org.netlib.util; import java.util.Vector; public class ArraySpec { private Vector vec; public ArraySpec(int [] arr, int offset, int len) { vec = new Vector(); for(int i=offset; i< offset+len; i++) vec.addElement(new Integer(arr[i])); } public ArraySpec(double [] arr, int offset, int len) { vec = new Vector(); for(int i=offset; i< offset+len; i++) vec.addElement(new Double(arr[i])); } public ArraySpec(float [] arr, int offset, int len) { vec = new Vector(); for(int i=offset; i< offset+len; i++) vec.addElement(new Float(arr[i])); } public ArraySpec(String [] arr, int offset, int len) { vec = new Vector(); for(int i=offset; i< offset+len; i++) vec.addElement(new String(arr[i])); } public ArraySpec(String str) { char [] chars = str.toCharArray(); vec = new Vector(); for(int i = 0; i < chars.length; i++) vec.addElement(new String(String.valueOf(chars[i]))); } public Vector get_vec() { return vec; } } jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/StringW.java 0000644 0001750 0001750 00000001012 10616163246 025774 0 ustar osallou osallou package org.netlib.util; /** * f2j object wrapper for strings. *
* This file is part of the Fortran-to-Java (f2j) system, * developed at the University of Tennessee. *
* This class acts as an object wrapper for passing string * values by reference in f2j translated files. *
* @author Keith Seymour (seymour@cs.utk.edu) * */ public class StringW { public String val; /** * Create a new string wrapper. * * @param x the initial value */ public StringW(String x) { val = x; } } jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/floatW.java 0000644 0001750 0001750 00000001046 10616163246 025642 0 ustar osallou osallou package org.netlib.util; /** * f2j object wrapper for floats. *
* This file is part of the Fortran-to-Java (f2j) system, * developed at the University of Tennessee. *
* This class acts as an object wrapper for passing single * precision floating point values by reference in f2j * translated files. *
* @author Keith Seymour (seymour@cs.utk.edu) * */ public class floatW { public float val; /** * Create a new float wrapper. * * @param x the initial value */ public floatW(float x) { val = x; } } jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/intW.java 0000644 0001750 0001750 00000001002 10616163246 025317 0 ustar osallou osallou package org.netlib.util; /** * f2j object wrapper for integers. *
* This file is part of the Fortran-to-Java (f2j) system, * developed at the University of Tennessee. *
* This class acts as an object wrapper for passing integer * values by reference in f2j translated files. *
* @author Keith Seymour (seymour@cs.utk.edu) * */ public class intW { public int val; /** * Create a new int wrapper. * * @param x the initial value */ public intW(int x) { val = x; } } jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/Dummy.java 0000644 0001750 0001750 00000002707 10616163246 025506 0 ustar osallou osallou package org.netlib.util; /** * Placeholders for Fortran GOTO statements and labels. *
* This file is part of the Fortran-to-Java (f2j) system, * developed at the University of Tennessee. *
* This class aids in the translation of goto statements. * The code generator translates gotos and labels into calls * to Dummy.go_to() or Dummy.label(). These calls act as * 'placeholders' so that the gotos and labels can be found * in the class file and converted to real branch * instructions in the bytecode. Thus the resulting class * file should contain no calls to Dummy.go_to() or Dummy.label(). * If so, the print statements should warn the user that the * goto translation was not successful. *
* @author Keith Seymour (seymour@cs.utk.edu) * */ public class Dummy { /** * Placeholder for a Fortran GOTO statement. * * @param clname name of the program unit where this GOTO exists * @param lbl the label number (target) of the GOTO */ public static void go_to(String clname, int lbl) { System.err.println("Warning: Untransformed goto remaining in program! (" +clname+", " + lbl + ")"); } /** * Placeholder for a Fortran label. * * @param clname name of the program unit where this label exists * @param lbl the label number */ public static void label(String clname, int lbl) { System.err.println("Warning: Untransformed label remaining in program! (" +clname+", " + lbl + ")"); } } jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/StrictUtil.java 0000644 0001750 0001750 00000017620 10616163246 026521 0 ustar osallou osallou package org.netlib.util; import java.io.*; /** * StrictMath versions of various math related Fortran intrinsic functions. *
* This file is part of the Fortran-to-Java (f2j) system, * developed at the University of Tennessee. *
* This class contains Strict versions of the math related utilities * in {@link Util}. *
* @author Keith Seymour (seymour@cs.utk.edu) * */ public strictfp class StrictUtil extends Util { /** * Three argument integer max function. *
* This function uses Java's StrictMath package. * * @param x value 1 * @param y value 2 * @param z value 3 * * @return the largest of x, y, or z */ public static int max(int x, int y, int z) { return StrictMath.max( x > y ? x : y, StrictMath.max(y,z)); } /** * Three argument single precision max function. *
* This function uses Java's StrictMath package. * * @param x value 1 * @param y value 2 * @param z value 3 * * @return the largest of x, y, or z */ public static float max(float x, float y, float z) { return StrictMath.max( x > y ? x : y, StrictMath.max(y,z)); } /** * Three argument double precision max function. *
* This function uses Java's StrictMath package. * * @param x value 1 * @param y value 2 * @param z value 3 * * @return the largest of x, y, or z */ public static double max(double x, double y, double z) { return StrictMath.max( x > y ? x : y, StrictMath.max(y,z)); } /** * Three argument integer min function. *
* This function uses Java's StrictMath package. * * @param x value 1 * @param y value 2 * @param z value 3 * * @return the smallest of x, y, or z */ public static int min(int x, int y, int z) { return StrictMath.min( x < y ? x : y, StrictMath.min(y,z)); } /** * Three argument single precision min function. *
* This function uses Java's StrictMath package. * * @param x value 1 * @param y value 2 * @param z value 3 * * @return the smallest of x, y, or z */ public static float min(float x, float y, float z) { return StrictMath.min( x < y ? x : y, StrictMath.min(y,z)); } /** * Three argument double precision min function. *
* This function uses Java's StrictMath package. * * @param x value 1 * @param y value 2 * @param z value 3 * * @return the smallest of x, y, or z */ public static double min(double x, double y, double z) { return StrictMath.min( x < y ? x : y, StrictMath.min(y,z)); } /** * Base-10 logarithm function. *
* This function uses Java's StrictMath package. * * @param x the value * * @return base-10 log of x */ public static double log10(double x) { return StrictMath.log(x) / 2.30258509; } /** * Base-10 logarithm function. *
* This function uses Java's StrictMath package. * * @param x the value * * @return base-10 log of x */ public static float log10(float x) { return (float) (StrictMath.log(x) / 2.30258509); } /** * Fortran nearest integer (NINT) intrinsic function. *
* Returns: *
* This function uses Java's StrictMath package. * * @param x the floating point value * * @return the nearest integer to x */ public static int nint(float x) { return (int) (( x >= 0 ) ? (x + 0.5) : (x - 0.5)); } /** * Fortran nearest integer (IDNINT) intrinsic function. *
* Returns:
*
* This function uses Java's StrictMath package. * * @param x the double precision floating point value * * @return the nearest integer to x */ public static int idnint(double x) { return (int) (( x >= 0 ) ? (x + 0.5) : (x - 0.5)); } /** * Fortran floating point transfer of sign (SIGN) intrinsic function. *
* Returns:
*
* This function uses Java's StrictMath package. * * @param a1 floating point value * @param a2 sign transfer indicator * * @return equivalent of Fortran SIGN(a1,a2) as described above. */ public static float sign(float a1, float a2) { return (a2 >= 0) ? StrictMath.abs(a1) : -StrictMath.abs(a1); } /** * Fortran integer transfer of sign (ISIGN) intrinsic function. *
* Returns:
*
* This function uses Java's StrictMath package. * * @param a1 integer value * @param a2 sign transfer indicator * * @return equivalent of Fortran ISIGN(a1,a2) as described above. */ public static int isign(int a1, int a2) { return (a2 >= 0) ? StrictMath.abs(a1) : -StrictMath.abs(a1); } /** * Fortran double precision transfer of sign (DSIGN) intrinsic function. *
* Returns:
*
* This function uses Java's StrictMath package. * * @param a1 double precision floating point value * @param a2 sign transfer indicator * * @return equivalent of Fortran DSIGN(a1,a2) as described above. */ public static double dsign(double a1, double a2) { return (a2 >= 0) ? StrictMath.abs(a1) : -StrictMath.abs(a1); } /** * Fortran floating point positive difference (DIM) intrinsic function. *
* Returns:
*
* This function uses Java's StrictMath package. * * @param a1 floating point value * @param a2 floating point value * * @return equivalent of Fortran DIM(a1,a2) as described above. */ public static float dim(float a1, float a2) { return (a1 > a2) ? (a1 - a2) : 0; } /** * Fortran integer positive difference (IDIM) intrinsic function. *
* Returns:
*
* This function uses Java's StrictMath package. * * @param a1 integer value * @param a2 integer value * * @return equivalent of Fortran IDIM(a1,a2) as described above. */ public static int idim(int a1, int a2) { return (a1 > a2) ? (a1 - a2) : 0; } /** * Fortran double precision positive difference (DDIM) intrinsic function. *
* Returns:
*
* This function uses Java's StrictMath package. * * @param a1 double precision floating point value * @param a2 double precision floating point value * * @return equivalent of Fortran DDIM(a1,a2) as described above. */ public static double ddim(double a1, double a2) { return (a1 > a2) ? (a1 - a2) : 0; } /** * Fortran hyperbolic sine (SINH) intrinsic function. *
* This function uses Java's StrictMath package. * * @param a the value to get the sine of * * @return the hyperbolic sine of a */ public static double sinh(double a) { return ( StrictMath.exp(a) - StrictMath.exp(-a) ) * 0.5; } /** * Fortran hyperbolic cosine (COSH) intrinsic function. *
* This function uses Java's StrictMath package. * * @param a the value to get the cosine of * * @return the hyperbolic cosine of a */ public static double cosh(double a) { return ( StrictMath.exp(a) + StrictMath.exp(-a) ) * 0.5; } /** * Fortran hyperbolic tangent (TANH) intrinsic function. *
* This function uses Java's StrictMath package. * * @param a the value to get the tangent of * * @return the hyperbolic tangent of a */ public static double tanh(double a) { return sinh(a) / cosh(a); } } jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/MatConv.java 0000644 0001750 0001750 00000012763 10616163246 025765 0 ustar osallou osallou package org.netlib.util; /** * Conversions between one-dimensional linearized arrays and two-dimensional arays. *
* This file is part of the Fortran-to-Java (f2j) system, * developed at the University of Tennessee. *
* This class contains methods for converting between the linearized * arrays used by f2j-generated code and the more natural Java-style * two-dimensional arrays. *
* @author Keith Seymour (seymour@cs.utk.edu) * */ public class MatConv { /** * Convert a double precision two-dimensional array to * a linearized one-dimensional array. * * @param m the matrix to be converted * * @return the linearized array */ public static double[] doubleTwoDtoOneD (double[][]m) { /* We make the assumption here that the matrices are * square (or rectangular), to get the value of * the second index. */ int ld = m.length; double[] apimatrix = new double[ld * m[0].length]; for (int i = 0; i < ld; i++) for (int j = 0; j < m[0].length; j++) apimatrix[i + j * ld] = m[i][j]; return apimatrix; } /** * Convert a double precision linearized one-dimensional array * to a two-dimensional array. * * @param vec the linearized array to be converted * @param ld leading dimension of the array * * @return the two-dimensional array */ public static double[][] doubleOneDtoTwoD(double [] vec, int ld) { int i,j; double [][] mat = new double [ld][vec.length / ld]; for (i = 0; i < ld; i++) for (j = 0; j < mat[0].length; j++) mat[i][j] = vec[i + j * ld]; return mat; } /** * Convert a single precision two-dimensional array to * a linearized one-dimensional array. * * @param m the matrix to be converted * * @return the linearized array */ public static float[] floatTwoDtoOneD (float[][]m) { /* We make the assumption here that the matrices are * square (or rectangular), to get the value of * the second index. */ int ld = m.length; float[] apimatrix = new float[ld * m[0].length]; for (int i = 0; i < ld; i++) for (int j = 0; j < m[0].length; j++) apimatrix[i + j * ld] = m[i][j]; return apimatrix; } /** * Convert a single precision linearized one-dimensional array * to a two-dimensional array. * * @param vec the linearized array to be converted * @param ld leading dimension of the array * * @return the two-dimensional array */ public static float[][] floatOneDtoTwoD(float [] vec, int ld) { int i,j; float [][] mat = new float [ld][vec.length / ld]; for (i = 0; i < ld; i++) for (j = 0; j < mat[0].length; j++) mat[i][j] = vec[i + j * ld]; return mat; } /** * Convert an integer two-dimensional array to * a linearized one-dimensional array. * * @param m the matrix to be converted * * @return the linearized array */ public static int[] intTwoDtoOneD (int[][]m) { /* We make the assumption here that the matrices are * square (or rectangular), to get the value of * the second index. */ int ld = m.length; int[] apimatrix = new int[ld * m[0].length]; for (int i = 0; i < ld; i++) for (int j = 0; j < m[0].length; j++) apimatrix[i + j * ld] = m[i][j]; return apimatrix; } /** * Convert an integer linearized one-dimensional array * to a two-dimensional array. * * @param vec the linearized array to be converted * @param ld leading dimension of the array * * @return the two-dimensional array */ public static int[][] intOneDtoTwoD(int [] vec, int ld) { int i,j; int [][] mat = new int [ld][vec.length / ld]; for (i = 0; i < ld; i++) for (j = 0; j < mat[0].length; j++) mat[i][j] = vec[i + j * ld]; return mat; } /** * Copies a linearized array into an already allocated two-dimensional * matrix. This is typically called from the simplified wrappers * after the raw routine has been called and the results need to be * copied back into the Java-style two-dimensional matrix. * * @param mat destination matrix * @param vec source array */ public static void copyOneDintoTwoD(double [][]mat, double[]vec) { int i,j; int ld = mat.length; for (i = 0; i < ld; i++) for (j = 0; j < mat[0].length; j++) mat[i][j] = vec[i + j * ld]; } /** * Copies a linearized array into an already allocated two-dimensional * matrix. This is typically called from the simplified wrappers * after the raw routine has been called and the results need to be * copied back into the Java-style two-dimensional matrix. * * @param mat destination matrix * @param vec source array */ public static void copyOneDintoTwoD(float [][]mat, float[]vec) { int i,j; int ld = mat.length; for (i = 0; i < ld; i++) for (j = 0; j < mat[0].length; j++) mat[i][j] = vec[i + j * ld]; } /** * Copies a linearized array into an already allocated two-dimensional * matrix. This is typically called from the simplified wrappers * after the raw routine has been called and the results need to be * copied back into the Java-style two-dimensional matrix. * * @param mat destination matrix * @param vec source array */ public static void copyOneDintoTwoD(int [][]mat, int[]vec) { int i,j; int ld = mat.length; for (i = 0; i < ld; i++) for (j = 0; j < mat[0].length; j++) mat[i][j] = vec[i + j * ld]; } } jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/Util.java 0000644 0001750 0001750 00000031005 10616163246 025321 0 ustar osallou osallou package org.netlib.util; import java.io.*; import java.util.Vector; import org.j_paine.formatter.*; /** * Implementations of various Fortran intrinsic functions. *
* This file is part of the Fortran-to-Java (f2j) system, * developed at the University of Tennessee. *
* This class contains various helper routines for f2j-generated code. * These routines are primarily implemented for handling Fortran intrinsic * functions. *
* @author Keith Seymour (seymour@cs.utk.edu) * */ public class Util { /** * Inserts a string into a substring of another string. *
* This method handles situations in which the lhs of an * assignment statement is a substring operation. For example: *
*
* a(3:4) = 'hi'
*
*
* We haven't figured out an elegant way to do this with Java Strings, * but we do handle it, as follows: *
*
*
* Where E1 is the expression representing the starting index of the substring
* and E2 is the expression representing the ending index of the substring
*
* The resulting code looks pretty bad because we have to be
* prepared to handle rhs strings that are too big to fit in
* the lhs substring.
*
* @param x dest (string to be inserted into)
* @param y source (substring to insert into 'x')
* @param E1 expression representing the start of the substring
* @param E2 expression representing the end of the substring
*
* @return the string containing the complete string after inserting the
* substring
*/
public static String stringInsert(String x, String y, int E1, int E2) {
String tmp;
tmp = new String(
x.substring(0,E1-1) +
y.substring(0,E2-E1+1) +
x.substring(E2,x.length()));
return tmp;
}
/**
* Inserts a string into a single character substring of another string.
*
* @param x dest (string to be inserted into)
* @param y source (substring to insert into 'x')
* @param E1 expression representing the index of the character
*
* @return the string containing the complete string after inserting the
* substring
*/
public static String stringInsert(String x, String y, int E1) {
return stringInsert(x, y, E1, E1);
}
/**
* Returns a string representation of the character at the given index.
* Note: this is based on the Fortran index (1..N).
*
* @param s the string
* @param idx the index
*
* @return new string containing a single character (from s[idx])
*/
public static String strCharAt(String s, int idx) {
return String.valueOf(s.charAt(idx-1));
}
/**
* Three argument integer max function.
*
* @param x value 1
* @param y value 2
* @param z value 3
*
* @return the largest of x, y, or z
*/
public static int max(int x, int y, int z) {
return Math.max( x > y ? x : y, Math.max(y,z));
}
/**
* Three argument single precision max function.
*
* @param x value 1
* @param y value 2
* @param z value 3
*
* @return the largest of x, y, or z
*/
public static float max(float x, float y, float z) {
return Math.max( x > y ? x : y, Math.max(y,z));
}
/**
* Three argument double precision max function.
*
* @param x value 1
* @param y value 2
* @param z value 3
*
* @return the largest of x, y, or z
*/
public static double max(double x, double y, double z) {
return Math.max( x > y ? x : y, Math.max(y,z));
}
/**
* Three argument integer min function.
*
* @param x value 1
* @param y value 2
* @param z value 3
*
* @return the smallest of x, y, or z
*/
public static int min(int x, int y, int z) {
return Math.min( x < y ? x : y, Math.min(y,z));
}
/**
* Three argument single precision min function.
*
* @param x value 1
* @param y value 2
* @param z value 3
*
* @return the smallest of x, y, or z
*/
public static float min(float x, float y, float z) {
return Math.min( x < y ? x : y, Math.min(y,z));
}
/**
* Three argument double precision min function.
*
* @param x value 1
* @param y value 2
* @param z value 3
*
* @return the smallest of x, y, or z
*/
public static double min(double x, double y, double z) {
return Math.min( x < y ? x : y, Math.min(y,z));
}
/**
* Base-10 logarithm function.
*
* @param x the value
*
* @return base-10 log of x
*/
public static double log10(double x) {
return Math.log(x) / 2.30258509;
}
/**
* Base-10 logarithm function.
*
* @param x the value
*
* @return base-10 log of x
*/
public static float log10(float x) {
return (float) (Math.log(x) / 2.30258509);
}
/**
* Fortran nearest integer (NINT) intrinsic function.
*
* Returns:
*
* Returns:
* Returns:
* Returns:
* Returns:
* Returns:
* Returns:
* Returns:
* I think this was an implementation dependent feature of Fortran 77.
*/
public static void pause() {
pause(null);
}
/**
* Pauses execution temporarily.
*
* I think this was an implementation dependent feature of Fortran 77.
*
* @param msg the message to be printed before pausing. if null, no
* message will be printed.
*/
public static void pause(String msg) {
if(msg != null)
System.err.println("PAUSE: " + msg);
else
System.err.print("PAUSE: ");
System.err.println("To resume execution, type: go");
System.err.println("Any other input will terminate the program.");
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String response = null;
try {
response = in.readLine();
} catch (IOException e) {
response = null;
}
if( (response == null) || !response.equals("go")) {
System.err.println("STOP");
System.exit(0);
}
}
/**
* Formatted write.
*/
public static void f77write(String fmt, Vector v)
{
if(fmt == null) {
f77write(v);
return;
}
try {
Formatter f = new Formatter(fmt);
Vector newvec = processVector(v);
f.write( newvec, System.out );
System.out.println();
}
catch ( Exception e ) {
String m = e.getMessage();
if(m != null)
System.out.println(m);
else
System.out.println();
}
}
/**
* Unformatted write.
*/
public static void f77write(Vector v)
{
java.util.Enumeration e;
Object o;
Vector newvec = processVector(v);
e = newvec.elements();
/* fortran seems to prepend a space before the first
* unformatted element. since non-string types get
* a string prepended in the loop below, we only
* do it for strings here.
*/
if(e.hasMoreElements()) {
o = e.nextElement();
if(o instanceof String)
System.out.print(" ");
output_unformatted_element(o);
}
while(e.hasMoreElements())
output_unformatted_element(e.nextElement());
System.out.println();
}
private static void output_unformatted_element(Object o) {
if(o instanceof Boolean) {
/* print true/false as T/F like fortran does */
if(((Boolean) o).booleanValue())
System.out.print(" T");
else
System.out.print(" F");
}
else if((o instanceof Float) || (o instanceof Double))
System.out.print(" " + o); // two spaces
else if(o instanceof String)
System.out.print(o);
else
System.out.print(" " + o); // one space
}
public static int f77read(String fmt, Vector v)
{
try {
Formatter f = new Formatter(fmt);
f.read( v, new DataInputStream(System.in) );
}
catch ( EndOfFileWhenStartingReadException eof_exc) {
return 0;
}
catch ( Exception e ) {
String m = e.getMessage();
if(m != null)
System.out.println(m);
else
System.out.println("Warning: READ exception.");
return -1;
}
return v.size();
}
/**
* Expands array elements into separate entries in the Vector.
*
*/
static Vector processVector(Vector v)
{
java.util.Enumeration e;
Vector newvec = new Vector();
for(e = v.elements(); e.hasMoreElements() ;) {
Object el = e.nextElement();
if(el instanceof ArraySpec)
newvec.addAll(((ArraySpec)el).get_vec());
else
newvec.addElement(el);
}
return newvec;
}
}
jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/booleanW.java 0000644 0001750 0001750 00000001026 10616163246 026152 0 ustar osallou osallou package org.netlib.util;
/**
* f2j object wrapper for booleans.
*
* This file is part of the Fortran-to-Java (f2j) system,
* developed at the University of Tennessee.
*
* This class acts as an object wrapper for passing boolean
* values by reference in f2j translated files.
*
* @author Keith Seymour (seymour@cs.utk.edu)
*
*/
public class booleanW {
public boolean val;
/**
* Create a new boolean wrapper.
*
* @param x the initial value
*/
public booleanW(boolean x) {
val = x;
}
}
jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/Etime.java 0000644 0001750 0001750 00000003624 10616163246 025455 0 ustar osallou osallou package org.netlib.util;
/**
* Implementation of Fortran ETIME intrinsic.
*
* This file is part of the Fortran-to-Java (f2j) system,
* developed at the University of Tennessee.
*
* This class implements the Fortran 77 ETIME intrinsic.
* ETIME is supposed to provide the CPU time for the
* process since the start of execution. Currently,
* Java doesn't have a similar method, so we use this
* cheesy simulation:
* @author Keith Seymour (seymour@cs.utk.edu)
*
*/
public class Etime {
private static int call_num = 0;
private static long start_time = 0;
/**
* Initializes the timer.
*/
public static void etime()
{
float [] dummy = new float[2];
etime(dummy,0);
}
/**
* Get the elapsed time. Sets the first element of the
* array 't' to the elapsed time. This is also the
* return value.
*
* @param t Two-element array of times. The first
* element should be user time. The second element
* should be system time. Currently these are set
* the same, though.
* @param t_offset Offset from t. Normally zero.
*
* @return first element of t.
*/
public static float etime(float [] t, int t_offset)
{
if(call_num++ == 0)
{
start_time = System.currentTimeMillis();
t[0 + t_offset] = 0.0f;
t[1 + t_offset] = 0.0f;
return 0.0f;
}
t[0 + t_offset]=(float)(System.currentTimeMillis() - start_time) / 1000.0f;
t[1 + t_offset] = t[0 + t_offset];
return t[0 + t_offset];
}
}
jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/Second.java 0000644 0001750 0001750 00000002375 10616163246 025627 0 ustar osallou osallou package org.netlib.util;
/**
* Implementation of Fortran SECOND intrinsic function.
*
* This file is part of the Fortran-to-Java (f2j) system,
* developed at the University of Tennessee.
*
* This class implements the Fortran 77 SECOND intrinsic.
* SECOND is supposed to provide the CPU time for the
* process since the start of execution. Currently,
* Java doesn't have a similar method, so we use this
* cheesy simulation:
* @author Keith Seymour (seymour@cs.utk.edu)
*
*/
public class Second {
/**
* Supposed to return the elapsed CPU time since the beginning of
* program execution. Currently implemented as wall clock time.
*
* @return the elapsed time.
*/
public static float second()
{
float [] tarray= new float[2];
Etime.etime();
Etime.etime(tarray,0);
return tarray[0];
}
}
jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/netlib/util/doubleW.java 0000644 0001750 0001750 00000001054 10616163246 026006 0 ustar osallou osallou package org.netlib.util;
/**
* f2j object wrapper for doubles.
*
* This file is part of the Fortran-to-Java (f2j) system,
* developed at the University of Tennessee.
*
* This class acts as an object wrapper for passing double
* precision floating point values by reference in f2j
* translated files.
*
* @author Keith Seymour (seymour@cs.utk.edu)
*
*/
public class doubleW {
public double val;
/**
* Create a new double wrapper.
*
* @param x the initial value
*/
public doubleW(double x) {
val = x;
}
}
jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/j_paine/ 0000755 0001750 0001750 00000000000 11734055026 022713 5 ustar osallou osallou jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/j_paine/formatter/ 0000755 0001750 0001750 00000000000 11734055026 024716 5 ustar osallou osallou ././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/j_paine/formatter/EndOfFileWhenStartingReadException.java jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/j_paine/formatter/EndOfFileWhenStartingReadExceptio0000644 0001750 0001750 00000001423 10616163245 033270 0 ustar osallou osallou package org.j_paine.formatter;
public class EndOfFileWhenStartingReadException extends InputFormatException
{
public EndOfFileWhenStartingReadException( int vecptr,
String format,
String line,
int line_number
)
{
this( "End of file when starting read of formatted data:\n" +
" Index = " + vecptr + "\n" +
" Format = " + format + "\n" +
"Last line was number " + line_number + ":\n" +
line
);
}
public EndOfFileWhenStartingReadException( String s )
{
super( s );
}
public EndOfFileWhenStartingReadException( )
{
super( );
}
}
jlapack-0.8~dfsg.orig/jlapack-3.1.1/src/util/org/j_paine/formatter/Formatter.java 0000644 0001750 0001750 00000131003 10616163245 027523 0 ustar osallou osallou /* Formatter.java */
package org.j_paine.formatter;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.StringBufferInputStream;
import java.util.Hashtable;
import java.util.Vector;
/* This class holds a Format, and has methods for reading and
writing data against it.
*/
public class Formatter
{
private Format format = null;
private FormatMap format_map = null;
public Formatter( String format ) throws InvalidFormatException
{
this( new Format(format) );
}
public Formatter( Format format )
{
this.format = format;
}
public void setFormatMap( FormatMap format_map )
{
this.format_map = format_map;
}
public void write( Vector v, PrintStream out )
throws OutputFormatException
{
FormatX dummy_el = new FormatX();
FormatOutputList vp = new VectorAndPointer( v );
while(true) {
try {
this.format.write( vp, out );
vp.checkCurrentElementForWrite(dummy_el);
out.println();
}catch(EndOfVectorOnWriteException e) {
break;
}
}
}
public void write( int i, PrintStream out )
throws OutputFormatException
{
write( new Integer(i), out );
}
public void write( long l, PrintStream out )
throws OutputFormatException
{
write( new Long(l), out );
}
public void write( float f, PrintStream out )
throws OutputFormatException
{
write( new Float(f), out );
}
public void write( double d, PrintStream out )
throws OutputFormatException
{
write( new Double(d), out );
}
public void write( Object o, PrintStream out )
throws OutputFormatException
{
Vector v = new Vector();
v.addElement( o );
write( v, out );
}
public void read( Vector v, DataInputStream in )
throws InputFormatException
{
FormatInputList vp = new VectorAndPointer( v );
InputStreamAndBuffer inb = new InputStreamAndBuffer(in);
this.format.read( vp, inb, this.format_map );
}
public void read( Vector v, Hashtable ht, DataInputStream in )
throws InputFormatException
{
FormatInputList vp = new StringsHashtableAndPointer( v, ht );
InputStreamAndBuffer inb = new InputStreamAndBuffer(in);
this.format.read( vp, inb, this.format_map );
}
public void read( String[] s, Hashtable ht, DataInputStream in )
throws InputFormatException
{
Vector v = new Vector();
for ( int i = 0; i
* a = new StringW(
* a.val.substring(0,E1-1) +
* "hi".substring(0,E2-E1+1) +
* a.val.substring(E2,a.val.length())
* );
*
*
*
*
* @param x the floating point value
*
* @return the nearest integer to x
*/
public static int nint(float x) {
return (int) (( x >= 0 ) ? (x + 0.5) : (x - 0.5));
}
/**
* Fortran nearest integer (IDNINT) intrinsic function.
*
*
*
*
* @param x the double precision floating point value
*
* @return the nearest integer to x
*/
public static int idnint(double x) {
return (int) (( x >= 0 ) ? (x + 0.5) : (x - 0.5));
}
/**
* Fortran floating point transfer of sign (SIGN) intrinsic function.
*
*
*
*
* @param a1 floating point value
* @param a2 sign transfer indicator
*
* @return equivalent of Fortran SIGN(a1,a2) as described above.
*/
public static float sign(float a1, float a2) {
return (a2 >= 0) ? Math.abs(a1) : -Math.abs(a1);
}
/**
* Fortran integer transfer of sign (ISIGN) intrinsic function.
*
*
*
*
* @param a1 integer value
* @param a2 sign transfer indicator
*
* @return equivalent of Fortran ISIGN(a1,a2) as described above.
*/
public static int isign(int a1, int a2) {
return (a2 >= 0) ? Math.abs(a1) : -Math.abs(a1);
}
/**
* Fortran double precision transfer of sign (DSIGN) intrinsic function.
*
*
*
*
* @param a1 double precision floating point value
* @param a2 sign transfer indicator
*
* @return equivalent of Fortran DSIGN(a1,a2) as described above.
*/
public static double dsign(double a1, double a2) {
return (a2 >= 0) ? Math.abs(a1) : -Math.abs(a1);
}
/**
* Fortran floating point positive difference (DIM) intrinsic function.
*
*
*
*
* @param a1 floating point value
* @param a2 floating point value
*
* @return equivalent of Fortran DIM(a1,a2) as described above.
*/
public static float dim(float a1, float a2) {
return (a1 > a2) ? (a1 - a2) : 0;
}
/**
* Fortran integer positive difference (IDIM) intrinsic function.
*
*
*
*
* @param a1 integer value
* @param a2 integer value
*
* @return equivalent of Fortran IDIM(a1,a2) as described above.
*/
public static int idim(int a1, int a2) {
return (a1 > a2) ? (a1 - a2) : 0;
}
/**
* Fortran double precision positive difference (DDIM) intrinsic function.
*
*
*
*
* @param a1 double precision floating point value
* @param a2 double precision floating point value
*
* @return equivalent of Fortran DDIM(a1,a2) as described above.
*/
public static double ddim(double a1, double a2) {
return (a1 > a2) ? (a1 - a2) : 0;
}
/**
* Fortran hyperbolic sine (SINH) intrinsic function.
*
* @param a the value to get the sine of
*
* @return the hyperbolic sine of a
*/
public static double sinh(double a) {
return ( Math.exp(a) - Math.exp(-a) ) * 0.5;
}
/**
* Fortran hyperbolic cosine (COSH) intrinsic function.
*
* @param a the value to get the cosine of
*
* @return the hyperbolic cosine of a
*/
public static double cosh(double a) {
return ( Math.exp(a) + Math.exp(-a) ) * 0.5;
}
/**
* Fortran hyperbolic tangent (TANH) intrinsic function.
*
* @param a the value to get the tangent of
*
* @return the hyperbolic tangent of a
*/
public static double tanh(double a) {
return sinh(a) / cosh(a);
}
/**
* Pauses execution temporarily.
*
*
*
* Essentially, this version of etime returns the
* wall-clock time elapsed since the beginning of
* execution.
*
*
*
* Essentially, this version of etime returns the
* wall-clock time elapsed since the beginning of
* execution.
*