public override ErrorReport Validate() { ErrorReporting.ErrorReport report = new ErrorReport(); if (X.Count() != Y.Count()) { report.AddError(new CurveError("Your X values and Y values are not the same length.", 0, 0)); } int decreasingcount = 0; for (int i = 1; i < Math.Min(X.Count(), Y.Count()); i++) { if (Y[i] > Y[i - 1]) { report.AddError(new CurveError("Input Y values are not monotonically decreasing", i, 1)); } if (X[i] < X[i - 1]) { report.AddError(new CurveError("Input Y values are not monotonically increasing", i, 1)); decreasingcount += 1; } if (decreasingcount > 0 && decreasingcount != Math.Min(Y.Count(), X.Count()) - 2) { report.AddError(new CurveError("The input arrays do not pass the vertical line test", 0, 0)); } } return(report); }
public override void ValidateCondition(ErrorReport p_Report) { p_Report.AddError("This condition is not supported."); }