Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/23/16 16:19:04 (8 years ago)
Author:
mkommend
Message:

#2591: Changed all GP covariance and mean functions to use int[] for column indices instead of IEnumerable<int>. Changed GP utils, GPModel and StudentTProcessModell as well to use fewer iterators and adapted unit tests to new interface.

File:
1 edited

Legend:

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

    r12012 r13721  
    117117    }
    118118
    119     public ParameterizedCovarianceFunction GetParameterizedCovarianceFunction(double[] p, IEnumerable<int> columnIndices) {
     119    public ParameterizedCovarianceFunction GetParameterizedCovarianceFunction(double[] p, int[]columnIndices) {
    120120      double inverseLength, period, scale;
    121121      GetParameterValues(p, out scale, out period, out inverseLength);
     
    146146
    147147
    148     private static IEnumerable<double> GetGradient(double[,] x, int i, int j, IEnumerable<int> columnIndices, double scale, double period, double inverseLength,
     148    private static IEnumerable<double> GetGradient(double[,] x, int i, int j, int[] columnIndices, double scale, double period, double inverseLength,
    149149      bool fixedInverseLength, bool fixedPeriod, bool fixedScale) {
    150150      double k = i == j ? 0.0 : Math.PI * GetDistance(x, x, i, j, columnIndices) / period;
     
    161161    }
    162162
    163     private static double GetDistance(double[,] x, double[,] xt, int i, int j, IEnumerable<int> columnIndices) {
    164       return Math.Sqrt(Util.SqrDist(x, i, xt, j, 1, columnIndices));
     163    private static double GetDistance(double[,] x, double[,] xt, int i, int j, int[] columnIndices) {
     164      return Math.Sqrt(Util.SqrDist(x, i, xt, j, columnIndices, 1));
    165165    }
    166166  }
Note: See TracChangeset for help on using the changeset viewer.