示例#1
0
        public GaSymMultivector GetPartByGrade(Func <int, bool> gradeSelectionFunc)
        {
            var resultMv = new GaSymMultivector(GaSpaceDimension);

            foreach (var term in NonZeroTerms.Where(t => gradeSelectionFunc(t.Key.BasisBladeGrade())))
            {
                resultMv.SetTermCoef(term.Key, term.Value);
            }

            return(resultMv);
        }
示例#2
0
        public GaSymMultivector GetOddPart()
        {
            var resultMv = new GaSymMultivector(GaSpaceDimension);

            foreach (var term in NonZeroTerms.Where(t => (t.Key.BasisBladeGrade() & 1) == 1))
            {
                resultMv.SetTermCoef(term.Key, term.Value);
            }

            return(resultMv);
        }
示例#3
0
        public void Simplify()
        {
            var terms = NonZeroTerms.ToArray();

            ResetToZero();

            foreach (var term in terms)
            {
                term.Value.Simplify();
                SetTermCoef(term.Key, term.Value.Expression);
            }
        }
示例#4
0
        public GaSymMultivector GetKVectorPart(int grade)
        {
            var resultMv = new GaSymMultivector(GaSpaceDimension);

            if (grade < 0 || grade > VSpaceDimension)
            {
                return(resultMv);
            }

            foreach (var term in NonZeroTerms.Where(t => t.Key.BasisBladeGrade() == grade))
            {
                resultMv.SetTermCoef(term.Key, term.Value);
            }

            return(resultMv);
        }