Ejemplo n.º 1
0
 /// <summary>
 /// Construct the exception.
 /// </summary>
 /// <param name="wrong"> Value that did not match the requirements. </param>
 /// <param name="previous"> Previous value in the sequence. </param>
 /// <param name="index"> Index of the value that did not match the requirements. </param>
 /// <param name="direction"> Strictly positive for a sequence required to be
 /// increasing, negative (or zero) for a decreasing sequence. </param>
 /// <param name="strict"> Whether the sequence must be strictly increasing or
 /// decreasing. </param>
 public NonMonotonicSequenceException(Number wrong, Number previous, int index, MathArrays.OrderDirection direction, bool strict) : base(direction == MathArrays.OrderDirection.INCREASING ? (strict ? LocalizedFormats.NOT_STRICTLY_INCREASING_SEQUENCE : LocalizedFormats.NOT_INCREASING_SEQUENCE) : (strict ? LocalizedFormats.NOT_STRICTLY_DECREASING_SEQUENCE : LocalizedFormats.NOT_DECREASING_SEQUENCE), wrong, previous, Convert.ToInt32(index), Convert.ToInt32(index - 1))
 {
     this.direction = direction;
     this.strict    = strict;
     this.index     = index;
     this.previous  = previous;
 }
 /// <summary>
 /// Construct the exception.
 /// </summary>
 /// <param name="wrong">Value that did not match the requirements.</param>
 /// <param name="previous">Previous value in the sequence.</param>
 /// <param name="index">Index of the value that did not match the requirements.</param>
 /// <param name="direction">Strictly positive for a sequence required to be
 /// increasing, negative (or zero) for a decreasing sequence.</param>
 /// <param name="strict">Whether the sequence must be strictly increasing or
 /// decreasing.</param>
 public NonMonotonicSequenceException(U wrong, T previous, int index, MathArrays.OrderDirection direction, Boolean strict) :
     base((direction == MathArrays.OrderDirection.INCREASING) ?
          (strict ? new LocalizedFormats("NOT_STRICTLY_INCREASING_SEQUENCE") :
           new LocalizedFormats("NOT_INCREASING_SEQUENCE")) :
          (strict ? new LocalizedFormats("NOT_STRICTLY_DECREASING_SEQUENCE") :
           new LocalizedFormats("NOT_DECREASING_SEQUENCE")),
          wrong, previous, index, index - 1)
 {
     this.direction = direction;
     this.strict    = strict;
     this.index     = index;
     this.previous  = previous;
 }
 public NonMonotonicSequenceException(double d, double previous, int index, MathArrays.OrderDirection dir, bool strict)
 {
     throw new NotImplementedException();
 }