# HG changeset patch # User Andre Heinecke # Date 1385044805 -3600 # Node ID eb4ca9a7eaca5b79d44c4a6656954b081bf53258 # Parent 60a5fc522ec426e6036f95a3dd30a200dae8b704 Add isValid method for single double arrays diff -r 60a5fc522ec4 -r eb4ca9a7eaca artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java Thu Nov 21 15:37:43 2013 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/DoubleUtil.java Thu Nov 21 15:40:05 2013 +0100 @@ -218,15 +218,21 @@ public static final boolean isValid(double [][] data) { for (double [] ds: data) { - for (double d: ds) { - if (Double.isNaN(d)) { - return false; - } + if (!isValid(ds)) { + return false; } } return true; } + public static final boolean isValid(double [] data) { + for (double d: data) { + if (Double.isNaN(d)) { + return false; + } + } + return true; + } /** In an array of doubles, search and return the maximum value. */ public static final double maxInArray(double[] values) {