Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/06/17 11:39:20 (7 years ago)
Author:
gkronber
Message:

#2760: merged r14864, r14865, r14904, r15002, r15026, r15077, r15111 from trunk to stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs

    r15131 r15150  
    126126      return new ModifiableDataset(variableNames, values);
    127127    }
     128    /// <summary>
     129    /// Shuffle a dataset's rows
     130    /// </summary>
     131    /// <param name="random">Random number generator used for shuffling.</param>
     132    /// <returns>A shuffled copy of the current dataset.</returns>
     133    public Dataset Shuffle(IRandom random) {
     134      var values = variableNames.Select(x => variableValues[x]).ToList();
     135      return new Dataset(variableNames, values.ShuffleLists(random));
     136    }
    128137
    129138    protected Dataset(Dataset dataset) : this(dataset.variableNames, dataset.variableValues.Values) { }
Note: See TracChangeset for help on using the changeset viewer.