Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/03/20 17:25:38 (4 years ago)
Author:
pfleck
Message:

#3040

  • (partially) enabled data preprocessing for vectorial data
  • use flat zip-files for large benchmarks instead of embedded resources (faster build times)
  • added multiple variants of vector benchmark I (vector lengh constraints)
Location:
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Vectors
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Vectors/DoubleVector.cs

    r17400 r17418  
    8585
    8686    public double Sum() {
    87       return values.Sum();
     87      return Values.Sum();
    8888    }
    8989
    9090    public double Mean() {
    91       return values.Average();
     91      return Values.Average();
    9292    }
    9393
    9494    public DoubleVector CumulativeMean() {
     95      // todo: zero range average throws exception
    9596      return new DoubleVector(
    9697        Enumerable.Range(0, this.Count)
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Vectors/Vector.cs

    r17367 r17418  
    2020#endregion
    2121
     22using System;
    2223using System.Collections;
    2324using System.Collections.Generic;
     
    2930  public abstract class Vector<T> : IVector<T> {
    3031    [Storable]
    31     protected readonly List<T> values;
     32    protected readonly List<T> Values;
    3233
    3334    protected Vector(IEnumerable<T> values) {
    34       this.values = values.ToList();
     35      this.Values = values.ToList();
    3536    }
    3637
     
    3839    protected Vector(StorableConstructorFlag _) { }
    3940
     41    public override string ToString() {
     42      const int maxCount = 10;
     43      string extension = Values.Count > maxCount ? ", ..." : "";
     44      return $"[{string.Join(", ", Values.Cast<object>().Take(Math.Min(Values.Count, maxCount)))}{extension}]";
     45    }
    4046
    4147    #region Interface members
    4248
    4349    public int Count {
    44       get { return values.Count; }
     50      get { return Values.Count; }
    4551    }
    4652
    4753    public T this[int index] {
    48       get { return values[index]; }
     54      get { return Values[index]; }
    4955    }
    5056
    5157    public IEnumerator<T> GetEnumerator() {
    52       return values.GetEnumerator();
     58      return Values.GetEnumerator();
    5359    }
    5460
Note: See TracChangeset for help on using the changeset viewer.