Beispiel #1
0
        public static Dictionary <int, GaSymMultivector> ToOutermorphismDictionary(this ISymbolicMatrix linearVectorMapMatrix)
        {
            var domainGaSpaceDim =
                linearVectorMapMatrix.ColumnCount.ToGaSpaceDimension();

            var targetGaSpaceDim =
                linearVectorMapMatrix.RowCount.ToGaSpaceDimension();

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

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

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

                if (id.IsValidBasisVectorId())
                {
                    //Add images of vector basis blades
                    basisBladeImage =
                        GaSymMultivector.CreateVectorFromColumn(
                            linearVectorMapMatrix,
                            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);
        }