Exemple #1
0
        public bool ApproximatelyEquals(IMultivector other, double?delta = null, double?relativeDelta = null, long?ulpsApart = null)
        {
            if (other == null)
            {
                return(false);
            }
            if (Space != other.Space)
            {
                return(false);
            }

            if (Elements is ISparseList <double> A &&
                other.Elements is ISparseList <double> B)
            {
                foreach (var i in A.Keys.Union(B.Keys))
                {
                    if (!Elements[i].ApproximatelyEquals(other.Elements[i], delta, relativeDelta, ulpsApart))
                    {
                        return(false);
                    }
                }

                return(true);
            }

            for (int i = 0; i < Count; i++)
            {
                if (!this[i].ApproximatelyEquals(other[i], delta, relativeDelta, ulpsApart))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemple #2
0
 public bool Equals(IMultivector other)
 {
     if (other == null)
     {
         return(false);
     }
     if (Space != other?.Space)
     {
         return(false);
     }
     return(MultivectorMethods.AreEqual(this, other));
 }
Exemple #3
0
 public IMultivector Copy(IMultivector other)
 {
     throw new NotImplementedException();
 }