Exemple #1
0
        public static GaSymMapBilinearTree ToTreeMap(this IGaSymMapBilinear bilinearMap)
        {
            var resultMap = GaSymMapBilinearTree.Create(
                bilinearMap.DomainVSpaceDimension,
                bilinearMap.TargetVSpaceDimension
                );

            foreach (var basisBladeMapping in bilinearMap.BasisBladesMaps())
            {
                var id1 = basisBladeMapping.Item1;
                var id2 = basisBladeMapping.Item2;
                var mv  = basisBladeMapping.Item3;

                resultMap.SetBasisBladesMap(id1, id2, mv);
            }

            return(resultMap);
        }
Exemple #2
0
        public static GaSymMapBilinearCoefSums ToCoefSumsMap(this IGaSymMapBilinear bilinearMap)
        {
            var resultMap = GaSymMapBilinearCoefSums.Create(
                bilinearMap.DomainVSpaceDimension,
                bilinearMap.TargetVSpaceDimension
                );

            foreach (var basisBladeMapping in bilinearMap.BasisBladesMaps())
            {
                var id1 = basisBladeMapping.Item1;
                var id2 = basisBladeMapping.Item2;
                var mv  = basisBladeMapping.Item3;

                foreach (var term in mv.NonZeroExprTerms)
                {
                    resultMap.SetFactor(term.Key, id1, id2, term.Value);
                }
            }

            return(resultMap);
        }