Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/11/13 22:41:09 (11 years ago)
Author:
ascheibe
Message:

#1886 fixed a bug in metric mds and added another unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/DistanceMatrixToPoints.cs

    r10112 r10127  
    154154      }
    155155
    156       double k1 = SumIfLZero(ev);
     156      int k1 = SumIfLZero(ev);
    157157      if (k1 < k) {
    158158        throw new Exception("Zero-eigenvalues detected. This leads to a degenerate point set. Use constants. ");
    159         //TODO: handling of this case; implement adding of constants
    160159      }
    161160
     
    227226    }
    228227
    229     private static double SumIfLZero(double[] a) {
    230       return a.Where(x => x > 0.0 && !x.IsAlmost(0.0)).Sum();
     228    private static int SumIfLZero(double[] a) {
     229      return a.Count(x => x > 0.0 && !x.IsAlmost(0.0));
    231230    }
    232231
Note: See TracChangeset for help on using the changeset viewer.