예제 #1
0
        private PatternInfo BuildBasicPatternInfo(int[] partitions, int levelsize)
        {
            if (partitions.Length == 0)
            {
                return(new PatternInfo(AggRelationship.NoPattern, levelsize, new int[0]));
            }

            AggRelationship relationship   = AggRelationship.NoPattern;
            int             repetitionSize = 0;

            int[] partitionSizes = CalcPartitionSizes(partitions);

            if (partitionSizes.Length == 1)
            {
                return(new PatternInfo(AggRelationship.NoPattern, levelsize, partitionSizes));
            }

            int firstsize = partitionSizes[0] = partitions[0];

            if (partitionSizes.All(size => size == firstsize))
            {
                if (firstsize == 1)
                {
                    relationship   = AggRelationship.OneToOne;
                    repetitionSize = 1;
                }
                else
                {
                    relationship   = AggRelationship.RepeatedPattern;
                    repetitionSize = firstsize;
                }
            }

            return(new PatternInfo(relationship, repetitionSize, partitionSizes));
        }
예제 #2
0
 public PatternInfo(AggRelationship _getLevelRelation, int _repeatedPartitionSize, int[] partitionSizes)
 {
     GetLevelRelation      = _getLevelRelation;
     RepeatedPartitionSize = _repeatedPartitionSize;
 }