Exemplo n.º 1
0
        public static GaSymMapUnilinearCoefSums ToCoefSumsMap(this Dictionary <int, GaSymMultivector> basisBladeMaps, int domainVSpaceDim, int targetVSpaceDim)
        {
            var resultMap = GaSymMapUnilinearCoefSums.Create(domainVSpaceDim, targetVSpaceDim);

            foreach (var term in basisBladeMaps.Where(p => !p.Value.IsNullOrZero()))
            {
                resultMap.SetBasisBladeMap(term.Key, term.Value);
            }

            return(resultMap);
        }
Exemplo n.º 2
0
        public static GaSymMapUnilinearCoefSums ToCoefSumsMap(this IGaSymMapUnilinear linearMap)
        {
            var resultMap = GaSymMapUnilinearCoefSums.Create(
                linearMap.DomainVSpaceDimension,
                linearMap.TargetVSpaceDimension
                );

            foreach (var basisBladeMap in linearMap.BasisBladeMaps())
            {
                resultMap.SetBasisBladeMap(basisBladeMap.Item1, basisBladeMap.Item2);
            }

            return(resultMap);
        }
Exemplo n.º 3
0
        public static GaSymMapUnilinearCoefSums ToCoefSumsMap(this ISymbolicMatrix linearMapMatrix)
        {
            Debug.Assert(linearMapMatrix.RowCount.IsValidGaSpaceDimension() && linearMapMatrix.ColumnCount.IsValidGaSpaceDimension());

            var resultMap = GaSymMapUnilinearCoefSums.Create(
                linearMapMatrix.ColumnCount.ToVSpaceDimension(),
                linearMapMatrix.RowCount.ToVSpaceDimension()
                );

            for (var id = 0; id < linearMapMatrix.ColumnCount; id++)
            {
                var mv = GaSymMultivector.CreateFromColumn(linearMapMatrix, id);

                if (!mv.IsNullOrZero())
                {
                    resultMap.SetBasisBladeMap(id, mv);
                }
            }

            return(resultMap);
        }