Skip to content
Permalink
Browse files
Arrays.copyOf is Java 1.6+
  • Loading branch information
sebbASF committed Jan 8, 2015
1 parent c278ac3 commit 6a82f92584b36e28798479c82c0d3263c6347b90
Showing 1 changed file with 5 additions and 6 deletions.
@@ -17,14 +17,13 @@

package org.apache.commons.math3.special;

import java.util.Arrays;

import org.apache.commons.math3.analysis.UnivariateFunction;
import org.apache.commons.math3.exception.ConvergenceException;
import org.apache.commons.math3.exception.MathIllegalArgumentException;
import org.apache.commons.math3.exception.util.LocalizedFormats;
import org.apache.commons.math3.special.Gamma;
import org.apache.commons.math3.util.FastMath;
import org.apache.commons.math3.util.MathArrays;

/**
* This class provides computation methods related to Bessel
@@ -206,15 +205,15 @@ public static class BesselJResult {
* @param n count of valid values
*/
public BesselJResult(double[] b, int n) {
vals = Arrays.copyOf(b, b.length);
vals = MathArrays.copyOf(b, b.length);
nVals = n;
}

/**
* @return the computed function values
*/
public double[] getVals() {
return Arrays.copyOf(vals, vals.length);
return MathArrays.copyOf(vals, vals.length);
}

/**
@@ -374,7 +373,7 @@ public static BesselJResult rjBesl(double x, double alpha, int nb) {
capq = (capq + 1) * ((gnu * gnu) - 1) * (0.125 / x);
b[i - 1] = xc * (capp * vcos - capq * vsin);
if (nb == 1) {
return new BesselJResult(Arrays.copyOf(b, b.length),
return new BesselJResult(MathArrays.copyOf(b, b.length),
ncalc);
}
t = vsin;
@@ -645,6 +644,6 @@ public static BesselJResult rjBesl(double x, double alpha, int nb) {
}
ncalc = FastMath.min(nb, 0) - 1;
}
return new BesselJResult(Arrays.copyOf(b, b.length), ncalc);
return new BesselJResult(MathArrays.copyOf(b, b.length), ncalc);
}
}

0 comments on commit 6a82f92

Please sign in to comment.