float IVectorF.Dot(IVectorF other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } if (other.Dimension < this.Dimension) { return(other.Dot(this)); } var dim = this.Dimension; var result = 0f; for (var i = 0; i < dim; i++) { result += this.values[i] * other[i]; } return(result); }
IVectorF IVectorF.Subtract(IVectorF other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } if (this.Dimension >= other.Dimension) { var dim = this.Dimension; var result = new float[dim]; for (var i = 0; i < dim; i++) { result[i] = this.values[i] - other[i]; } return(new VectorNf(ref result)); } else { return(other.Subtract(this)); } }