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); }
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); }
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); }