Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/09/12 16:32:44 (12 years ago)
Author:
gkronber
Message:

#1902 improved GPR implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/CovarianceSEiso.cs

    r8455 r8463  
    114114      int cols = xt.GetLength(0);
    115115      sd = new double[rows, cols];
     116      double lInv = 1.0 / l;
    116117      if (symmetric) {
    117118        for (int i = 0; i < rows; i++) {
    118119          for (int j = i; j < rows; j++) {
    119             sd[i, j] = Util.SqrDist(Util.GetRow(x, i).Select(e => e / l), Util.GetRow(xt, j).Select(e => e / l));
     120            sd[i, j] = Util.SqrDist(Util.GetRow(x, i).Select(e => e * lInv), Util.GetRow(xt, j).Select(e => e * lInv));
    120121            sd[j, i] = sd[i, j];
    121122          }
     
    124125        for (int i = 0; i < rows; i++) {
    125126          for (int j = 0; j < cols; j++) {
    126             sd[i, j] = Util.SqrDist(Util.GetRow(x, i).Select(e => e / l), Util.GetRow(xt, j).Select(e => e / l));
     127            sd[i, j] = Util.SqrDist(Util.GetRow(x, i).Select(e => e * lInv), Util.GetRow(xt, j).Select(e => e * lInv));
    127128          }
    128129        }
Note: See TracChangeset for help on using the changeset viewer.