Exemple #1
0
        public static Dictionary <int, GaNumMultivector> ToOutermorphismDictionary(this Matrix linearVectorMapsMatrix)
        {
            var domainGaSpaceDim =
                linearVectorMapsMatrix.ColumnCount.ToGaSpaceDimension();

            var targetGaSpaceDim =
                linearVectorMapsMatrix.RowCount.ToGaSpaceDimension();

            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.CreateVectorFromColumn(
                            linearVectorMapsMatrix,
                            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);
        }