diff --git a/tetrad-lib/src/main/java/edu/cmu/tetrad/data/CovariancesDoubleForkJoin.java b/tetrad-lib/src/main/java/edu/cmu/tetrad/data/CovariancesDoubleForkJoin.java index fd4ecee038..c9e31addca 100644 --- a/tetrad-lib/src/main/java/edu/cmu/tetrad/data/CovariancesDoubleForkJoin.java +++ b/tetrad-lib/src/main/java/edu/cmu/tetrad/data/CovariancesDoubleForkJoin.java @@ -49,6 +49,10 @@ public CovariancesDoubleForkJoin(double[][] data, boolean biasCorrected) { numThreads /= 2; } + if (numThreads < 1) { + numThreads = 1; + } + RealCovarianceMatrixForkJoin cov = new RealCovarianceMatrixForkJoin(data, numThreads); this.covariances = cov.compute(biasCorrected); }