Changeset 4363


Ignore:
Timestamp:
Jul 2, 2008, 8:56:15 AM (15 years ago)
Author:
Jari Häkkinen
Message:

Addresses #1077. A couple of more issues found. Further quality control needed before release.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.7-stable/src/plugins/core/net/sf/basedb/plugins/LowessNormalization.java

    r4360 r4363  
    605605        // while distance from windowStart to i is greater then distance from i to windowEnd: move window
    606606        while ((windowStart + windowSize < dataSize) &&
    607             (Ai - data.get(windowStart).A > data.get(windowStart + windowSize).A - Ai))
     607            (Ai - data.get(windowStart).A > data.get(windowStart + windowSize-1).A - Ai))
    608608        {
    609609          windowStart++;
     
    651651      {
    652652        double w = Math.abs((smoothCurve[j] - data.get(j).M) * invYWRange);
    653         wFit.set(j, w < 1 ? Math.pow(Math.pow(1 - w, 2), 2) : 0);
     653        wFit.set(j, w < 1 ? Math.pow(1 - w*w, 2) : 0);
    654654      }
    655655    }
     
    669669      double v1 = temp.get((temp.size() / 2) - 1);
    670670      double v2 = temp.get((temp.size() / 2));
    671       return 0.5 * v1 * v2;
    672     }
    673     else
    674     {
    675       return temp.get((temp.size() - 1) / 2);
    676     }
     671      return 0.5 * (v1 + v2);
     672    }
     673    return temp.get(temp.size() / 2);
    677674  }
    678675
Note: See TracChangeset for help on using the changeset viewer.