public PeriodicBoundaryConverter(
     VoronoiBoundary boundary,
     PeriodicMap map)
 {
     edgePairer       = new EdgePairer();
     edgeTags         = ExtractEdgeTags(boundary, map);
     this.boundaryMap =
         CreatePeriodicBoundaryMap <SortedList <byte, AffineTrafo>, LinkedListDictionary <int, bool> >(
             edgeTags,
             map);
 }
        static PeriodicBoundaryConverterMap CreatePeriodicBoundaryMap <TtrafoDictionary, TinverseDictionary>(
            byte[] edgeTags,
            PeriodicMap map)
            where TtrafoDictionary : IDictionary <byte, AffineTrafo>, new()
            where TinverseDictionary : IDictionary <int, bool>, new()
        {
            var periodicInverseMap = ExtractPeriodicInverseMap <TinverseDictionary>(map.PeriodicBoundaryCorrelation);


            var periodicTrafos = ExtractPeriodicTrafos <TtrafoDictionary>(
                edgeTags,
                periodicInverseMap,
                map.PeriodicBoundaryTransformations);

            var boundaryMap = new PeriodicBoundaryConverterMap()
            {
                PeriodicInverseMap = periodicInverseMap,
                PeriodicTrafos     = periodicTrafos
            };

            return(boundaryMap);
        }