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