예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        public static IGaSymMultivectorTemp SetTerms(this IGaSymMultivectorTemp tempMv, IGaSymMultivectorTemp termsMv)
        {
            foreach (var term in termsMv.NonZeroExprTerms)
            {
                tempMv.SetTermCoef(term.Key, term.Value);
            }

            return(tempMv);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
        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);
        }