From: <de...@us...> - 2008-10-30 17:06:23
|
Revision: 4115 http://fudaa.svn.sourceforge.net/fudaa/?rev=4115&view=rev Author: deniger Date: 2008-10-30 17:06:20 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluDurationFormatter.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLib.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGeometrie.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluNumberFormatDefault.java branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/interpolation/InterpolationVectorContainer.java branches/Prepro-0.92-SNAPSHOT/ctulu/test/org/fudaa/ctulu/TestJCtuluLib.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/commun/dodico_en.fr_txt branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfElement.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfSegment.java Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluDurationFormatter.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluDurationFormatter.java 2008-10-30 16:04:39 UTC (rev 4114) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluDurationFormatter.java 2008-10-30 17:06:20 UTC (rev 4115) @@ -31,7 +31,7 @@ private static final String[] FIELDS_NAME = new String[] { CtuluLib.getS("Ann\xE9e"), CtuluLib.getS("Mois"), CtuluLib.getS("Jour"), CtuluLib.getS("Heure"), CtuluLib.getS("Minute"), CtuluLib.getS("Seconde") }; - public final static CtuluNumberFormatI DEFAULT_TIME = CtuluNumberFormatDefault.buildNoneFormatter(1,false); + public final static CtuluNumberFormatI DEFAULT_TIME = CtuluNumberFormatDefault.buildNoneFormatter(1, false); public static String getDesc() { return CtuluLib.getS("Une date est attendue"); @@ -47,7 +47,14 @@ } catch (final NumberFormatException e) { // le test bateau a echoue } - String dur = _str; + if (_str == null) return 0; + String dur = _str.trim(); + if (dur.length() == 0) return 0; + boolean neg = dur.charAt(0) == '-'; + if (neg) { + if (dur.length() == 0) return 0; + dur = dur.substring(1); + } final String minSep = "n"; dur = FuLib.replace(dur, FIELDS_ABBREV_MIN, minSep); final StringTokenizer tok = new StringTokenizer(dur, FIELDS_ABBREV_DAY + FIELDS_ABBREV_HOUR + minSep @@ -65,9 +72,7 @@ continue; } if (nexttok.indexOf(':') > 0) { - if (secDone || minDone || hDone) { - throw new NumberFormatException(_str + " h, min,s alreadydone"); - } + if (secDone || minDone || hDone) { throw new NumberFormatException(_str + " h, min,s alreadydone"); } secDone = true; minDone = true; hDone = true; @@ -91,38 +96,26 @@ if (tok.hasMoreTokens()) { final String abbr = tok.nextToken(); if (abbr.equals(FIELDS_ABBREV_SEC)) { - if (secDone) { - throw new NumberFormatException(_str + " sec alreadydone"); - } + if (secDone) { throw new NumberFormatException(_str + " sec alreadydone"); } secDone = true; multiple = 1; } else if (abbr.equals(minSep)) { multiple = 60; - if (minDone) { - throw new NumberFormatException(_str + " min alreadydone"); - } + if (minDone) { throw new NumberFormatException(_str + " min alreadydone"); } minDone = true; } else if (abbr.equals(FIELDS_ABBREV_HOUR)) { - if (hDone) { - throw new NumberFormatException(_str + " hour alreadydone"); - } + if (hDone) { throw new NumberFormatException(_str + " hour alreadydone"); } multiple = 3600; } else if (abbr.equals(FIELDS_ABBREV_DAY)) { - if (jDone) { - throw new NumberFormatException(_str + " day alreadydone"); - } + if (jDone) { throw new NumberFormatException(_str + " day alreadydone"); } jDone = true; multiple = 3600 * 24; } else if (abbr.equals(FIELDS_ABBREV_MONTH)) { - if (monthDone) { - throw new NumberFormatException(_str + " month alreadydone"); - } + if (monthDone) { throw new NumberFormatException(_str + " month alreadydone"); } monthDone = true; multiple = 3600 * 24 * 30; } else if (abbr.equals(FIELDS_ABBREV_YEAR)) { - if (yearDone) { - throw new NumberFormatException(_str + " year alreadydone"); - } + if (yearDone) { throw new NumberFormatException(_str + " year alreadydone"); } yearDone = true; multiple = 3600 * 24 * 365; } else { @@ -132,7 +125,7 @@ r += multiple * val; } } - return (int) r; + return (int) (neg ? -r : r); } public static CtuluDurationFormatter restoreFromLocalizedPattern(String _s) { @@ -168,9 +161,7 @@ } public boolean equals(final Object _obj) { - if (_obj == this) { - return true; - } + if (_obj == this) { return true; } if (_obj != null) { if (_obj.getClass().equals(getClass())) { final CtuluDurationFormatter fmt = (CtuluDurationFormatter) _obj; @@ -373,13 +364,11 @@ public String toLocalizedPattern() { String res = CtuluNumberFormatBuilder.getPrefixForDate(); if (useMonthYear_) res += "USE_MONTH_DAY_YES"; - else - res += "USE_MONTH_DAY_NO"; + else res += "USE_MONTH_DAY_NO"; res += "|"; if (hms_) { res += "USE_HMS_YES"; - } else - res += "USE_HMS_NO"; + } else res += "USE_HMS_NO"; res += "|"; if (isAlwaysDisplayZero()) { res += "USE_ZERO_YES"; Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLib.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLib.java 2008-10-30 16:04:39 UTC (rev 4114) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLib.java 2008-10-30 17:06:20 UTC (rev 4115) @@ -34,6 +34,14 @@ return _d < _eps && _d > -_eps; } + public static boolean isEquals(final double _d, final double _d1, final double _eps) { + return isZero(_d - _d1, _eps); + } + + public static boolean isEquals(final double _d, final double _d1) { + return isZero(_d - _d1); + } + public static String getHelpProperty() { return "HELP_URL"; } @@ -69,6 +77,14 @@ r.setGroupingUsed(false); return r; } + + public static DecimalFormat getDecimalFormat(int nbMaxFractionDigits) { + DecimalFormat res=getDecimalFormat(); + res.setMaximumFractionDigits(nbMaxFractionDigits); + return res; + } + + /** * @return true si la locale est egale a "fr". @@ -80,16 +96,14 @@ /** * Permet d'enlever plusieurs indices d'un tableau. Les anciennes valeurs peuvent etre enregistree. Attention, si un * index n'est pas correct cela peut tout fausser. - * + * * @param _init le tableau a modifier * @param _sortedIdx les indices a enlever donner dans l'ordre * @param _removedValues le tableau qui va contenir (si non null et si de meme taille qui _init) les valeurs enlevees. * @return true si toutes les valeurs */ public static boolean removeIdx(final TDoubleArrayList _init, final int[] _sortedIdx, final double[] _removedValues) { - if (_init == null) { - return false; - } + if (_init == null) { return false; } final int n = _init.size(); final double[] newValues = new double[n]; int idx = 0; @@ -120,7 +134,7 @@ /** * Appele le singleton CTULU. - * + * * @param _s la chaine a traduire * @return le chaine traduite par ctulu */ @@ -130,7 +144,7 @@ /** * Appele le singleton CTULU. - * + * * @param _s la chaine a traduire * @param _v1 la chaine remplacant {0} * @return le chaine traduite par ctulu @@ -141,7 +155,7 @@ /** * Appele le singleton CTULU. - * + * * @param _s la chaine a traduire * @param _v1 la chaine remplacant {0} * @param _v2 la chaine remplacant {1} @@ -159,11 +173,11 @@ /** * Retourne vrai si l'application est lanc\xE9 ou d\xE9ploy\xE9 avec Java Web Start + * * @return si l'application est lanc\xE9 ou d\xE9ploy\xE9 avec Java Web Start */ public static boolean isJavaWebStart() { - return (System.getProperty("javawebstart.version")!=null); + return (System.getProperty("javawebstart.version") != null); } - } Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGeometrie.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGeometrie.java 2008-10-30 16:04:39 UTC (rev 4114) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluLibGeometrie.java 2008-10-30 17:06:20 UTC (rev 4115) @@ -32,12 +32,12 @@ * @return Renvoie la distance entre le point p1(_x1,_y1) et le point p2(_x2,_y2) */ public static double getDistance(final double _x1, final double _y1, final double _x2, final double _y2) { - return Math.sqrt((_x2 - _x1) * (_x2 - _x1) + (_y2 - _y1) * (_y2 - _y1)); + return Math.hypot(_x2 - _x1, _y2 - _y1); } - public static double getDistanceAuCarre(final double _x1, final double _y1, final double _x2, final double _y2) { - return (_x2 - _x1) * (_x2 - _x1) + (_y2 - _y1) * (_y2 - _y1); - } + // public static double getDistanceAuCarre(final double _x1, final double _y1, final double _x2, final double _y2) { + // return (_x2 - _x1) * (_x2 - _x1) + (_y2 - _y1) * (_y2 - _y1); + // } public static double getDistanceXY(final Coordinate _c1, final Coordinate _c2) { return getDistance(_c1.x, _c1.y, _c2.x, _c2.y); @@ -73,14 +73,7 @@ */ public static double distanceFromSegment(final double _segX1, final double _segY1, final double _segX2, final double _segY2, final double _x, final double _y) { - return Math.sqrt(distanceAuCarreFromSegment(_segX1, _segY1, _segX2, _segY2, _x, _y)); - } - - public static double distanceAuCarreFromSegment(final double _segX1, final double _segY1, final double _segX2, - final double _segY2, final double _x, final double _y) { - if ((_segX1 == _segX2) && (_segY1 == _segY2)) { - return getDistanceAuCarre(_segX1, _segY1, _x, _y); - } + if ((_segX1 == _segX2) && (_segY1 == _segY2)) { return getDistance(_segX1, _segY1, _x, _y); } // P1=(_x1,_y1) // P2=(_x2,_y2) // X=thisPoint @@ -90,25 +83,48 @@ // le produit scalaire double p = (_x - _segX1) * (_segX2 - _segX1) + (_y - _segY1) * (_segY2 - _segY1); // si le point est "en dehors" du segment ,on prend la distance X P1 - if (p < 0) { - return getDistanceAuCarre(_x, _y, _segX1, _segY1); - } + if (p < 0) { return getDistance(_x, _y, _segX1, _segY1); } // le produit scalaire/norme de B p = p / ((_segX2 - _segX1) * (_segX2 - _segX1) + (_segY2 - _segY1) * (_segY2 - _segY1)); // si p>1 p est en dehors du segment - if (p > 1) { - return getDistanceAuCarre(_x, _y, _segX2, _segY2); - } + if (p > 1) { return getDistance(_x, _y, _segX2, _segY2); } // le vecteur projete a pour coordonnees PROJ: double projx = p * (_segX2 - _segX1); double projy = p * (_segY2 - _segY1); // le vecteur de norme (on reutilise le variable projx) projx = (_x - _segX1) - projx; projy = (_y - _segY1) - projy; - return projx * projx + projy * projy; + return Math.hypot(projx, projy); } +// public static double distanceAuCarreFromSegment(final double _segX1, final double _segY1, final double _segX2, +// final double _segY2, final double _x, final double _y) { +// if ((_segX1 == _segX2) && (_segY1 == _segY2)) { return getD2(_segX1, _segY1, _x, _y); } +// // P1=(_x1,_y1) +// // P2=(_x2,_y2) +// // X=thisPoint +// // vecteur A=X-P1 +// // vecteur B=P2-P1 +// // On calcule la projection de A sur B +// // le produit scalaire +// double p = (_x - _segX1) * (_segX2 - _segX1) + (_y - _segY1) * (_segY2 - _segY1); +// // si le point est "en dehors" du segment ,on prend la distance X P1 +// if (p < 0) { return getD2(_x, _y, _segX1, _segY1); } +// +// // le produit scalaire/norme de B +// p = p / ((_segX2 - _segX1) * (_segX2 - _segX1) + (_segY2 - _segY1) * (_segY2 - _segY1)); +// // si p>1 p est en dehors du segment +// if (p > 1) { return getD2(_x, _y, _segX2, _segY2); } +// // le vecteur projete a pour coordonnees PROJ: +// double projx = p * (_segX2 - _segX1); +// double projy = p * (_segY2 - _segY1); +// // le vecteur de norme (on reutilise le variable projx) +// projx = (_x - _segX1) - projx; +// projy = (_y - _segY1) - projy; +// return projx * projx + projy * projy; +// } + /** * Tester dans dodico TestMaillage. * @@ -133,7 +149,7 @@ // le vecteur de norme (on reutilise le variable projx) projx = (_x3 - _x1) - projx; projy = (_y3 - _y1) - projy; - return d1d2 * Math.sqrt(projx * projx + projy * projy) / 2; + return d1d2 * Math.hypot(projx, projy) / 2; } /** @@ -149,19 +165,16 @@ public static AffineTransform projection(final Point2D[] _ptImages, final Point2D[] _ptReels) throws IllegalArgumentException { double[] proj = new double[6]; - if (_ptImages == null || _ptReels == null) { - return null; - // double[] projInv = new double[6]; - // double[] m_MatZoom = new double[6]; - // initialiser avec la matrice I - /* - * m_MatZoom[0]=1; m_MatZoom[4]=1; - */ + if (_ptImages == null || _ptReels == null) { return null; + // double[] projInv = new double[6]; + // double[] m_MatZoom = new double[6]; + // initialiser avec la matrice I + /* + * m_MatZoom[0]=1; m_MatZoom[4]=1; + */ } - if ((_ptImages.length != _ptReels.length) || (_ptImages.length < 3)) { - throw new IllegalArgumentException("badData"); - } + if ((_ptImages.length != _ptReels.length) || (_ptImages.length < 3)) { throw new IllegalArgumentException("badData"); } if (_ptImages.length == 3) { try { @@ -170,9 +183,7 @@ - _ptImages[0].getY() * _ptImages[1].getX() + _ptImages[1].getY() * _ptImages[0].getX() + _ptImages[0].getY() * _ptImages[2].getX() - _ptImages[1].getY() * _ptImages[2].getX(); - if (Math.abs(diviseur) < 0.0001) { - throw new Exception("div0"); - } + if (Math.abs(diviseur) < 0.0001) { throw new Exception("div0"); } proj[0] = (float) ((-_ptImages[1].getY() * _ptReels[2].getX() - _ptImages[0].getY() * _ptReels[1].getX() + _ptImages[2].getY() * _ptReels[1].getX() + _ptImages[1].getY() * _ptReels[0].getX() + _ptImages[0].getY() * _ptReels[2].getX() - _ptImages[2].getY() * _ptReels[0].getX()) / diviseur); Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluNumberFormatDefault.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluNumberFormatDefault.java 2008-10-30 16:04:39 UTC (rev 4114) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/CtuluNumberFormatDefault.java 2008-10-30 17:06:20 UTC (rev 4115) @@ -50,8 +50,7 @@ } public static CtuluNumberFormatDefault buildNoneFormatter(int _nbMaxDigits, final boolean _isDecimal) { - NumberFormat fmt = CtuluLib.getDecimalFormat(); - fmt.setMaximumFractionDigits(1); + NumberFormat fmt = CtuluLib.getDecimalFormat(_nbMaxDigits); return new NoneFormater(fmt, _isDecimal); } @@ -70,9 +69,7 @@ } public String format(final double _d) { - if (fmt_ == null) { - return Double.toString(_d); - } + if (fmt_ == null) { return Double.toString(_d); } return fmt_.format(_d); } Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/interpolation/InterpolationVectorContainer.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/interpolation/InterpolationVectorContainer.java 2008-10-30 16:04:39 UTC (rev 4114) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/src/org/fudaa/ctulu/interpolation/InterpolationVectorContainer.java 2008-10-30 17:06:20 UTC (rev 4115) @@ -94,18 +94,14 @@ } public static double getNorme(double _vx, double _vy) { - return Math.sqrt(_vx * _vx + _vy * _vy); + return Math.hypot(_vx, _vy); } public static double getTheta(double _vx, double _vy) { double n = getNorme(_vx, _vy); if (CtuluLib.isZero(n)) return 0; - if (CtuluLib.isZero(_vx)) { - return CtuluLib.getSign(_vy) * Math.PI / 2; - } - if (CtuluLib.isZero(_vy)) { - return _vx >= 0 ? 0 : Math.PI; - } + if (CtuluLib.isZero(_vx)) { return CtuluLib.getSign(_vy) * Math.PI / 2; } + if (CtuluLib.isZero(_vy)) { return _vx >= 0 ? 0 : Math.PI; } double theta = Math.atan(_vy / _vx); return _vx > 0 ? theta : (CtuluLib.getSign(_vy) * Math.PI + theta); } Modified: branches/Prepro-0.92-SNAPSHOT/ctulu/test/org/fudaa/ctulu/TestJCtuluLib.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ctulu/test/org/fudaa/ctulu/TestJCtuluLib.java 2008-10-30 16:04:39 UTC (rev 4114) +++ branches/Prepro-0.92-SNAPSHOT/ctulu/test/org/fudaa/ctulu/TestJCtuluLib.java 2008-10-30 17:06:20 UTC (rev 4115) @@ -63,8 +63,13 @@ } } - - public void testTrimRight(){ + + public void testAireTriangle() { + double aireTriangle = CtuluLibGeometrie.aireTriangle(0, 0, 2, 0, 1, 1); + assertEquals(1, aireTriangle, 1e-5); + } + + public void testTrimRight() { assertEquals(CtuluLibString.EMPTY_STRING, CtuluLibString.trimRight("")); assertEquals(CtuluLibString.EMPTY_STRING, CtuluLibString.trimRight(" ")); assertEquals("5", CtuluLibString.trimRight("5 ")); @@ -190,14 +195,13 @@ finalString = CtuluLibString.adjustSizeBefore(7, init); assertEquals(esp + init, finalString); } - - public void testToString(){ - File fzip=new File("/tmp/toto.zip"); - File fgz=CtuluLibFile.changeExtension(fzip,"gz"); - assertEquals("/tmp/toto.gz",fgz.getAbsolutePath()); + + public void testToString() { + File fzip = new File("/tmp/toto.zip"); + File fgz = CtuluLibFile.changeExtension(fzip, "gz"); + assertEquals("/tmp/toto.gz", fgz.getAbsolutePath()); } - public void testZip() { final String name = getToto(); try { Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/commun/dodico_en.fr_txt =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/commun/dodico_en.fr_txt 2008-10-30 16:04:39 UTC (rev 4114) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/commun/dodico_en.fr_txt 2008-10-30 17:06:20 UTC (rev 4115) @@ -140,4 +140,6 @@ Des conditions limites ont \xE9t\xE9 cr\xE9\xE9es par d\xE9faut=Some boundary conditions have been initialized with default values Les indices sont dans le fichier de log=The index are added to the log file Des ar\xEAtes sont mal d\xE9finies\: indice global du point invalide=Some edges are not valid\: global index is wrong -Variables=Variables \ No newline at end of file +Variables=Variables +Le premier pas de temps n'appartient pas \xE0 la simulation=The simulation doesn't contain the first time step +La dur\xE9e d'int\xE9gration d\xE9passe la dur\xE9e de la simulation=The integration duration overlaps the duration of the simulation Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfElement.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfElement.java 2008-10-30 16:04:39 UTC (rev 4114) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfElement.java 2008-10-30 17:06:20 UTC (rev 4115) @@ -934,12 +934,12 @@ _support.getPtY(next), _x, _y); } - public double getAreteDistAuCarreFrom(final int _idx, final double _x, final double _y, final EfGridInterface _support) { - final int idx = ptIndex_[_idx]; - final int next = ptIndex_[(_idx + 1) % ptIndex_.length]; - return CtuluLibGeometrie.distanceAuCarreFromSegment(_support.getPtX(idx), _support.getPtY(idx), _support - .getPtX(next), _support.getPtY(next), _x, _y); - } +// public double getAreteDistAuCarreFrom(final int _idx, final double _x, final double _y, final EfGridInterface _support) { +// final int idx = ptIndex_[_idx]; +// final int next = ptIndex_[(_idx + 1) % ptIndex_.length]; +// return CtuluLibGeometrie.distanceAuCarreFromSegment(_support.getPtX(idx), _support.getPtY(idx), _support +// .getPtX(next), _support.getPtY(next), _x, _y); +// } public double getDist(final double _x, final double _y, final EfGridInterface _support) { double d2 = getAreteDistFrom(0, _x, _y, _support); @@ -952,16 +952,16 @@ return d2; } - public double getDistAuCarre(final double _x, final double _y, final EfGridInterface _support) { - double d2 = getAreteDistAuCarreFrom(0, _x, _y, _support); - for (int i = ptIndex_.length - 1; i > 0; i--) { - final double dTemp = getAreteDistAuCarreFrom(i, _x, _y, _support); - if (dTemp < d2) { - d2 = dTemp; - } - } - return d2; - } +// public double getDistAuCarre(final double _x, final double _y, final EfGridInterface _support) { +// double d2 = getAreteDistAuCarreFrom(0, _x, _y, _support); +// for (int i = ptIndex_.length - 1; i > 0; i--) { +// final double dTemp = getAreteDistAuCarreFrom(i, _x, _y, _support); +// if (dTemp < d2) { +// d2 = dTemp; +// } +// } +// return d2; +// } /** * Optimisation maillage T6. Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java 2008-10-30 16:04:39 UTC (rev 4114) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfNeighborMesh.java 2008-10-30 17:06:20 UTC (rev 4115) @@ -170,8 +170,8 @@ public double getAverageForNode(final CtuluVariable _var, final int _idxPt, final int _tIdx, final EfData _dataElement, EfGridDataInterpolator _datas) { - if (_datas.getInterpolator().getVect().isVect(_var)) { return getAverageForVect(_var, _idxPt, _tIdx, _dataElement, - _datas.getGridData(), _datas.getInterpolator().getVect()); + if (_datas.getVect().isVect(_var)) { return getAverageForVect(_var, _idxPt, _tIdx, _dataElement, _datas.getData(), + _datas.getVect()); } return getAverageForNodeDanger(_idxPt, _dataElement); @@ -184,8 +184,8 @@ public double getAverageForNode(final CtuluVariable _var, final int _idxPt, final int _tIdx, EfGridDataInterpolator _dataI) { - return getAverageForNode(_var, _idxPt, new EfGridDataInterpolationValuesAdapter(_dataI.getGridData(), _tIdx), - _dataI.getInterpolator().getVect()); + return getAverageForNode(_var, _idxPt, new EfGridDataInterpolationValuesAdapter(_dataI.getData(), _tIdx), _dataI + .getVect()); } public double getAverageForNode(final CtuluVariable _var, final int _idxPt, InterpolationSupportValuesMultiI _datas, Modified: branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfSegment.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfSegment.java 2008-10-30 16:04:39 UTC (rev 4114) +++ branches/Prepro-0.92-SNAPSHOT/dodico/src/org/fudaa/dodico/ef/EfSegment.java 2008-10-30 17:06:20 UTC (rev 4115) @@ -87,9 +87,7 @@ } public double getNorme(final EfGridInterface _support) { - final double vx = getVx(_support); - final double vy = getVy(_support); - return Math.sqrt(vx * vx + vy * vy); + return Math.hypot(getVx(_support) ,getVy(_support)); } public double getCentreX(final EfGridInterface _support) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |