From: <ha...@us...> - 2007-04-04 22:55:38
|
Revision: 7315 http://svn.sourceforge.net/jmol/?rev=7315&view=rev Author: hansonr Date: 2007-04-04 15:55:34 -0700 (Wed, 04 Apr 2007) Log Message: ----------- 11.1.28 -- adds experimental Mopac 2007 GRAPHF output MO reader Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java trunk/Jmol/src/org/jmol/adapter/smarter/WebMOReader.java trunk/Jmol/src/org/jmol/quantum/QuantumCalculation.java trunk/Jmol/src/org/jmol/viewer/Isosurface.java Added Paths: ----------- trunk/Jmol/src/org/jmol/adapter/smarter/MopacGraphfReader.java trunk/Jmol/src/org/jmol/quantum/MopacData.java Modified: trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java 2007-04-04 05:23:23 UTC (rev 7314) +++ trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java 2007-04-04 22:55:34 UTC (rev 7315) @@ -31,7 +31,10 @@ import org.jmol.viewer.JmolConstants; import java.io.BufferedReader; +import java.util.Vector; +import java.util.Hashtable; + /* * Notes 9/2006 Bob Hanson * @@ -101,6 +104,12 @@ return Parser.getTokens(line); } + static float[] getTokensFloat(String s, int n) { + float[] f = new float[n]; + Parser.parseFloatArray(getTokens(s), f); + return f; + } + static String[] getTokens(String s) { return Parser.getTokens(s); } @@ -414,7 +423,29 @@ static String getElementSymbol(int elementNumber) { return JmolConstants.elementSymbolFromNumber(elementNumber); } + + static void addSlaterInfoData(Vector intinfo, Vector floatinfo, + int ndata, Hashtable moData) { + int[][] iarray = new int[ndata][]; + for (int i = 0; i < ndata; i++) + iarray[i] = (int[]) intinfo.get(i); + float[][] farray = new float[ndata][]; + for (int i = 0; i < ndata; i++) + farray[i] = (float[]) floatinfo.get(i); + moData.put("slaterInfo", iarray); + moData.put("slaterData", farray); +/* + System.out.println("\n#: ATOM a b c d \tzeta \tcoef"); + for (int i = 0; i < ndata; i++) { + System.out.print(i + ": "); + for (int j = 0; j < 5; j++) + System.out.print(" " + iarray[i][j]); + System.out.println(" \t" + farray[i][0] + " \t" + farray[i][1]); + } +*/ + } + void fillDataBlock(String[][] data) throws Exception { int nLines = data.length; for (int i = 0; i < nLines; i++) Added: trunk/Jmol/src/org/jmol/adapter/smarter/MopacGraphfReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/MopacGraphfReader.java (rev 0) +++ trunk/Jmol/src/org/jmol/adapter/smarter/MopacGraphfReader.java 2007-04-04 22:55:34 UTC (rev 7315) @@ -0,0 +1,290 @@ +/* $RCSfile$ + * $Author: hansonr $ + * $Date: 2006-08-27 21:07:49 -0500 (Sun, 27 Aug 2006) $ + * $Revision: 5420 $ + * + * Copyright (C) 2003-2005 Miguel, Jmol Development, www.jmol.org + * + * Contact: mi...@jm... + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.jmol.adapter.smarter; + + +import java.io.BufferedReader; +import java.util.Vector; +import java.util.Hashtable; + +import org.jmol.quantum.MopacData; + +/** + * Reads Mopac 2007 GRAPHF output files + * + * @author Bob Hanson <ha...@st...> + * + */ +class MopacGraphfReader extends AtomSetCollectionReader { + + int[] atomicNumbers; + int atomCount; + Hashtable moData = new Hashtable(); + Vector orbitals = new Vector(); + int nOrbitals; + + AtomSetCollection readAtomSetCollection(BufferedReader reader) { + + this.reader = reader; + atomSetCollection = new AtomSetCollection("mopac"); + //frameInfo = null; + try { + readAtoms(); + readSlaterBasis(); + readMOs(); + } catch (Exception e) { + return setError(e); + } + return atomSetCollection; + } + + void readAtoms() throws Exception { + atomSetCollection.newAtomSet(); + atomCount = parseInt(readLine()); + atomicNumbers = new int[atomCount]; + for (int i = 0; i < atomCount; i++) { + readLine(); + atomicNumbers[i] = parseInt(line.substring(0, 4)); + Atom atom = atomSetCollection.addNewAtom(); + atom.x = parseFloat(line.substring(4, 17)); + atom.y = parseFloat(line.substring(17, 29)); + atom.z = parseFloat(line.substring(29, 41)); + atom.elementSymbol = AtomSetCollectionReader.getElementSymbol(atomicNumbers[i]); + //System.out.println(atom.elementSymbol + " " + atom.x + " " + atom.y + " " + atom.z); + } + } + + /* + * see http://openmopac.net/manual/graph.html + * + Block 1, 1 line: Number of atoms (5 characters), plain text: "MOPAC-Graphical data" + Block 2, 1 line per atom: Atom number (4 characters), Cartesian coordinates (3 sets of 12 characters) + Block 3, 1 line per atom: Orbital exponents for "s", "p", and "d" Slater orbitals. (3 sets of 11 characters) + Block 4, number of orbitals squared, All the molecular orbital coefficients in the order M.O. 1, M.O.2, etc. (5 data per line, 15 characters per datum, FORTRAN format: 5d15.8) + Block 4, inverse-square-root of overlap matrix, (number of orbitals*(number of orbitals+1))/2. + 4 MOPAC-Graphical data + + 8 0.0000000 0.0000000 0.0000000 + 6 1.2108153 0.0000000 0.0000000 + 1 1.7927832 0.9304938 0.0000000 + 1 1.7927832 -0.9304938 0.0000000 + + + 0 1 2 3 4 + 01234567890123456789012345678901234567890 + + + 5.4217510 2.2709600 0.0000000 + 2.0475580 1.7028410 0.0000000 + 1.2686410 0.0000000 0.0000000 + 1.2686410 0.0000000 0.0000000 + */ + + void readSlaterBasis() throws Exception { + /* + * We have two data structures for each slater, using the WebMO format: + * + * int[] slaterInfo[] = {iatom, a, b, c, d} + * float[] slaterData[] = {zeta, coef} + * + * where + * + * psi = (coef)(x^a)(y^b)(z^c)(r^d)exp(-zeta*r) + * + * except: a == -2 ==> z^2 ==> (coef)(2z^2-x^2-y^2)(r^d)exp(-zeta*r) + * and: b == -2 ==> (coef)(x^2-y^2)(r^d)exp(-zeta*r) + */ + nOrbitals = 0; + Vector intinfo = new Vector(); + Vector floatinfo = new Vector(); + for (int iAtom = 0; iAtom < atomCount; iAtom++) { + float[] values = getTokensFloat(readLine(), 3); + int[] idata; + int atomicNumber = atomicNumbers[iAtom]; + float fdata[]; + float zeta; + if ((zeta = values[0]) != 0) { + //s + fdata = new float[] { zeta, MopacData.getMopacConstS(atomicNumber, zeta) }; + idata = new int[5]; + idata[0] = iAtom; + idata[4] = MopacData.getNPQs(atomicNumber) - 1; + intinfo.add(idata); + floatinfo.add(fdata); + } + if ((zeta = values[1]) != 0) { + int d = MopacData.getNPQp(atomicNumber) - 2; + float coef = MopacData.getMopacConstP(atomicNumber, zeta); + //px + fdata = new float[] { zeta, coef }; + idata = new int[5]; + idata[0] = iAtom; + idata[1] = 1; + idata[4] = d; + intinfo.add(idata); + floatinfo.add(fdata); + + //py + fdata = new float[] { zeta, coef }; + idata = new int[5]; + idata[0] = iAtom; + idata[2] = 1; + idata[4] = d; + intinfo.add(idata); + floatinfo.add(fdata); + + //pz + fdata = new float[] { zeta, coef }; + idata = new int[5]; + idata[0] = iAtom; + idata[3] = 1; + idata[4] = d; + intinfo.add(idata); + floatinfo.add(fdata); + } + if ((zeta = values[2]) != 0) { + int d = MopacData.getNPQd(atomicNumber) - 3; + float coef = MopacData.getMopacConstD(atomicNumber, zeta); + + //d x2-y2 + fdata = new float[] { zeta, coef * MopacData.getFactorD(0) }; + idata = new int[5]; + idata[0] = iAtom; + idata[2] = -2; + idata[4] = d; + intinfo.add(idata); + floatinfo.add(fdata); + + //dxz + fdata = new float[] { zeta, coef * MopacData.getFactorD(1) }; + idata = new int[5]; + idata[0] = iAtom; + idata[1] = 1; + idata[3] = 1; + idata[4] = d; + intinfo.add(idata); + floatinfo.add(fdata); + + //dz2 + fdata = new float[] { zeta, coef * MopacData.getFactorD(2) }; + idata = new int[5]; + idata[0] = iAtom; + idata[1] = -2; + idata[4] = d; + intinfo.add(idata); + floatinfo.add(fdata); + + //dyz + fdata = new float[] { zeta, coef * MopacData.getFactorD(3) }; + idata = new int[5]; + idata[0] = iAtom; + idata[2] = 1; + idata[3] = 1; + idata[4] = d; + intinfo.add(idata); + floatinfo.add(fdata); + + //dxy + fdata = new float[] { zeta, coef * MopacData.getFactorD(4) }; + idata = new int[5]; + idata[0] = iAtom; + idata[1] = 1; + idata[2] = 1; + idata[4] = d; + intinfo.add(idata); + floatinfo.add(fdata); + } + } + nOrbitals = intinfo.size(); + addSlaterInfoData(intinfo, floatinfo, nOrbitals, moData); + } + + void readMOs() throws Exception { + //(5 data per line, 15 characters per datum, FORTRAN format: 5d15.8) + + float[][] list = new float[nOrbitals][nOrbitals]; + for (int iMo = 0; iMo < nOrbitals; iMo++) { + int n = -1; + for (int i = 0; i < nOrbitals; i++) { + if ((n = (n + 1) % 5) == 0) + readLine(); + list[iMo][i] = parseFloat(line.substring(n * 15, (n + 1) * 15)); + } + } +/* + System.out.println("MO file coordinates: "); + for (int i = 0; i < nOrbitals; i++) { + System.out.print((i + 1) + ": "); + for (int j = 0; j < nOrbitals; j++) + System.out.print(" " + list[i][j]); + System.out.println(); + } +*/ + float[][] invMatrix = new float[nOrbitals][nOrbitals]; + for (int iMo = 0; iMo < nOrbitals; iMo++) { + int n = -1; + for (int i = 0; i < iMo + 1; i++) { + if ((n = (n + 1) % 5) == 0) + readLine(); + String s = line.substring(n * 15, (n + 1) * 15); + float value = parseFloat(s); + invMatrix[iMo][i] = invMatrix[i][iMo] = value; + } + } +/* + System.out.println("inversionMatrix: "); + for (int i = 0; i < nOrbitals; i++) { + System.out.print((i + 1) + ": "); + for (int j = 0; j < nOrbitals; j++) + System.out.print(" " + invMatrix[i][j]); + System.out.println(); + } +*/ + float[][] list2 = new float[nOrbitals][nOrbitals]; + for (int i = 0; i < nOrbitals; i++) + for (int j = 0; j < nOrbitals; j++) { + for (int k = 0; k < nOrbitals; k++) + list2[i][j] += (list[i][k] * invMatrix[k][j]); + if (Math.abs(list2[i][j]) < 1e-10) + list2[i][j] = 0; + } + + for (int iMo = 0; iMo < nOrbitals; iMo++) { + Hashtable mo = new Hashtable(); + mo.put("coefficients", list2[iMo]); + orbitals.add(mo); + } + moData.put("mos", orbitals); + atomSetCollection.setAtomSetAuxiliaryInfo("moData", moData); +/* + System.out.println("MO coefficients: "); + for (int i = 0; i < nOrbitals; i++) { + System.out.print((i + 1) + ": "); + for (int j = 0; j < nOrbitals; j++) + System.out.print(" " + list2[i][j]); + System.out.println(); + } +*/ + } +} Modified: trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java 2007-04-04 05:23:23 UTC (rev 7314) +++ trunk/Jmol/src/org/jmol/adapter/smarter/Resolver.java 2007-04-04 22:55:34 UTC (rev 7315) @@ -108,8 +108,8 @@ return "V3000"; if (checkMol(lines)) return "Mol"; - if (checkXyz(lines)) - return "Xyz"; + if (checkMopacGraphf(lines)) + return "MopacGraphf"; if (checkFoldingXyz(lines)) return "FoldingXyz"; if (checkCube(lines)) @@ -229,7 +229,7 @@ return true; } - + /** static boolean checkFoldingXyzxx(String[] lines) { try { StringTokenizer tokens = new StringTokenizer(lines[0].trim(), " \t"); @@ -247,6 +247,15 @@ } return false; } + */ + + /** + * @param lines First lines of the files. + * @return Indicates if the file is a Mopac GRAPHF output file. + */ + static boolean checkMopacGraphf(String[] lines) { + return (lines[0].indexOf("MOPAC-Graphical data") == 6); + } static boolean checkCube(String[] lines) { try { Modified: trunk/Jmol/src/org/jmol/adapter/smarter/WebMOReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/WebMOReader.java 2007-04-04 05:23:23 UTC (rev 7314) +++ trunk/Jmol/src/org/jmol/adapter/smarter/WebMOReader.java 2007-04-04 22:55:34 UTC (rev 7315) @@ -265,20 +265,13 @@ idata[0] = parseInt(tokens[0]) - 1; for (int i = 1; i < 5; i++) idata[i] = parseInt(tokens[i]); - fdata[0] = parseFloat(tokens[5]); - fdata[1] = parseFloat(tokens[6]); + fdata[0] = parseFloat(tokens[5]); //zeta + fdata[1] = parseFloat(tokens[6]); //coef intinfo.add(idata); floatinfo.add(fdata); ndata++; } - int[][] iarray = new int[ndata][]; - for (int i = 0; i < ndata; i++) - iarray[i]=(int[])intinfo.get(i); - moData.put("slaterInfo", iarray); - float[][] farray = new float[ndata][]; - for (int i = 0; i < ndata; i++) - farray[i]=(float[])floatinfo.get(i); - moData.put("slaterData", farray); + addSlaterInfoData(intinfo, floatinfo, ndata, moData); } void readMolecularOrbital() throws Exception { Added: trunk/Jmol/src/org/jmol/quantum/MopacData.java =================================================================== --- trunk/Jmol/src/org/jmol/quantum/MopacData.java (rev 0) +++ trunk/Jmol/src/org/jmol/quantum/MopacData.java 2007-04-04 22:55:34 UTC (rev 7315) @@ -0,0 +1,131 @@ +/* $RCSfile$ + * $Author: hansonr $ + * $Date: 2006-05-13 19:17:06 -0500 (Sat, 13 May 2006) $ + * $Revision: 5114 $ + * + * Copyright (C) 2003-2005 Miguel, Jmol Development, www.jmol.org + * + * Contact: mi...@jm... + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ +package org.jmol.quantum; + +/* + * Sincere thanks to Jimmy Stewart, Mr...@at... for these constants + * + */ + +public class MopacData { + + + ///////////// MOPAC CALCULATION SLATER CONSTANTS ////////////// + + + //H He + //Li Be B C N O F Ne + //Na Mg Al Si P S Cl Ar + //K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr + //Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe + //Cs Ba La Ce-Lu Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn + //Fr Ra Ac Th-Lr ?? ?? ?? ?? + + private final static int[] principalQuantumNumber = new int[] { 0, + 1, 1, // 2 + 2, 2, 2, 2, 2, 2, 2, 2, // 10 + 3, 3, 3, 3, 3, 3, 3, 3, // 18 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 36 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, // 54 + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, // 86 + }; + + private final static int[] pnqD = new int[] { 0, + 0, 3, // 2 + 0, 0, 0, 0, 0, 0, 0, 3, // 10 + 3, 3, 3, 3, 3, 3, 3, 4, // 18 + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, // 36 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, // 54 + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, // 86 + }; + + private final static int getNPQ(int atomicNumber) { + return (atomicNumber < principalQuantumNumber.length ? principalQuantumNumber[atomicNumber] + : 0); + } + + private final static boolean isNoble(int atomicNumber) { + switch (atomicNumber) { + case 2: + case 10: + case 18: + case 36: + case 54: + case 86: + return true; + default: + return false; + } + } + + public final static int getNPQs(int atomicNumber) { + return getNPQ(atomicNumber) + + (atomicNumber > 2 && isNoble(atomicNumber) ? 1 : 0); + } + + public final static int getNPQp(int atomicNumber) { + return getNPQ(atomicNumber) + (atomicNumber == 2 ? 1 : 0); + } + + public final static int getNPQd(int atomicNumber) { + return (atomicNumber < pnqD.length ? pnqD[atomicNumber] : 0); + } + + private final static float[] fact = new float[20]; + static { + fact[0] = 1; + for (int n = 1; n < fact.length; n++) + fact[n] = fact[n - 1] * n; + } + + private final static float fourPi = (float) (4 * Math.PI); + + public final static float getMopacConstS(int atomicNumber, float zeta) { + int n = getNPQs(atomicNumber); + float[] f = fact; + return (float) (Math.pow(2 * zeta, n + 0.5) + * Math.sqrt(1 / fourPi / fact[2 * n])); + } + + public final static float getMopacConstP(int atomicNumber, float zeta) { + int n = getNPQp(atomicNumber); + return (float) (Math.pow(2 * zeta, n + 0.5) + * Math.sqrt(3 / fourPi / fact[2 * n])); + } + + private final static float[] factorDs = new float[] { 0.5f, 1f, (float)(0.5/Math.sqrt(3)), 1f, 1f }; + // x2-y2 xz 2r2 - x2 - y2 yz xy + + public static float getFactorD(int n) { + return factorDs[n]; + } + + public final static float getMopacConstD(int atomicNumber, float zeta) { + int n = getNPQd(atomicNumber); + return (float) (Math.pow(2 * zeta, n + 0.5) + * Math.sqrt(15 / fourPi / fact[2 * n])); + } +} Modified: trunk/Jmol/src/org/jmol/quantum/QuantumCalculation.java =================================================================== --- trunk/Jmol/src/org/jmol/quantum/QuantumCalculation.java 2007-04-04 05:23:23 UTC (rev 7314) +++ trunk/Jmol/src/org/jmol/quantum/QuantumCalculation.java 2007-04-04 22:55:34 UTC (rev 7315) @@ -151,6 +151,7 @@ setupCoordinates(originXYZ, stepsXYZ); atomIndex = -1; moCoeff = 0; + doDebug = (Logger.isActiveLevel(Logger.LEVEL_DEBUG)); // each STO shell is the combination of one or more gaussians int nSlaters = slaterInfo.length; for (int i = 0; i < nSlaters; i++) { @@ -172,7 +173,7 @@ moCoeff = 0; for (int i = 0; i < nShells; i++) { processShell(i); - if (doDebug && Logger.isActiveLevel(Logger.LEVEL_DEBUG)) + if (doDebug) Logger.debug("createGaussianCube shell=" + i + " moCoeff=" + moCoeff + "/" + moCoefficients.length); } @@ -232,7 +233,7 @@ this.atomCoordBohr[i].scale(bohr_per_angstrom); } - if (doDebug && Logger.isActiveLevel(Logger.LEVEL_DEBUG)) + if (doDebug) Logger.debug("QuantumCalculation:\n origin(Bohr)= " + originBohr[0] + " " + originBohr[1] + " " + originBohr[2] + "\n steps(Bohr)= " + stepBohr[0] + " " + stepBohr[1] + " " + stepBohr[2] + "\n counts= " @@ -246,7 +247,7 @@ int nGaussians = ((Integer) shell.get("nGaussians")).intValue(); atomIndex = ((Integer) shell.get("atomIndex")).intValue(); String basisType = (String) shell.get("basisType"); - if (doDebug && Logger.isActiveLevel(Logger.LEVEL_DEBUG)) + if (doDebug) Logger.debug("processShell: " + iShell + " " + basisType + " nGaussians=" + nGaussians + " atom=" + atomIndex); if (atomIndex != lastAtom && atomCoordBohr[atomIndex] != null) { @@ -498,17 +499,6 @@ int d = slaterInfo[slaterIndex][4]; float minuszeta = -slaterData[slaterIndex][0]; float coef = slaterData[slaterIndex][1] * moCoefficients[moCoeff++]; - if (doDebug) { - if (Logger.isActiveLevel(Logger.LEVEL_DEBUG)) { - for (int i = moCoeff; i < moCoeff + 1; i++) - Logger.debug( - "Slater " + slaterIndex + " " + a + " " + b + " " + c + " " + d + - " zeta=" + (-minuszeta) + - " c=" + slaterData[slaterIndex][1] + - " MO coeff " + i + " " + moCoefficients[i]); - } - return; - } setMinMax(a, b, c, d, minuszeta, coef); for (int i = xMax; --i >= xMin;) X[i] = xyzBohr[i][0] - atomCoordBohr[atomIndex].x; @@ -575,3 +565,4 @@ return; } } + Modified: trunk/Jmol/src/org/jmol/viewer/Isosurface.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Isosurface.java 2007-04-04 05:23:23 UTC (rev 7314) +++ trunk/Jmol/src/org/jmol/viewer/Isosurface.java 2007-04-04 22:55:34 UTC (rev 7315) @@ -4501,7 +4501,7 @@ return n * factorial(n - 1); } - float[] fact = new float[20]; + static float[] fact = new float[20]; float getDefaultResolution() { return Float.MAX_VALUE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |