Changeset 7772


Ignore:
Timestamp:
04/30/12 13:41:40 (8 years ago)
Author:
sforsten
Message:

#1784:

  • corrected build path of Problems.Instances
  • simplified the GenerateAllCombinationsOfValuesInLists method in ValueGenerator
Location:
branches/ProblemInstancesRegressionAndClassification
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/ValueGenerator.cs

    r7770 r7772  
    5454      List<IEnumerator<double>> enumerators = new List<IEnumerator<double>>();
    5555      foreach (var list in lists) {
     56        allCombinations.Add(new List<double>());
    5657        enumerators.Add(list.GetEnumerator());
    5758      }
     
    6061
    6162      while (!finished) {
    62         allCombinations.Add(GetCurrentCombination(enumerators));
     63        GetCurrentCombination(enumerators, allCombinations);
    6364        finished = MoveNext(enumerators, lists);
    6465      }
    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;
    7067    }
    7168
     
    8077    }
    8178
    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);
    8682      }
    87       return combination;
    8883    }
    8984
     
    9388      List<double> curCombination = new List<double>();
    9489      List<List<double>> allCombinations = new List<List<double>>();
     90      for (int i = 0; i < lists.Count; i++) {
     91        allCombinations.Add(new List<double>());
     92      }
    9593      if (lists.Count() > cur) {
    9694        foreach (var item in lists[cur]) {
     
    10098        }
    10199      }
    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;
    108101    }
    109102
     
    118111        }
    119112      } else {
    120         allCombinations.Add(new List<double>(curCombinations));
     113        for (int i = 0; i < curCombinations.Count; i++) {
     114          allCombinations[i].Add(curCombinations[i]);
     115        }
    121116      }
    122     }    */
     117    }         */
    123118
    124119    //original
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj

    r7771 r7772  
    2626    <DebugType>pdbonly</DebugType>
    2727    <Optimize>true</Optimize>
    28     <OutputPath>..\..\bin\</OutputPath>
     28    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    2929    <DefineConstants>TRACE</DefineConstants>
    3030    <ErrorReport>prompt</ErrorReport>
Note: See TracChangeset for help on using the changeset viewer.