public INDimensionalVector ScalarMultiply(INDimensionalVector factor) { var result = new NDimensionalVector(); for (var i = 0; i < Count && i < factor.Count; i++) { result[i] = this[i] * factor[i]; } return(result); }
public INDimensionalVector Inverse() { var result = new NDimensionalVector(); for (var i = 0; i < Count; i++) { result[i] = -this[i]; } return(result); }
private INDimensionalVector Adder(INDimensionalVector value, AdderArgument type) { var length = GetBiggerLength(value); var result = new NDimensionalVector(); for (var i = 0; i < length; i++) { if (i >= _vector.Count) { result[i] = (int)type * value[i]; } else if (i >= value.Count) { result[i] = this[i]; } else { result[i] = this[i] + (int)type * value[i]; } } return(result); }