- Timestamp:
- 03/27/17 15:15:23 (7 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/Distances/IndexedItemDistance.cs
r14784 r14785 20 20 #endregion 21 21 22 using HeuristicLab.Collections; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 namespace HeuristicLab.Algorithms.DataAnalysis { 27 28 [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>> { 32 31 [Storable] 33 private IDistance<T> dist; 34 #endregion 32 private readonly IDistance<T> dist; 35 33 36 34 #region HLConstructors & Cloning 37 35 [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) { 40 38 dist = cloner.Clone(original.dist); 41 39 } 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) { 44 42 dist = distance; 45 43 } 46 44 #endregion 47 45 48 public override double Get(I DataPoint<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); 50 48 } 51 49 }
Note: See TracChangeset
for help on using the changeset viewer.