Example #1
0
 public sealed override bool EqualsTo(VectorObject <double> that)
 {
     string[] keys_1 = this.Keys.ToArray();
     string[] keys_2 = that.Keys.ToArray();
     if (!(keys_1.All(k => keys_2.Contains(k)) && keys_2.All(k => keys_1.Contains(k))))
     {
         throw new VectorExceptions.DifferentKeysException(keys_1, keys_2);
     }
     else
     {
         return(keys_1.All(k => this[k] == that[k]));
     }
 }
Example #2
0
 public sealed override VectorObject <double> SubtractImputeMissingKeys(VectorObject <double> that) =>
 new RealVector(this.ElementWiseOpImputeMissingKeys(that, (x, y) => x - y, defaultValue: 0.0));
Example #3
0
 public sealed override VectorObject <double> Subtract(VectorObject <double> that) =>
 new RealVector(this.ElementWiseOp(that, (x, y) => x - y));
Example #4
0
 public sealed override VectorObject <double> MultiplyImputeMissingKeys(VectorObject <double> that) =>
 new RealVector(this.ElementWiseOpImputeMissingKeys(that, (x, y) => x * y, defaultValue: 1.0));
Example #5
0
 public sealed override VectorObject <double> Multiply(VectorObject <double> that) =>
 new RealVector(this.ElementWiseOp(that, (x, y) => x * y));
Example #6
0
 public sealed override VectorObject <double> Add(VectorObject <double> that) =>
 new RealVector(this.ElementWiseOp(that, (x, y) => x + y));
Example #7
0
 public sealed override VectorObject <Interval> Subtract(VectorObject <Interval> that) =>
 new IntervalVector(this.ElementWiseOp(that, (x, y) => x - y));
Example #8
0
 public sealed override VectorObject <Interval> Multiply(VectorObject <Interval> that) =>
 new IntervalVector(this.ElementWiseOp(that, (x, y) => x * y));
Example #9
0
 public sealed override VectorObject <Interval> AddImputeMissingKeys(VectorObject <Interval> that) =>
 new IntervalVector(this.ElementWiseOpImputeMissingKeys(that, (x, y) => x + y, defaultValue: 0.0));