- Timestamp:
- 02/06/19 16:16:50 (6 years ago)
- Location:
- branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs
r16548 r16592 43 43 public bool Contains(double value) { 44 44 return LowerBound <= value && value <= UpperBound; 45 } 46 47 public bool Contains(Interval other, bool lowerBoundInclusive = true, bool upperBoundInclusive = false) { 48 if (double.IsNegativeInfinity(this.LowerBound) && double.IsPositiveInfinity(this.UpperBound)) 49 return true; 50 //Left-unbounded and right-bounded: 51 if (double.IsNegativeInfinity(this.LowerBound)) { 52 if (upperBoundInclusive) 53 return other.LowerBound <= this.UpperBound && other.UpperBound <= this.UpperBound; 54 return other.LowerBound < this.UpperBound && other.UpperBound < this.UpperBound; 55 } 56 57 //Left-bounded and right-unbounded: 58 if (double.IsPositiveInfinity(this.UpperBound)) { 59 if (lowerBoundInclusive) 60 return other.LowerBound >= this.LowerBound && other.UpperBound >= this.LowerBound; 61 return other.LowerBound > this.LowerBound && other.UpperBound > this.LowerBound; 62 } 63 64 //Proper and bounded: 65 //Closed: 66 if (lowerBoundInclusive && upperBoundInclusive) { 67 return this.LowerBound <= other.LowerBound && other.UpperBound <= this.UpperBound; 68 } 69 70 //Open: 71 if (!lowerBoundInclusive && !upperBoundInclusive) { 72 return this.LowerBound < other.LowerBound && other.UpperBound < this.UpperBound; 73 } 74 75 //Left-closed, right-open: 76 if (lowerBoundInclusive) { 77 return this.LowerBound <= other.LowerBound && other.UpperBound < this.UpperBound; 78 } 79 80 //Left-open, right-closed: 81 return this.LowerBound < other.LowerBound && other.UpperBound <= this.UpperBound; 45 82 } 46 83 -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraint.cs
r16590 r16592 7 7 namespace HeuristicLab.Problems.DataAnalysis { 8 8 public class IntervalConstraint { 9 public string Derivaiton { get; set; }9 public string Expression { get; set; } 10 10 public string Definition { get; set; } 11 11 public Interval Interval { get; set; } -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraintsParser.cs
r16590 r16592 40 40 intervalConstraint.IsDerivation = false; 41 41 } 42 intervalConstraint. Derivaiton = matches[i].Groups[0].Value;42 intervalConstraint.Expression = matches[i].Groups[0].Value; 43 43 intervalConstraint.InclusiveLowerBound = (matches[i].Groups[2].Value == "["); 44 44 intervalConstraint.InclusiveUpperBound = (matches[i].Groups[6].Value == "]"); -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r16586 r16592 105 105 } 106 106 107 public IFixedValueParameter<NamedIntervals> VariableRangesParameter {108 get { return (IFixedValueParameter<NamedIntervals>)Parameters[VariableRangesParameterName]; } 109 }107 public IFixedValueParameter<NamedIntervals> VariableRangesParameter => (IFixedValueParameter<NamedIntervals>)Parameters[VariableRangesParameterName]; 108 109 public NamedIntervals VariableRanges => VariableRangesParameter.Value; 110 110 111 111 public IFixedValueParameter<TextValue> IntervalConstraintsParameter => (IFixedValueParameter<TextValue>) Parameters[IntervalConstraintsParameterName]; 112 public TextValue IntervalConstraints => IntervalConstraintsParameter.Value; 112 113 113 114 public string TargetVariable {
Note: See TracChangeset
for help on using the changeset viewer.