This specific problem is the following differential equation :
y' = t^3 - t y
y (t) = t^2 + 2 (exp (- t^2 / 2) - 1)
153154155156157158159160161162163
*/ public double correlation(final double[] xArray, final double[] yArray) throws DimensionMismatchException { if (xArray.length != yArray.length) { throw new DimensionMismatchException(xArray.length, yArray.length); } final int n = xArray.length; final long numPairs = sum(n - 1);
158159160161162163164165166
* @throws DimensionMismatchException if {@link #target} and * {@link #weightMatrix} have inconsistent dimensions. */ private void checkParameters() { if (target.length != weightMatrix.getColumnDimension()) { throw new DimensionMismatchException(target.length, weightMatrix.getColumnDimension()); } }
146147148149150151152153154155156
public void increment(final double[] data) throws DimensionMismatchException { int length = data.length; if (length != dimension) { throw new DimensionMismatchException(length, dimension); } // only update the upper triangular part of the covariance matrix // as only these parts are actually stored for (int i = 0; i < length; i++){
171172173174175176177178179180181
* @throws DimensionMismatchException if the dimension of sc does not match this * @since 3.3 */ public void append(StorelessCovariance sc) throws DimensionMismatchException { if (sc.dimension != dimension) { throw new DimensionMismatchException(sc.dimension, dimension); } // only update the upper triangular part of the covariance matrix // as only these parts are actually stored for (int i = 0; i < dimension; i++) {
144145146147148149150151152153
if (m.getColumnDimension() != m.getRowDimension()) { throw new NonSquareOperatorException(m.getColumnDimension(), m.getRowDimension()); } if (m.getRowDimension() != a.getRowDimension()) { throw new DimensionMismatchException(m.getRowDimension(), a.getRowDimension()); } } }
217218219220221222223224225226227
* length. */ protected double[] computeResiduals(double[] objectiveValue) { final double[] target = getTarget(); if (objectiveValue.length != target.length) { throw new DimensionMismatchException(target.length, objectiveValue.length); } final double[] residuals = new double[target.length]; for (int i = 0; i < target.length; i++) {
326327328329330331332333334335336
*/ public Rotation(Vector3D u, Vector3D v) throws MathArithmeticException { double normProduct = u.getNorm() * v.getNorm(); if (normProduct == 0) { throw new MathArithmeticException(LocalizedFormats.ZERO_NORM_FOR_ROTATION_DEFINING_VECTOR); } double dot = u.dotProduct(v); if (dot < ((2.0e-15 - 1.0) * normProduct)) {
7071727374757677787980
* @return the smallest prime greater than or equal to n. * @throws MathIllegalArgumentException if n < 0. */ public static int nextPrime(int n) { if (n < 0) { throw new MathIllegalArgumentException(LocalizedFormats.NUMBER_TOO_SMALL, n, 0); } if (n == 2) { return 2; } n |= 1;//make sure n is odd
115116117118119120121122123124125
* @throws MathIllegalArgumentException if n < 2. */ public static List<Integer> primeFactors(int n) { if (n < 2) { throw new MathIllegalArgumentException(LocalizedFormats.NUMBER_TOO_SMALL, n, 2); } // slower than trial div unless we do an awful lot of computation // (then it finally gets JIT-compiled efficiently // List<Integer> out = PollardRho.primeFactors(n); return SmallPrimes.trialDivision(n);
173174175176177178179180181182183
*/ public Rotation(Vector3D axis, double angle) throws MathIllegalArgumentException { double norm = axis.getNorm(); if (norm == 0) { throw new MathIllegalArgumentException(LocalizedFormats.ZERO_NORM_FOR_ROTATION_AXIS); } double halfAngle = -0.5 * angle; double coeff = FastMath.sin(halfAngle) / norm;