Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/27/17 15:15:23 (7 years ago)
Author:
gkronber
Message:

#2700: changes and while reviewing

File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/IndexedItemDistance.cs

    r14784 r14785  
    2020#endregion
    2121
     22using HeuristicLab.Collections;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2627namespace HeuristicLab.Algorithms.DataAnalysis {
    2728  [StorableClass]
    28   [Item("DataPointDistance", "A distance wrapper for DataPoints")]
    29   internal class DataPointDistance<T> : DistanceBase<IDataPoint<T>> where T : class {
    30 
    31     #region properties
     29  [Item("IndexedItemDistance", "A distance wrapper for indexed items")]
     30  internal class IndexedItemDistance<T> : DistanceBase<IndexedItem<T>> {
    3231    [Storable]
    33     private IDistance<T> dist;
    34     #endregion
     32    private readonly IDistance<T> dist;
    3533
    3634    #region HLConstructors & Cloning
    3735    [StorableConstructor]
    38     protected DataPointDistance(bool deserializing) : base(deserializing) { }
    39     protected DataPointDistance(DataPointDistance<T> original, Cloner cloner) : base(original, cloner) {
     36    protected IndexedItemDistance(bool deserializing) : base(deserializing) { }
     37    protected IndexedItemDistance(IndexedItemDistance<T> original, Cloner cloner) : base(original, cloner) {
    4038      dist = cloner.Clone(original.dist);
    4139    }
    42     public override IDeepCloneable Clone(Cloner cloner) { return new DataPointDistance<T>(this, cloner); }
    43     public DataPointDistance(IDistance<T> distance) {
     40    public override IDeepCloneable Clone(Cloner cloner) { return new IndexedItemDistance<T>(this, cloner); }
     41    public IndexedItemDistance(IDistance<T> distance) {
    4442      dist = distance;
    4543    }
    4644    #endregion
    4745
    48     public override double Get(IDataPoint<T> a, IDataPoint<T> b) {
    49       return dist.Get(a.X, b.X);
     46    public override double Get(IndexedItem<T> a, IndexedItem<T> b) {
     47      return dist.Get(a.Value, b.Value);
    5048    }
    5149  }
Note: See TracChangeset for help on using the changeset viewer.