コード例 #1
0
        public static Table1D TruncateInvalidXValues(this Table1D table)
        {
            var oldX = table.x;

            ExceptionHelpers.Ensure <ArgumentException>(oldX.Length > 0);
            var increasing = oldX.Length == 1 || (oldX[1] > oldX[0]);
            var count      = increasing ? oldX.StrictlyIncreasingCount() : oldX.StrictlyDecreasingCount();
            var x          = oldX.Take(count).ToArray();
            var f          = table.f.Take(count).ToArray();

            return(new Table1D(x, f));
        }
コード例 #2
0
ファイル: Table1D.cs プロジェクト: pedro2555/QSimPlanner
 public bool Equals(Table1D item, double delta)
 {
     return(DoubleArrayCompare.Equals(x, item.x, delta) &&
            DoubleArrayCompare.Equals(f, item.f, delta));
 }