Changeset 12667 for stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Transformations/ReciprocalTransformation.cs
- Timestamp:
- 07/08/15 09:50:00 (9 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 12612
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis merged: 12612
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Transformations/ReciprocalTransformation.cs
r11114 r12667 7 7 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 8 8 namespace HeuristicLab.Problems.DataAnalysis { 9 [StorableClass] 9 10 [Item("Reciprocal Transformation", "f(x) = 1 / x | Represents a reciprocal transformation.")] 10 11 public class ReciprocalTransformation : Transformation<double> { … … 16 17 #endregion 17 18 18 //TODO: is a special case of Linear19 19 [StorableConstructor] 20 20 protected ReciprocalTransformation(bool deserializing) : base(deserializing) { } … … 31 31 32 32 public override IEnumerable<double> Apply(IEnumerable<double> data) { 33 foreach (double i in data) { 34 if (i > 0.0) 35 yield return 1.0 / i; 36 else 37 yield return i; 38 } 33 return data.Select(d => d > 0 ? 1.0 / d : d); 39 34 } 40 35
Note: See TracChangeset
for help on using the changeset viewer.