Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4010


Ignore:
Timestamp:
07/07/10 11:26:45 (14 years ago)
Author:
mkommend
Message:

fixed RunCollectionVariableImpactView (ticket #1011)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/RunCollectionVariableImpactView.cs

    r3975 r4010  
    8383      DoubleMatrix matrix = null;
    8484      if (Content != null) {
    85         IEnumerable<IRun> runsWithVariables = Content.Where(r => r.Results.ContainsKey(variableImpactResultName));
     85        List<IRun> runsWithVariables = Content.Where(r => r.Results.ContainsKey(variableImpactResultName)).ToList() ;
    8686        IEnumerable<DoubleMatrix> variableImpacts = (from run in runsWithVariables
    8787                                                     select run.Results[variableImpactResultName]).Cast<DoubleMatrix>();
     
    9999        matrix.ColumnNames = columnNames;
    100100
    101         foreach (IRun run in runsWithVariables) {
     101        for(int i = 0; i< runsWithVariables.Count; i++) {
     102          IRun run = runsWithVariables[i];
    102103          DoubleMatrix runVariableImpacts = (DoubleMatrix)run.Results[variableImpactResultName];
    103           for (int i = 0; i < runVariableImpacts.Rows; i++) {
    104             int rowIndex = variableNames.FindIndex(s => s == runVariableImpacts.RowNames.ElementAt(i));
    105             int columnIndex = columnNames.FindIndex(s => s == run.Name);
    106             matrix[rowIndex, columnIndex] = runVariableImpacts[i, 0];
     104          for (int j = 0; j < runVariableImpacts.Rows; j++) {
     105            int rowIndex = variableNames.FindIndex(s => s == runVariableImpacts.RowNames.ElementAt(j));
     106            matrix[rowIndex, i] = runVariableImpacts[j, 0];
    107107          }
    108108        }
Note: See TracChangeset for help on using the changeset viewer.