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