Changeset 7772
- Timestamp:
- 04/30/12 13:41:40 (13 years ago)
- Location:
- branches/ProblemInstancesRegressionAndClassification
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/ValueGenerator.cs
r7770 r7772 54 54 List<IEnumerator<double>> enumerators = new List<IEnumerator<double>>(); 55 55 foreach (var list in lists) { 56 allCombinations.Add(new List<double>()); 56 57 enumerators.Add(list.GetEnumerator()); 57 58 } … … 60 61 61 62 while (!finished) { 62 allCombinations.Add(GetCurrentCombination(enumerators));63 GetCurrentCombination(enumerators, allCombinations); 63 64 finished = MoveNext(enumerators, lists); 64 65 } 65 66 IEnumerable<IEnumerable<double>> res = (from i in Enumerable.Range(0, lists.Count) 67 select (from list in allCombinations 68 select list.ElementAt(i))); 69 return res; 66 return allCombinations; 70 67 } 71 68 … … 80 77 } 81 78 82 private static List<double> GetCurrentCombination(List<IEnumerator<double>> enumerators) { 83 List<double> combination = new List<double>(); 84 foreach (var enumerator in enumerators) { 85 combination.Add(enumerator.Current); 79 private static void GetCurrentCombination(List<IEnumerator<double>> enumerators, List<List<double>> allCombinations) { 80 for (int i = 0; i < enumerators.Count(); i++) { 81 allCombinations[i].Add(enumerators[i].Current); 86 82 } 87 return combination;88 83 } 89 84 … … 93 88 List<double> curCombination = new List<double>(); 94 89 List<List<double>> allCombinations = new List<List<double>>(); 90 for (int i = 0; i < lists.Count; i++) { 91 allCombinations.Add(new List<double>()); 92 } 95 93 if (lists.Count() > cur) { 96 94 foreach (var item in lists[cur]) { … … 100 98 } 101 99 } 102 103 IEnumerable<IEnumerable<double>> res = (from i in Enumerable.Range(0, lists.Count) 104 select (from list in allCombinations 105 select list.ElementAt(i))); 106 107 return res; 100 return allCombinations; 108 101 } 109 102 … … 118 111 } 119 112 } else { 120 allCombinations.Add(new List<double>(curCombinations)); 113 for (int i = 0; i < curCombinations.Count; i++) { 114 allCombinations[i].Add(curCombinations[i]); 115 } 121 116 } 122 } */117 } */ 123 118 124 119 //original -
branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj
r7771 r7772 26 26 <DebugType>pdbonly</DebugType> 27 27 <Optimize>true</Optimize> 28 <OutputPath>..\..\ bin\</OutputPath>28 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 29 29 <DefineConstants>TRACE</DefineConstants> 30 30 <ErrorReport>prompt</ErrorReport>
Note: See TracChangeset
for help on using the changeset viewer.