public static IGaSymMultivectorTemp AddFactors(this IGaSymMultivectorTemp tempMv, Expr scalar, IGaSymMultivectorTemp termsMv) { foreach (var term in termsMv.NonZeroExprTerms) { tempMv.AddFactor(term.Key, Mfs.Times[term.Value, scalar]); } return(tempMv); }
public static IGaSymMultivectorTemp AddFactors(this IGaSymMultivectorTemp tempMv, Expr scalar, IEnumerable <KeyValuePair <int, Expr> > terms) { foreach (var term in terms) { tempMv.AddFactor(term.Key, Mfs.Times[term.Value, scalar]); } return(tempMv); }
public static IGaSymMultivectorTemp SetTerms(this IGaSymMultivectorTemp tempMv, IGaSymMultivectorTemp termsMv) { foreach (var term in termsMv.NonZeroExprTerms) { tempMv.SetTermCoef(term.Key, term.Value); } return(tempMv); }
public static IGaSymMultivectorTemp SetTerms(this IGaSymMultivectorTemp tempMv, IEnumerable <KeyValuePair <int, Expr> > terms) { foreach (var term in terms) { tempMv.SetTermCoef(term.Key, term.Value); } return(tempMv); }
public static GaTreeMultivector ToTreeMultivector(this IGaSymMultivectorTemp sparseMv) { var treeMv = GaTreeMultivector.CreateZero(sparseMv.GaSpaceDimension); foreach (var term in sparseMv.NonZeroExprTerms) { treeMv[term.Key] = term.Value; } return(treeMv); }
public static IGaSymMultivectorTemp AddFactors(this IGaSymMultivectorTemp tempMv, IEnumerable <GaSymMultivectorBiTerm> biTerms, GaSymMetricOrthogonal orthogonalMetric) { foreach (var biTerm in biTerms) { tempMv.AddFactor( biTerm.IdXor, biTerm.IsNegativeEGp, Mfs.Times[biTerm.Value1, biTerm.Value2, orthogonalMetric[biTerm.IdAnd]] ); } return(tempMv); }
public static IGaSymMultivectorTemp AddFactors(this IGaSymMultivectorTemp tempMv, IEnumerable <GaSymMultivectorBiTerm> biTerms) { foreach (var biTerm in biTerms) { tempMv.AddFactor( biTerm.IdXor, biTerm.IsNegativeEGp, biTerm.TotalProduct ); } return(tempMv); }
public static IGaSymMultivectorTemp SetTerms(this IGaSymMultivectorTemp tempMv, ISymbolicVector termsMv) { for (var id = 0; id < termsMv.Size; id++) { var coef = termsMv[id].Expression; if (!coef.IsNullOrZero()) { tempMv.SetTermCoef(id, coef); } } return(tempMv); }