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/Util.cs

    r8401 r8463  
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    2423using System.Linq;
     
    3231    public static double SqrDist(double x, double y) {
    3332      double d = x - y;
    34       return Math.Max(d * d, 0.0);
     33      return d * d;
    3534    }
    3635
    3736    public static double SqrDist(IEnumerable<double> x, IEnumerable<double> y) {
    38       return x.Zip(y, SqrDist).Sum();
     37      return x.Zip(y, (a, b) => (a - b) * (a - b)).Sum();
    3938    }
    4039
Note: See TracChangeset for help on using the changeset viewer.