- Timestamp:
- 08/09/12 16:32:44 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/Util.cs
r8401 r8463 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 23 using System.Linq; … … 32 31 public static double SqrDist(double x, double y) { 33 32 double d = x - y; 34 return Math.Max(d * d, 0.0);33 return d * d; 35 34 } 36 35 37 36 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(); 39 38 } 40 39
Note: See TracChangeset
for help on using the changeset viewer.