Exemple #1
0
 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());
 }
Exemple #2
0
        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));
        }
Exemple #3
0
 public bool EqualTo(LEVector t)
 {
     return(this == t);
 }
Exemple #4
0
 public LEVector Add(LEVector t)
 {
     return(this + t);
 }
Exemple #5
0
 public bool Equals(LEVector vec)
 {
     return(this.Zip(vec, (x, y) => x == y).Count(x => !x) == 0);
 }
Exemple #6
0
 public double ProjectionLength(LEVector vec)
 {
     return(Basic.Norm(DotSum(vec) / vec.Length));
 }
Exemple #7
0
 /// <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);
 }
Exemple #8
0
 public MatrixRow(LEVector v)
 {
     Data = v.ToArray();
 }