Exemple #1
0
        public static Dictionary <int, GaNumMultivector> ToOutermorphismDictionary(this IEnumerable <double[]> linearVectorMaps)
        {
            var linearVectorMapsArray = linearVectorMaps.ToArray();

            var domainGaSpaceDim =
                linearVectorMapsArray.Length.ToGaSpaceDimension();

            var targetGaSpaceDim =
                linearVectorMapsArray[0].Length;

            var omMapDict = new Dictionary <int, GaNumMultivector>();

            //Add unit scalar as the image of the 0-basis blade
            omMapDict.Add(0, GaNumMultivector.CreateUnitScalar(targetGaSpaceDim));

            for (var id = 1; id <= domainGaSpaceDim - 1; id++)
            {
                GaNumMultivector basisBladeImage;

                if (id.IsValidBasisVectorId())
                {
                    //Add images of vector basis blades
                    basisBladeImage = GaNumMultivector.CreateVectorFromScalars(
                        linearVectorMapsArray[id.BasisBladeIndex()]
                        );
                }
                else
                {
                    //Add images of a higher dimensional basis blade using the outer product
                    //of the images of two lower dimensional basis blades
                    int id1, id2;
                    id.SplitBySmallestBasicPattern(out id1, out id2);

                    basisBladeImage =
                        omMapDict[id1].Op(omMapDict[id2]);
                }

                if (!basisBladeImage.IsZero())
                {
                    omMapDict.Add(id, basisBladeImage);
                }
            }

            return(omMapDict);
        }