示例#1
0
        public static GaNumMapBilinearTree ToTreeMap(this IGaNumMapBilinear bilinearMap)
        {
            var resultMap = GaNumMapBilinearTree.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);
        }
示例#2
0
        public static GaNumMapBilinearCoefSums ToCoefSumsMap(this IGaNumMapBilinear bilinearMap)
        {
            var resultMap = GaNumMapBilinearCoefSums.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.NonZeroTerms)
                {
                    resultMap.SetFactor(term.Key, id1, id2, term.Value);
                }
            }

            return(resultMap);
        }