comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java @ 2248:e1eaf9c2b5bf

Fix. flys-artifacts/trunk@3897 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 03 Feb 2012 13:33:58 +0000
parents ec2574eb2d32
children 707b47d8c554
comparison
equal deleted inserted replaced
2247:7a1166758d24 2248:e1eaf9c2b5bf
796 int rowIndex = Collections.binarySearch(rows, new Row(km)); 796 int rowIndex = Collections.binarySearch(rows, new Row(km));
797 797
798 if (rowIndex < 0) { 798 if (rowIndex < 0) {
799 rowIndex = -rowIndex -1; 799 rowIndex = -rowIndex -1;
800 } 800 }
801
802 // TODO Beyond definition, we could stop more clever.
801 if (rowIndex >= rows.size()) { 803 if (rowIndex >= rows.size()) {
802 rowIndex = rows.size() -1; 804 rowIndex = rows.size() -1;
803 } 805 }
804 806
805 Row startRow = rows.get(rowIndex); 807 Row startRow = rows.get(rowIndex);
819 if (!Double.isNaN(rows.get(before).ws[col])) { 821 if (!Double.isNaN(rows.get(before).ws[col])) {
820 rowBefore = rows.get(before); 822 rowBefore = rows.get(before);
821 break; 823 break;
822 } 824 }
823 } 825 }
824 for (int after = rowIndex, R = rows.size(); after < R; after++) { 826 if (rowBefore != null) {
825 if (!Double.isNaN(rows.get(after).ws[col])) { 827 for (int after = rowIndex, R = rows.size(); after < R; after++) {
826 rowAfter = rows.get(after); 828 if (!Double.isNaN(rows.get(after).ws[col])) {
827 break; 829 rowAfter = rows.get(after);
830 break;
831 }
828 } 832 }
829 } 833 }
830 834
831 ws[col] = linearW(km, rowBefore, rowAfter, col); 835 ws[col] = linearW(km, rowBefore, rowAfter, col);
832 } 836 }
913 SplineFunction sf1 = createSpline(km1, errors); 917 SplineFunction sf1 = createSpline(km1, errors);
914 if (sf1 == null) { 918 if (sf1 == null) {
915 return new double[2][0]; 919 return new double[2][0];
916 } 920 }
917 921
918 SplineFunction sf2 = createSpline(km1, errors); 922 SplineFunction sf2 = createSpline(km2, errors);
919 if (sf2 == null) { 923 if (sf2 == null) {
920 return new double[2][0]; 924 return new double[2][0];
921 } 925 }
922 926
923 PolynomialSplineFunction iQ1 = sf1.createIndexQRelation(); 927 PolynomialSplineFunction iQ1 = sf1.createIndexQRelation();

http://dive4elements.wald.intevation.org