Example #1
0
        private void CreatePermutaionList(string[] pStratvarList)
        {
            int i = 0;

            Rule_Freq.SelectClauses = new List <string>();

            if (pStratvarList != null)
            {
                List <DataRow> Rows = this.Context.GetOutput();

                foreach (string StratVar in pStratvarList)
                {
                    Rule_Freq.PermutationList.Add(StratVar, new List <object>());
                }

                foreach (DataRow R in Rows)
                {
                    foreach (string StratVar in pStratvarList)
                    {
                        bool isFound = false;
                        for (i = 0; i < Rule_Freq.PermutationList[StratVar].Count; i++)
                        {
                            if (CompareEqual(Rule_Freq.PermutationList[StratVar][i], R[StratVar]))
                            {
                                isFound = true;
                                break;
                            }
                        }

                        if (!isFound)
                        {
                            Rule_Freq.PermutationList[StratVar].Add(R[StratVar]);
                        }
                    }
                }

                EnumerablePermuter_Freq EP = new EnumerablePermuter_Freq(this.Context.DataSet.Tables["Output"].Columns, EnumerablePermuter_Freq.RunModeEnum.SelectClauses, ref this.StratvarList, ref Rule_Freq.SelectClauses);

                System.Collections.IEnumerable[] PL = new System.Collections.IEnumerable[Rule_Freq.PermutationList.Count];
                i = 0;
                foreach (KeyValuePair <string, List <object> > Key in Rule_Freq.PermutationList)
                {
                    PL[i++] = Key.Value;
                }
                EP.VisitAll(PL);
            }

            if (Rule_Freq.SelectClauses.Count == 0)
            {
                Rule_Freq.SelectClauses.Add("");
            }
        }
Example #2
0
        private void CreatePermutaionList(string[] pStratvarList)
        {
            int i = 0;

            Rule_Freq.SelectClauses = new List<string>();

            if (pStratvarList != null)
            {
                List<DataRow> Rows = this.Context.GetOutput();

                foreach (string StratVar in pStratvarList)
                {
                    Rule_Freq.PermutationList.Add(StratVar, new List<object>());
                }

                foreach (DataRow R in Rows)
                {
                    foreach (string StratVar in pStratvarList)
                    {
                        bool isFound = false;
                        for (i = 0; i < Rule_Freq.PermutationList[StratVar].Count; i++)
                        {
                            if (CompareEqual(Rule_Freq.PermutationList[StratVar][i], R[StratVar]))
                            {
                                isFound = true;
                                break;
                            }
                        }

                        if (!isFound)
                        {
                            Rule_Freq.PermutationList[StratVar].Add(R[StratVar]);
                        }
                    }
                }

                EnumerablePermuter_Freq EP = new EnumerablePermuter_Freq(this.Context.DataSet.Tables["Output"].Columns, EnumerablePermuter_Freq.RunModeEnum.SelectClauses, ref this.StratvarList, ref Rule_Freq.SelectClauses);

                System.Collections.IEnumerable[] PL = new System.Collections.IEnumerable[Rule_Freq.PermutationList.Count];
                i = 0;
                foreach (KeyValuePair<string, List<object>> Key in Rule_Freq.PermutationList)
                {
                    PL[i++] = Key.Value;
                }
                EP.VisitAll(PL);

            }

            if (Rule_Freq.SelectClauses.Count == 0)
            {
                Rule_Freq.SelectClauses.Add("");
            }
        }