public double DotSum(LEVector vec) { if (Size != vec.Size) { throw new ArgumentException("The vectors must be have the same number of dimensions."); } return(this.Zip(vec, (x, y) => x * y).Sum()); }
public LEMatrix RemoveColumn(int n) { var result = new LEVector[N - 1]; for (int i = 0; i < N - 1; ++i) { result[i] = i < n?Column(i) : Column(i + 1); } return(new LEMatrix(result)); }
public bool EqualTo(LEVector t) { return(this == t); }
public LEVector Add(LEVector t) { return(this + t); }
public bool Equals(LEVector vec) { return(this.Zip(vec, (x, y) => x == y).Count(x => !x) == 0); }
public double ProjectionLength(LEVector vec) { return(Basic.Norm(DotSum(vec) / vec.Length)); }
/// <summary> /// Projects this vector onto the specified vector. /// </summary> /// <param name="vec"></param> /// <returns></returns> public LEVector Project(LEVector vec) { throw new Exception("Doesn't work"); //return vec * (DotSum(vec) / vec.LengthSquared); }
public MatrixRow(LEVector v) { Data = v.ToArray(); }