public static GaSymMapUnilinearArray ToArrayMap(this Dictionary <int, GaSymMultivector> basisBladeMaps, int domainVSpaceDim, int targetVSpaceDim) { var resultMap = GaSymMapUnilinearArray.Create(domainVSpaceDim, targetVSpaceDim); foreach (var term in basisBladeMaps.Where(p => !p.Value.IsNullOrZero())) { resultMap.SetBasisBladeMap(term.Key, term.Value); } return(resultMap); }
public static GaSymMapUnilinearArray ToArrayMap(this IGaSymMapUnilinear linearMap) { var resultMap = GaSymMapUnilinearArray.Create( linearMap.DomainVSpaceDimension, linearMap.TargetVSpaceDimension ); foreach (var basisBladeMap in linearMap.BasisBladeMaps()) { resultMap.SetBasisBladeMap(basisBladeMap.Item1, basisBladeMap.Item2); } return(resultMap); }
public static GaSymMapUnilinearArray ToArrayMap(this ISymbolicMatrix linearMapMatrix) { Debug.Assert(linearMapMatrix.RowCount.IsValidGaSpaceDimension() && linearMapMatrix.ColumnCount.IsValidGaSpaceDimension()); var resultMap = GaSymMapUnilinearArray.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); }