Example #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);
        }
Example #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);
        }
Example #3
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);
        }