Apache Commons logo Commons Math

CPD Results

The following document contains the results of PMD's CPD 6.55.0.

Duplications

File Line
org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java 176
org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java 188
public double get(final int key) {

        final int hash  = hashOf(key);
        int index = hash & mask;
        if (containsKey(key, index)) {
            return values[index];
        }

        if (states[index] == FREE) {
            return missingEntries;
        }

        int j = index;
        for (int perturb = perturb(hash); states[index] != FREE; perturb >>= PERTURB_SHIFT) {
            j = probe(perturb, j);
            index = j & mask;
            if (containsKey(key, index)) {
                return values[index];
            }
        }

        return missingEntries;
    }

    /**
     * Check if a value is associated with a key.
     * @param key key to check
     * @return true if a value is associated with key
     */
    public boolean containsKey(final int key) {

        final int hash  = hashOf(key);
        int index = hash & mask;
        if (containsKey(key, index)) {
            return true;
        }

        if (states[index] == FREE) {
            return false;
        }

        int j = index;
        for (int perturb = perturb(hash); states[index] != FREE; perturb >>= PERTURB_SHIFT) {
            j = probe(perturb, j);
            index = j & mask;
            if (containsKey(key, index)) {
                return true;
            }
        }

        return false;
    }

    /**
     * Get an iterator over map elements.
     * <p>The specialized iterators returned are fail-fast: they throw a
     * <code>ConcurrentModificationException</code> when they detect the map
     * has been modified during iteration.</p>
     * @return iterator over the map elements
     */
    public Iterator iterator() {
        return new Iterator();
    }

    /**
     * Perturb the hash for starting probing.
     * @param hash initial hash
     * @return perturbed hash
     */
    private static int perturb(final int hash) {
        return hash & 0x7fffffff;
    }

    /**
     * Find the index at which a key should be inserted.
     * @param key key to lookup
     * @return index at which key should be inserted
     */
    private int findInsertionIndex(final int key) {
        return findInsertionIndex(keys, states, key, mask);
    }

    /**
     * Find the index at which a key should be inserted.
     * @param keys keys table
     * @param states states table
     * @param key key to lookup
     * @param mask bit mask for hash values
     * @return index at which key should be inserted
     */
    private static int findInsertionIndex(final int[] keys, final byte[] states,
                                          final int key, final int mask) {
        final int hash = hashOf(key);
        int index = hash & mask;
        if (states[index] == FREE) {
            return index;
        } else if (states[index] == FULL && keys[index] == key) {
            return changeIndexSign(index);
        }

        int perturb = perturb(hash);
        int j = index;
        if (states[index] == FULL) {
            while (true) {
                j = probe(perturb, j);
                index = j & mask;
                perturb >>= PERTURB_SHIFT;

                if (states[index] != FULL || keys[index] == key) {
                    break;
                }
            }
        }

        if (states[index] == FREE) {
            return index;
        } else if (states[index] == FULL) {
            // due to the loop exit condition,
            // if (states[index] == FULL) then keys[index] == key
            return changeIndexSign(index);
        }

        final int firstRemoved = index;
        while (true) {
            j = probe(perturb, j);
            index = j & mask;

            if (states[index] == FREE) {
                return firstRemoved;
            } else if (states[index] == FULL && keys[index] == key) {
                return changeIndexSign(index);
            }

            perturb >>= PERTURB_SHIFT;
        }
    }

    /**
     * Compute next probe for collision resolution.
     * @param perturb perturbed hash
     * @param j previous probe
     * @return next probe
     */
    private static int probe(final int perturb, final int j) {
        return (j << 2) + j + perturb + 1;
    }

    /**
     * Change the index sign.
     * @param index initial index
     * @return changed index
     */
    private static int changeIndexSign(final int index) {
        return -index - 1;
    }

    /**
     * Get the number of elements stored in the map.
     * @return number of elements stored in the map
     */
    public int size() {
        return size;
    }


    /**
     * Remove the value associated with a key.
     * @param key key to which the value is associated
     * @return removed value
     */
    public double remove(final int key) {
File Line
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldStepInterpolator.java 140
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldStepInterpolator.java 193
final T f2        = f1.multiply(eta);
            final T f3        = f2.multiply(theta);
            final T f4        = f3.multiply(eta);
            final T coeff0    = f1.multiply(a70).
                                subtract(f2.multiply(a70.subtract(1))).
                                add(f3.multiply(a70.multiply(2).subtract(1))).
                                add(f4.multiply(d0));
            final T coeff1    = time.getField().getZero();
            final T coeff2    = f1.multiply(a72).
                                subtract(f2.multiply(a72)).
                                add(f3.multiply(a72.multiply(2))).
                                add(f4.multiply(d2));
            final T coeff3    = f1.multiply(a73).
                                subtract(f2.multiply(a73)).
                                add(f3.multiply(a73.multiply(2))).
                                add(f4.multiply(d3));
            final T coeff4    = f1.multiply(a74).
                                subtract(f2.multiply(a74)).
                                add(f3.multiply(a74.multiply(2))).
                                add(f4.multiply(d4));
            final T coeff5    = f1.multiply(a75).
                                subtract(f2.multiply(a75)).
                                add(f3.multiply(a75.multiply(2))).
                                add(f4.multiply(d5));
            final T coeff6    = f4.multiply(d6).subtract(f3);
            final T coeffDot0 = a70.
                                subtract(dot2.multiply(a70.subtract(1))).
                                add(dot3.multiply(a70.multiply(2).subtract(1))).
                                add(dot4.multiply(d0));
            final T coeffDot1 = time.getField().getZero();
            final T coeffDot2 = a72.
                                subtract(dot2.multiply(a72)).
                                add(dot3.multiply(a72.multiply(2))).
                                add(dot4.multiply(d2));
            final T coeffDot3 = a73.
                                subtract(dot2.multiply(a73)).
                                add(dot3.multiply(a73.multiply(2))).
                                add(dot4.multiply(d3));
            final T coeffDot4 = a74.
                                subtract(dot2.multiply(a74)).
                                add(dot3.multiply(a74.multiply(2))).
                                add(dot4.multiply(d4));
            final T coeffDot5 = a75.
                                subtract(dot2.multiply(a75)).
                                add(dot3.multiply(a75.multiply(2))).
                                add(dot4.multiply(d5));
            final T coeffDot6 = dot4.multiply(d6).subtract(dot3);
            interpolatedState       = previousStateLinearCombination(coeff0, coeff1, coeff2, coeff3,
File Line
org/apache/commons/math4/legacy/linear/ArrayFieldVector.java 873
org/apache/commons/math4/legacy/linear/SparseFieldVector.java 584
}
    }

    /**
     * Visits (but does not alter) all entries of this vector in default order
     * (increasing index).
     *
     * @param visitor the visitor to be used to process the entries of this
     * vector
     * @return the value returned by {@link FieldVectorPreservingVisitor#end()}
     * at the end of the walk
     * @since 3.3
     */
    public T walkInDefaultOrder(final FieldVectorPreservingVisitor<T> visitor) {
        final int dim = getDimension();
        visitor.start(dim, 0, dim - 1);
        for (int i = 0; i < dim; i++) {
            visitor.visit(i, getEntry(i));
        }
        return visitor.end();
    }

    /**
     * Visits (but does not alter) some entries of this vector in default order
     * (increasing index).
     *
     * @param visitor visitor to be used to process the entries of this vector
     * @param start the index of the first entry to be visited
     * @param end the index of the last entry to be visited (inclusive)
     * @return the value returned by {@link FieldVectorPreservingVisitor#end()}
     * at the end of the walk
     * @throws NumberIsTooSmallException if {@code end < start}.
     * @throws OutOfRangeException if the indices are not valid.
     * @since 3.3
     */
    public T walkInDefaultOrder(final FieldVectorPreservingVisitor<T> visitor,
                                final int start, final int end)
        throws NumberIsTooSmallException, OutOfRangeException {
        checkIndices(start, end);
        visitor.start(getDimension(), start, end);
        for (int i = start; i <= end; i++) {
            visitor.visit(i, getEntry(i));
        }
        return visitor.end();
    }

    /**
     * Visits (but does not alter) all entries of this vector in optimized
     * order. The order in which the entries are visited is selected so as to
     * lead to the most efficient implementation; it might depend on the
     * concrete implementation of this abstract class.
     *
     * @param visitor the visitor to be used to process the entries of this
     * vector
     * @return the value returned by {@link FieldVectorPreservingVisitor#end()}
     * at the end of the walk
     * @since 3.3
     */
    public T walkInOptimizedOrder(final FieldVectorPreservingVisitor<T> visitor) {
        return walkInDefaultOrder(visitor);
    }

    /**
     * Visits (but does not alter) some entries of this vector in optimized
     * order. The order in which the entries are visited is selected so as to
     * lead to the most efficient implementation; it might depend on the
     * concrete implementation of this abstract class.
     *
     * @param visitor visitor to be used to process the entries of this vector
     * @param start the index of the first entry to be visited
     * @param end the index of the last entry to be visited (inclusive)
     * @return the value returned by {@link FieldVectorPreservingVisitor#end()}
     * at the end of the walk
     * @throws NumberIsTooSmallException if {@code end < start}.
     * @throws OutOfRangeException if the indices are not valid.
     * @since 3.3
     */
    public T walkInOptimizedOrder(final FieldVectorPreservingVisitor<T> visitor,
                                  final int start, final int end)
        throws NumberIsTooSmallException, OutOfRangeException {
        return walkInDefaultOrder(visitor, start, end);
    }

    /**
     * Visits (and possibly alters) all entries of this vector in default order
     * (increasing index).
     *
     * @param visitor the visitor to be used to process and modify the entries
     * of this vector
     * @return the value returned by {@link FieldVectorChangingVisitor#end()}
     * at the end of the walk
     * @since 3.3
     */
    public T walkInDefaultOrder(final FieldVectorChangingVisitor<T> visitor) {
        final int dim = getDimension();
        visitor.start(dim, 0, dim - 1);
        for (int i = 0; i < dim; i++) {
            setEntry(i, visitor.visit(i, getEntry(i)));
        }
        return visitor.end();
    }

    /**
     * Visits (and possibly alters) some entries of this vector in default order
     * (increasing index).
     *
     * @param visitor visitor to be used to process the entries of this vector
     * @param start the index of the first entry to be visited
     * @param end the index of the last entry to be visited (inclusive)
     * @return the value returned by {@link FieldVectorChangingVisitor#end()}
     * at the end of the walk
     * @throws NumberIsTooSmallException if {@code end < start}.
     * @throws OutOfRangeException if the indices are not valid.
     * @since 3.3
     */
    public T walkInDefaultOrder(final FieldVectorChangingVisitor<T> visitor,
                                final int start, final int end)
        throws NumberIsTooSmallException, OutOfRangeException {
        checkIndices(start, end);
        visitor.start(getDimension(), start, end);
        for (int i = start; i <= end; i++) {
            setEntry(i, visitor.visit(i, getEntry(i)));
        }
        return visitor.end();
    }

    /**
     * Visits (and possibly alters) all entries of this vector in optimized
     * order. The order in which the entries are visited is selected so as to
     * lead to the most efficient implementation; it might depend on the
     * concrete implementation of this abstract class.
     *
     * @param visitor the visitor to be used to process the entries of this
     * vector
     * @return the value returned by {@link FieldVectorChangingVisitor#end()}
     * at the end of the walk
     * @since 3.3
     */
    public T walkInOptimizedOrder(final FieldVectorChangingVisitor<T> visitor) {
        return walkInDefaultOrder(visitor);
    }

    /**
     * Visits (and possibly change) some entries of this vector in optimized
     * order. The order in which the entries are visited is selected so as to
     * lead to the most efficient implementation; it might depend on the
     * concrete implementation of this abstract class.
     *
     * @param visitor visitor to be used to process the entries of this vector
     * @param start the index of the first entry to be visited
     * @param end the index of the last entry to be visited (inclusive)
     * @return the value returned by {@link FieldVectorChangingVisitor#end()}
     * at the end of the walk
     * @throws NumberIsTooSmallException if {@code end < start}.
     * @throws OutOfRangeException if the indices are not valid.
     * @since 3.3
     */
    public T walkInOptimizedOrder(final FieldVectorChangingVisitor<T> visitor,
                                  final int start, final int end)
        throws NumberIsTooSmallException, OutOfRangeException {
        return walkInDefaultOrder(visitor, start, end);
    }

    /**
     * Test for the equality of two vectors.
     *
     * @param other Object to test for equality.
     * @return {@code true} if two vector objects are equal, {@code false}
     * otherwise.
     */
    @Override
    public boolean equals(Object other) {
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 676
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 687
final T[] outBlock = out.blocks[outIndex];
                final int      index    = pBlock * blockColumns + qBlock;
                final int      width    = blockWidth(qBlock);

                final int heightExcess = iHeight + rowsShift - BLOCK_SIZE;
                final int widthExcess  = jWidth + columnsShift - BLOCK_SIZE;
                if (heightExcess > 0) {
                    // the submatrix block spans on two blocks rows from the original matrix
                    if (widthExcess > 0) {
                        // the submatrix block spans on two blocks columns from the original matrix
                        final int width2 = blockWidth(qBlock + 1);
                        copyBlockPart(blocks[index], width,
                                      rowsShift, BLOCK_SIZE,
                                      columnsShift, BLOCK_SIZE,
                                      outBlock, jWidth, 0, 0);
                        copyBlockPart(blocks[index + 1], width2,
                                      rowsShift, BLOCK_SIZE,
                                      0, widthExcess,
                                      outBlock, jWidth, 0, jWidth - widthExcess);
                        copyBlockPart(blocks[index + blockColumns], width,
                                      0, heightExcess,
                                      columnsShift, BLOCK_SIZE,
                                      outBlock, jWidth, iHeight - heightExcess, 0);
                        copyBlockPart(blocks[index + blockColumns + 1], width2,
                                      0, heightExcess,
                                      0, widthExcess,
                                      outBlock, jWidth, iHeight - heightExcess, jWidth - widthExcess);
                    } else {
                        // the submatrix block spans on one block column from the original matrix
                        copyBlockPart(blocks[index], width,
                                      rowsShift, BLOCK_SIZE,
                                      columnsShift, jWidth + columnsShift,
                                      outBlock, jWidth, 0, 0);
                        copyBlockPart(blocks[index + blockColumns], width,
                                      0, heightExcess,
                                      columnsShift, jWidth + columnsShift,
                                      outBlock, jWidth, iHeight - heightExcess, 0);
                    }
                } else {
                    // the submatrix block spans on one block row from the original matrix
                    if (widthExcess > 0) {
                        // the submatrix block spans on two blocks columns from the original matrix
                        final int width2 = blockWidth(qBlock + 1);
                        copyBlockPart(blocks[index], width,
                                      rowsShift, iHeight + rowsShift,
                                      columnsShift, BLOCK_SIZE,
                                      outBlock, jWidth, 0, 0);
                        copyBlockPart(blocks[index + 1], width2,
                                      rowsShift, iHeight + rowsShift,
                                      0, widthExcess,
                                      outBlock, jWidth, 0, jWidth - widthExcess);
                    } else {
                        // the submatrix block spans on one block column from the original matrix
                        copyBlockPart(blocks[index], width,
                                      rowsShift, iHeight + rowsShift,
                                      columnsShift, jWidth + columnsShift,
                                      outBlock, jWidth, 0, 0);
                    }
               }
                ++qBlock;
            }
            ++pBlock;
        }

        return out;
    }

    /**
     * Copy a part of a block into another one
     * <p>This method can be called only when the specified part fits in both
     * blocks, no verification is done here.</p>
     * @param srcBlock source block
     * @param srcWidth source block width ({@link #BLOCK_SIZE} or smaller)
     * @param srcStartRow start row in the source block
     * @param srcEndRow end row (exclusive) in the source block
     * @param srcStartColumn start column in the source block
     * @param srcEndColumn end column (exclusive) in the source block
     * @param dstBlock destination block
     * @param dstWidth destination block width ({@link #BLOCK_SIZE} or smaller)
     * @param dstStartRow start row in the destination block
     * @param dstStartColumn start column in the destination block
     */
    private void copyBlockPart(final T[] srcBlock, final int srcWidth,
File Line
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldStepInterpolator.java 237
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldStepInterpolator.java 267
final T f1 = f0.multiply(eta);
            final T f2 = f1.multiply(theta);
            final T f3 = f2.multiply(eta);
            final T f4 = f3.multiply(theta);
            final T f5 = f4.multiply(eta);
            final T f6 = f5.multiply(theta);
            final T[] p = MathArrays.buildArray(time.getField(), 16);
            final T[] q = MathArrays.buildArray(time.getField(), 16);
            for (int i = 0; i < p.length; ++i) {
                p[i] =     f0.multiply(d[0][i]).
                       add(f1.multiply(d[1][i])).
                       add(f2.multiply(d[2][i])).
                       add(f3.multiply(d[3][i])).
                       add(f4.multiply(d[4][i])).
                       add(f5.multiply(d[5][i])).
                       add(f6.multiply(d[6][i]));
                q[i] =                    d[0][i].
                        add(dot1.multiply(d[1][i])).
                        add(dot2.multiply(d[2][i])).
                        add(dot3.multiply(d[3][i])).
                        add(dot4.multiply(d[4][i])).
                        add(dot5.multiply(d[5][i])).
                        add(dot6.multiply(d[6][i]));
            }
            interpolatedState       = previousStateLinearCombination(p[0], p[1], p[ 2], p[ 3], p[ 4], p[ 5], p[ 6], p[ 7],
File Line
org/apache/commons/math4/legacy/ode/nonstiff/AdamsBashforthFieldIntegrator.java 234
org/apache/commons/math4/legacy/ode/nonstiff/AdamsMoultonFieldIntegrator.java 209
return error.divide(mainSetDimension).sqrt();
    }

    /** {@inheritDoc} */
    @Override
    public FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations,
                                                   final FieldODEState<T> initialState,
                                                   final T finalTime)
        throws NumberIsTooSmallException, DimensionMismatchException,
               MaxCountExceededException, NoBracketingException {

        sanityChecks(initialState, finalTime);
        final T   t0 = initialState.getTime();
        final T[] y  = equations.getMapper().mapState(initialState);
        setStepStart(initIntegration(equations, t0, y, finalTime));
        final boolean forward = finalTime.subtract(initialState.getTime()).getReal() > 0;

        // compute the initial Nordsieck vector using the configured starter integrator
        start(equations, getStepStart(), finalTime);

        // reuse the step that was chosen by the starter integrator
        FieldODEStateAndDerivative<T> stepStart = getStepStart();
        FieldODEStateAndDerivative<T> stepEnd   =
                        AdamsFieldStepInterpolator.taylor(stepStart,
                                                          stepStart.getTime().add(getStepSize()),
                                                          getStepSize(), scaled, nordsieck);

        // main integration loop
        setIsLastStep(false);
        do {

            T[] predictedY = null;
            final T[] predictedScaled = MathArrays.buildArray(getField(), y.length);
            Array2DRowFieldMatrix<T> predictedNordsieck = null;
            T error = getField().getZero().add(10);
            while (error.subtract(1.0).getReal() >= 0.0) {

                // predict a first estimate of the state at step end
                predictedY = stepEnd.getState();

                // evaluate the derivative
                final T[] yDot = computeDerivatives(stepEnd.getTime(), predictedY);

                // predict Nordsieck vector at step end
                for (int j = 0; j < predictedScaled.length; ++j) {
                    predictedScaled[j] = getStepSize().multiply(yDot[j]);
                }
                predictedNordsieck = updateHighOrderDerivativesPhase1(nordsieck);
                updateHighOrderDerivativesPhase2(scaled, predictedScaled, predictedNordsieck);

                // evaluate error
                error = errorEstimation(y, predictedY, predictedScaled, predictedNordsieck);
File Line
org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java 437
org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java 449
final byte[] newStates = new byte[newLength];
        final int newMask = newLength - 1;
        for (int i = 0; i < oldLength; ++i) {
            if (oldStates[i] == FULL) {
                final int key = oldKeys[i];
                final int index = findInsertionIndex(newKeys, newStates, key, newMask);
                newKeys[index]   = key;
                newValues[index] = oldValues[i];
                newStates[index] = FULL;
            }
        }

        mask   = newMask;
        keys   = newKeys;
        values = newValues;
        states = newStates;
    }

    /**
     * Check if tables should grow due to increased size.
     * @return true if  tables should grow
     */
    private boolean shouldGrowTable() {
        return size > (mask + 1) * LOAD_FACTOR;
    }

    /**
     * Compute the hash value of a key.
     * @param key key to hash
     * @return hash value of the key
     */
    private static int hashOf(final int key) {
        final int h = key ^ ((key >>> 20) ^ (key >>> 12));
        return h ^ (h >>> 7) ^ (h >>> 4);
    }


    /** Iterator class for the map. */
    public final class Iterator {

        /** Reference modification count. */
        private final int referenceCount;

        /** Index of current element. */
        private int current;

        /** Index of next element. */
        private int next;

        /**
         * Simple constructor.
         */
        private Iterator() {

            // preserve the modification count of the map to detect concurrent modifications later
            referenceCount = count;

            // initialize current index
            next = -1;
            try {
                advance();
            } catch (NoSuchElementException nsee) { // NOPMD
                // ignored
            }
        }

        /**
         * Check if there is a next element in the map.
         * @return true if there is a next element
         */
        public boolean hasNext() {
            return next >= 0;
        }

        /**
         * Get the key of current entry.
         * @return key of current entry
         * @exception ConcurrentModificationException if the map is modified during iteration
         * @exception NoSuchElementException if there is no element left in the map
         */
        public int key()
            throws ConcurrentModificationException, NoSuchElementException {
            if (referenceCount != count) {
                throw new ConcurrentModificationException();
            }
            if (current < 0) {
                throw new NoSuchElementException();
            }
            return keys[current];
        }

        /**
         * Get the value of current entry.
         * @return value of current entry
         * @exception ConcurrentModificationException if the map is modified during iteration
         * @exception NoSuchElementException if there is no element left in the map
         */
        public double value()
File Line
org/apache/commons/math4/legacy/ode/nonstiff/AdamsBashforthFieldIntegrator.java 306
org/apache/commons/math4/legacy/ode/nonstiff/AdamsMoultonFieldIntegrator.java 292
nordsieck = predictedNordsieck;

            if (!isLastStep()) {

                System.arraycopy(predictedY, 0, y, 0, y.length);

                if (resetOccurred()) {
                    // some events handler has triggered changes that
                    // invalidate the derivatives, we need to restart from scratch
                    start(equations, getStepStart(), finalTime);
                }

                // stepsize control for next step
                final T       factor     = computeStepGrowShrinkFactor(error);
                final T       scaledH    = getStepSize().multiply(factor);
                final T       nextT      = getStepStart().getTime().add(scaledH);
                final boolean nextIsLast = forward ?
                                           nextT.subtract(finalTime).getReal() >= 0 :
                                           nextT.subtract(finalTime).getReal() <= 0;
                T hNew = filterStep(scaledH, forward, nextIsLast);

                final T       filteredNextT      = getStepStart().getTime().add(hNew);
                final boolean filteredNextIsLast = forward ?
                                                   filteredNextT.subtract(finalTime).getReal() >= 0 :
                                                   filteredNextT.subtract(finalTime).getReal() <= 0;
                if (filteredNextIsLast) {
                    hNew = finalTime.subtract(getStepStart().getTime());
                }

                rescale(hNew);
                stepEnd = AdamsFieldStepInterpolator.taylor(getStepStart(), getStepStart().getTime().add(getStepSize()),
                                                            getStepSize(), scaled, nordsieck);
            }
        } while (!isLastStep());

        final FieldODEStateAndDerivative<T> finalState = getStepStart();
        setStepStart(null);
        setStepSize(null);
        return finalState;
    }
File Line
org/apache/commons/math4/legacy/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java 273
org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaFieldIntegrator.java 155
for (int k = 1; k < stages; ++k) {

                    for (int j = 0; j < y0.length; ++j) {
                        T sum = yDotK[0][j].multiply(a[k-1][0]);
                        for (int l = 1; l < k; ++l) {
                            sum = sum.add(yDotK[l][j].multiply(a[k-1][l]));
                        }
                        yTmp[j] = y[j].add(getStepSize().multiply(sum));
                    }

                    yDotK[k] = computeDerivatives(getStepStart().getTime().add(getStepSize().multiply(c[k-1])), yTmp);
                }

                // estimate the state at the end of the step
                for (int j = 0; j < y0.length; ++j) {
                    T sum    = yDotK[0][j].multiply(b[0]);
                    for (int l = 1; l < stages; ++l) {
                        sum = sum.add(yDotK[l][j].multiply(b[l]));
                    }
                    yTmp[j] = y[j].add(getStepSize().multiply(sum));
                }
File Line
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1391
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1421
public double walkInRowOrder(final RealMatrixChangingVisitor visitor,
                                 final int startRow, final int endRow,
                                 final int startColumn, final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0 = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int p = pStart; p < pEnd; ++p) {
                for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) {
                    final int jWidth = blockWidth(jBlock);
                    final int q0 = jBlock * BLOCK_SIZE;
                    final int qStart = JdkMath.max(startColumn, q0);
                    final int qEnd = JdkMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
                    final double[] block = blocks[iBlock * blockColumns + jBlock];
                    int k = (p - p0) * jWidth + qStart - q0;
                    for (int q = qStart; q < qEnd; ++q) {
File Line
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1501
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1532
public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor,
                                       final int startRow, final int endRow,
                                       final int startColumn,
                                       final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0 = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) {
                final int jWidth = blockWidth(jBlock);
                final int q0 = jBlock * BLOCK_SIZE;
                final int qStart = JdkMath.max(startColumn, q0);
                final int qEnd = JdkMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
                final double[] block = blocks[iBlock * blockColumns + jBlock];
                for (int p = pStart; p < pEnd; ++p) {
                    int k = (p - p0) * jWidth + qStart - q0;
                    for (int q = qStart; q < qEnd; ++q) {
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1397
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1427
public T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor,
                            final int startRow, final int endRow,
                            final int startColumn, final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0     = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd   = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int p = pStart; p < pEnd; ++p) {
                for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) {
                    final int jWidth = blockWidth(jBlock);
                    final int q0     = jBlock * BLOCK_SIZE;
                    final int qStart = JdkMath.max(startColumn, q0);
                    final int qEnd   = JdkMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
                    final T[] block = blocks[iBlock * blockColumns + jBlock];
                    int k = (p - p0) * jWidth + qStart - q0;
                    for (int q = qStart; q < qEnd; ++q) {
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1507
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1537
public T walkInOptimizedOrder(final FieldMatrixChangingVisitor<T> visitor,
                                  final int startRow, final int endRow,
                                  final int startColumn, final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0     = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd   = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) {
                final int jWidth = blockWidth(jBlock);
                final int q0     = jBlock * BLOCK_SIZE;
                final int qStart = JdkMath.max(startColumn, q0);
                final int qEnd   = JdkMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
                final T[] block = blocks[iBlock * blockColumns + jBlock];
                for (int p = pStart; p < pEnd; ++p) {
                    int k = (p - p0) * jWidth + qStart - q0;
                    for (int q = qStart; q < qEnd; ++q) {
File Line
org/apache/commons/math4/legacy/linear/FieldLUDecomposition.java 305
org/apache/commons/math4/legacy/linear/FieldLUDecomposition.java 348
throw new DimensionMismatchException(b.getDimension(), m);
            }
            if (singular) {
                throw new SingularMatrixException();
            }

            // Apply permutations to b
            final T[] bp = MathArrays.buildArray(field, m);
            for (int row = 0; row < m; row++) {
                bp[row] = b.getEntry(pivot[row]);
            }

            // Solve LY = b
            for (int col = 0; col < m; col++) {
                final T bpCol = bp[col];
                for (int i = col + 1; i < m; i++) {
                    bp[i] = bp[i].subtract(bpCol.multiply(lu[i][col]));
                }
            }

            // Solve UX = Y
            for (int col = m - 1; col >= 0; col--) {
                bp[col] = bp[col].divide(lu[col][col]);
                final T bpCol = bp[col];
                for (int i = 0; i < col; i++) {
                    bp[i] = bp[i].subtract(bpCol.multiply(lu[i][col]));
                }
            }

            return new ArrayFieldVector<>(field, bp, false);
File Line
org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java 1259
org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java 1314
p[0] = -1;
            final double x2    = x * x;
            final double f     = 1.0 / (1 - x2);
            double coeff = JdkMath.sqrt(f);
            function[1] = coeff * p[0];
            for (int n = 2; n <= order; ++n) {

                // update and evaluate polynomial P_n(x)
                double v = 0;
                p[n - 1] = (n - 1) * p[n - 2];
                for (int k = n - 1; k >= 0; k -= 2) {
                    v = v * x2 + p[k];
                    if (k > 2) {
                        p[k - 2] = (k - 1) * p[k - 1] + (2 * n - k) * p[k - 3];
                    } else if (k == 2) {
                        p[0] = p[1];
                    }
                }
                if ((n & 0x1) == 0) {
                    v *= x;
                }

                coeff *= f;
                function[n] = coeff * v;
            }
        }

        // apply function composition
        compose(operand, operandOffset, function, result, resultOffset);
    }

    /** Compute arc sine of a derivative structure.
     * @param operand array holding the operand
     * @param operandOffset offset of the operand in its array
     * @param result array where result must be stored (for
     * arc sine the result array <em>cannot</em> be the input
     * array)
     * @param resultOffset offset of the result in its array
     */
    public void asin(final double[] operand, final int operandOffset,
File Line
org/apache/commons/math4/legacy/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java 260
org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaIntegrator.java 146
for (int k = 1; k < stages; ++k) {

          for (int j = 0; j < y0.length; ++j) {
            double sum = a[k-1][0] * yDotK[0][j];
            for (int l = 1; l < k; ++l) {
              sum += a[k-1][l] * yDotK[l][j];
            }
            yTmp[j] = y[j] + stepSize * sum;
          }

          computeDerivatives(stepStart + c[k-1] * stepSize, yTmp, yDotK[k]);
        }

        // estimate the state at the end of the step
        for (int j = 0; j < y0.length; ++j) {
          double sum    = b[0] * yDotK[0][j];
          for (int l = 1; l < stages; ++l) {
            sum    += b[l] * yDotK[l][j];
          }
          yTmp[j] = y[j] + stepSize * sum;
        }
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 788
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 799
for (final T[] subRow : subMatrix) {
            if (subRow.length != refLength) {
                throw new DimensionMismatchException(refLength, subRow.length);
            }
        }

        // compute blocks bounds
        final int blockStartRow    = row / BLOCK_SIZE;
        final int blockEndRow      = (endRow + BLOCK_SIZE) / BLOCK_SIZE;
        final int blockStartColumn = column / BLOCK_SIZE;
        final int blockEndColumn   = (endColumn + BLOCK_SIZE) / BLOCK_SIZE;

        // perform copy block-wise, to ensure good cache behavior
        for (int iBlock = blockStartRow; iBlock < blockEndRow; ++iBlock) {
            final int iHeight  = blockHeight(iBlock);
            final int firstRow = iBlock * BLOCK_SIZE;
            final int iStart   = JdkMath.max(row,    firstRow);
            final int iEnd     = JdkMath.min(endRow + 1, firstRow + iHeight);

            for (int jBlock = blockStartColumn; jBlock < blockEndColumn; ++jBlock) {
                final int jWidth      = blockWidth(jBlock);
                final int firstColumn = jBlock * BLOCK_SIZE;
                final int jStart      = JdkMath.max(column,    firstColumn);
                final int jEnd        = JdkMath.min(endColumn + 1, firstColumn + jWidth);
                final int jLength     = jEnd - jStart;

                // handle one block, row by row
                final T[] block = blocks[iBlock * blockColumns + jBlock];
File Line
org/apache/commons/math4/legacy/analysis/solvers/BracketingNthOrderBrentSolver.java 288
org/apache/commons/math4/legacy/analysis/solvers/FieldBracketingNthOrderBrentSolver.java 350
if (Precision.equals(nextY, 0.0, 1)) {
                // we have found an exact root, since it is not an approximation
                // we don't need to bother about the allowed solutions setting
                return nextX;
            }

            if (nbPoints > 2 && end - start != nbPoints) {

                // we have been forced to ignore some points to keep bracketing,
                // they are probably too far from the root, drop them from now on
                nbPoints = end - start;
                System.arraycopy(x, start, x, 0, nbPoints);
                System.arraycopy(y, start, y, 0, nbPoints);
                signChangeIndex -= start;
            } else  if (nbPoints == x.length) {

                // we have to drop one point in order to insert the new one
                nbPoints--;

                // keep the tightest bracketing interval as centered as possible
                if (signChangeIndex >= (x.length + 1) / 2) {
                    // we drop the lowest point, we have to shift the arrays and the index
                    System.arraycopy(x, 1, x, 0, nbPoints);
                    System.arraycopy(y, 1, y, 0, nbPoints);
                    --signChangeIndex;
                }
            }

            // insert the last computed point
            //(by construction, we know it lies inside the tightest bracketing interval)
            System.arraycopy(x, signChangeIndex, x, signChangeIndex + 1, nbPoints - signChangeIndex);
            x[signChangeIndex] = nextX;
            System.arraycopy(y, signChangeIndex, y, signChangeIndex + 1, nbPoints - signChangeIndex);
            y[signChangeIndex] = nextY;
            ++nbPoints;

            // update the bracketing interval
            if (nextY * yA <= 0) {
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 319
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 389
return add((BlockFieldMatrix<T>) m);
        }

        // safety check
        checkAdd(m);

        final BlockFieldMatrix<T> out = new BlockFieldMatrix<>(getField(), rows, columns);

        // perform addition block-wise, to ensure good cache behavior
        int blockIndex = 0;
        for (int iBlock = 0; iBlock < out.blockRows; ++iBlock) {
            for (int jBlock = 0; jBlock < out.blockColumns; ++jBlock) {

                // perform addition on the current block
                final T[] outBlock = out.blocks[blockIndex];
                final T[] tBlock   = blocks[blockIndex];
                final int      pStart   = iBlock * BLOCK_SIZE;
                final int      pEnd     = JdkMath.min(pStart + BLOCK_SIZE, rows);
                final int      qStart   = jBlock * BLOCK_SIZE;
                final int      qEnd     = JdkMath.min(qStart + BLOCK_SIZE, columns);
                int k = 0;
                for (int p = pStart; p < pEnd; ++p) {
                    for (int q = qStart; q < qEnd; ++q) {
                        outBlock[k] = tBlock[k].add(m.getEntry(p, q));
File Line
org/apache/commons/math4/legacy/optim/nonlinear/scalar/LineSearch.java 117
org/apache/commons/math4/legacy/optim/nonlinear/scalar/MultivariateOptimizer.java 265
public UnivariatePointValuePair search(final double[] startPoint,
                                           final double[] direction) {
        final int n = startPoint.length;
        final MultivariateFunction func = mainOptimizer.getObjectiveFunction();
        final UnivariateFunction f = new UnivariateFunction() {
            /** {@inheritDoc} */
            @Override
            public double value(double alpha) {
                final double[] x = new double[n];
                for (int i = 0; i < n; i++) {
                    x[i] = startPoint[i] + alpha * direction[i];
                }
                return func.value(x);
            }
        };

        final GoalType goal = mainOptimizer.getGoalType();
        bracket.search(f, goal, 0, initialBracketingRange);
        // Passing "MAX_VALUE" as a dummy value because it is the enclosing
        // class that counts the number of evaluations (and will eventually
        // generate the exception).
        return lineOptimizer.optimize(new MaxEval(Integer.MAX_VALUE),
                                      new UnivariateObjectiveFunction(f),
                                      goal,
                                      new SearchInterval(bracket.getLo(),
                                                         bracket.getHi(),
                                                         bracket.getMid()));
    }
}
File Line
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldStepInterpolator.java 261
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldStepInterpolator.java 291
interpolatedState       = previousStateLinearCombination(p[0], p[1], p[ 2], p[ 3], p[ 4], p[ 5], p[ 6], p[ 7],
                                                                     p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]);
            interpolatedDerivatives = derivativeLinearCombination(q[0], q[1], q[ 2], q[ 3], q[ 4], q[ 5], q[ 6], q[ 7],
                                                                  q[8], q[9], q[10], q[11], q[12], q[13], q[14], q[15]);
        } else {
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1401
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1431
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1395
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1425
checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0     = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd   = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int p = pStart; p < pEnd; ++p) {
                for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) {
                    final int jWidth = blockWidth(jBlock);
                    final int q0     = jBlock * BLOCK_SIZE;
                    final int qStart = JdkMath.max(startColumn, q0);
                    final int qEnd   = JdkMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
                    final T[] block = blocks[iBlock * blockColumns + jBlock];
File Line
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 303
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 371
return add((BlockRealMatrix) m);
        }

        // safety check
        checkAdd(m);

        final BlockRealMatrix out = new BlockRealMatrix(rows, columns);

        // perform addition block-wise, to ensure good cache behavior
        int blockIndex = 0;
        for (int iBlock = 0; iBlock < out.blockRows; ++iBlock) {
            for (int jBlock = 0; jBlock < out.blockColumns; ++jBlock) {

                // perform addition on the current block
                final double[] outBlock = out.blocks[blockIndex];
                final double[] tBlock   = blocks[blockIndex];
                final int pStart = iBlock * BLOCK_SIZE;
                final int pEnd = JdkMath.min(pStart + BLOCK_SIZE, rows);
                final int qStart = jBlock * BLOCK_SIZE;
                final int qEnd = JdkMath.min(qStart + BLOCK_SIZE, columns);
                int k = 0;
                for (int p = pStart; p < pEnd; ++p) {
                    for (int q = qStart; q < qEnd; ++q) {
                        outBlock[k] = tBlock[k] + m.getEntry(p, q);
File Line
org/apache/commons/math4/legacy/genetics/CycleCrossover.java 100
org/apache/commons/math4/legacy/genetics/OrderedCrossover.java 69
@Override
    @SuppressWarnings("unchecked")
    public ChromosomePair crossover(final Chromosome first, final Chromosome second)
        throws DimensionMismatchException, MathIllegalArgumentException {

        if (!(first instanceof AbstractListChromosome<?> && second instanceof AbstractListChromosome<?>)) {
            throw new MathIllegalArgumentException(LocalizedFormats.INVALID_FIXED_LENGTH_CHROMOSOME);
        }
        return mate((AbstractListChromosome<T>) first, (AbstractListChromosome<T>) second);
    }

    /**
     * Helper for {@link #crossover(Chromosome, Chromosome)}. Performs the actual crossover.
     *
     * @param first the first chromosome
     * @param second the second chromosome
     * @return the pair of new chromosomes that resulted from the crossover
     * @throws DimensionMismatchException if the length of the two chromosomes is different
     */
    protected ChromosomePair mate(final AbstractListChromosome<T> first, final AbstractListChromosome<T> second)
        throws DimensionMismatchException {

        final int length = first.getLength();
        if (length != second.getLength()) {
            throw new DimensionMismatchException(second.getLength(), length);
        }

        // array representations of the parents
        final List<T> parent1Rep = first.getRepresentation();
        final List<T> parent2Rep = second.getRepresentation();
        // and of the children: do a crossover copy to simplify the later processing
        final List<T> child1Rep = new ArrayList<>(second.getRepresentation());
File Line
org/apache/commons/math4/legacy/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java 212
org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaFieldIntegrator.java 113
@Override
    public FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations,
                                                   final FieldODEState<T> initialState, final T finalTime)
        throws NumberIsTooSmallException, DimensionMismatchException,
        MaxCountExceededException, NoBracketingException {

        sanityChecks(initialState, finalTime);
        final T   t0 = initialState.getTime();
        final T[] y0 = equations.getMapper().mapState(initialState);
        setStepStart(initIntegration(equations, t0, y0, finalTime));
        final boolean forward = finalTime.subtract(initialState.getTime()).getReal() > 0;

        // create some internal working arrays
        final int   stages = c.length + 1;
        T[]         y      = y0;
        final T[][] yDotK  = MathArrays.buildArray(getField(), stages, -1);
        final T[]   yTmp   = MathArrays.buildArray(getField(), y0.length);
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1349
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1373
public T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor) {
        visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
        for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
            final int pStart = iBlock * BLOCK_SIZE;
            final int pEnd   = JdkMath.min(pStart + BLOCK_SIZE, rows);
            for (int p = pStart; p < pEnd; ++p) {
                for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                    final int jWidth = blockWidth(jBlock);
                    final int qStart = jBlock * BLOCK_SIZE;
                    final int qEnd   = JdkMath.min(qStart + BLOCK_SIZE, columns);
                    final T[] block = blocks[iBlock * blockColumns + jBlock];
                    int k = (p - pStart) * jWidth;
                    for (int q = qStart; q < qEnd; ++q) {
File Line
org/apache/commons/math4/legacy/ode/nonstiff/AdamsBashforthIntegrator.java 319
org/apache/commons/math4/legacy/ode/nonstiff/AdamsMoultonIntegrator.java 303
if (!isLastStep) {

                // prepare next step
                interpolator.storeTime(stepStart);

                if (resetOccurred) {
                    // some events handler has triggered changes that
                    // invalidate the derivatives, we need to restart from scratch
                    start(stepStart, y, t);
                    interpolator.reinitialize(stepStart, stepSize, scaled, nordsieck);
                }

                // stepsize control for next step
                final double  factor     = computeStepGrowShrinkFactor(error);
                final double  scaledH    = stepSize * factor;
                final double  nextT      = stepStart + scaledH;
                final boolean nextIsLast = forward ? (nextT >= t) : (nextT <= t);
                hNew = filterStep(scaledH, forward, nextIsLast);

                final double  filteredNextT      = stepStart + hNew;
                final boolean filteredNextIsLast = forward ? (filteredNextT >= t) : (filteredNextT <= t);
                if (filteredNextIsLast) {
                    hNew = t - stepStart;
                }

                interpolator.rescale(hNew);
            }
        } while (!isLastStep);

        // dispatch results
        equations.setTime(stepStart);
        equations.setCompleteState(y);

        resetInternalState();
    }
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1511
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1541
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1506
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1537
checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0     = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd   = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) {
                final int jWidth = blockWidth(jBlock);
                final int q0     = jBlock * BLOCK_SIZE;
                final int qStart = JdkMath.max(startColumn, q0);
                final int qEnd   = JdkMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
                final T[] block = blocks[iBlock * blockColumns + jBlock];
File Line
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1343
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1367
public double walkInRowOrder(final RealMatrixChangingVisitor visitor) {
        visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
        for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
            final int pStart = iBlock * BLOCK_SIZE;
            final int pEnd = JdkMath.min(pStart + BLOCK_SIZE, rows);
            for (int p = pStart; p < pEnd; ++p) {
                for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                    final int jWidth = blockWidth(jBlock);
                    final int qStart = jBlock * BLOCK_SIZE;
                    final int qEnd = JdkMath.min(qStart + BLOCK_SIZE, columns);
                    final double[] block = blocks[iBlock * blockColumns + jBlock];
                    int k = (p - pStart) * jWidth;
                    for (int q = qStart; q < qEnd; ++q) {
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 49
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 61
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1223
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1221
final T[] tBlock   = blocks[jBlock * blockColumns + iBlock];
                final int      pStart   = iBlock * BLOCK_SIZE;
                final int      pEnd     = JdkMath.min(pStart + BLOCK_SIZE, columns);
                final int      qStart   = jBlock * BLOCK_SIZE;
                final int      qEnd     = JdkMath.min(qStart + BLOCK_SIZE, rows);
                int k = 0;
                for (int p = pStart; p < pEnd; ++p) {
                    final int lInc = pEnd - pStart;
                    int l = p - pStart;
                    for (int q = qStart; q < qEnd; ++q) {
                        outBlock[k] = tBlock[l];
                        ++k;
                        l+= lInc;
                    }
                }

                // go to next block
                ++blockIndex;
            }
        }

        return out;
    }

    /** {@inheritDoc} */
    @Override
    public int getRowDimension() {
        return rows;
    }

    /** {@inheritDoc} */
    @Override
    public int getColumnDimension() {
        return columns;
    }

    /** {@inheritDoc} */
    @Override
    public T[] operate(final T[] v) throws DimensionMismatchException {
File Line
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853StepInterpolator.java 373
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853StepInterpolator.java 387
eta * (v[1][i] +
                                    theta * (v[2][i] +
                                            eta * (v[3][i] +
                                                    theta * (v[4][i] +
                                                            eta * (v[5][i] +
                                                                    theta * (v[6][i])))))));
            interpolatedDerivatives[i] =  v[0][i] + dot1 * v[1][i] + dot2 * v[2][i] +
                    dot3 * v[3][i] + dot4 * v[4][i] +
                    dot5 * v[5][i] + dot6 * v[6][i];
        }
    } else {
File Line
org/apache/commons/math4/legacy/stat/regression/MillerUpdatingRegression.java 975
org/apache/commons/math4/legacy/stat/regression/MillerUpdatingRegression.java 1086
int idx1 = 0;
            int idx2;
            int ii;
            int jj;
            for (int i = 0; i < beta.length; i++) {
                ii = newIndices[i];
                for (int j = 0; j <= i; j++, idx1++) {
                    jj = newIndices[j];
                    if (ii > jj) {
                        idx2 = ii * (ii + 1) / 2 + jj;
                    } else {
                        idx2 = jj * (jj + 1) / 2 + ii;
                    }
                    covNew[idx1] = cov[idx2];
                }
            }
            return new RegressionResults(
                    betaNew, new double[][]{covNew}, true, this.nobs, rnk,
                    this.sumy, this.sumsqy, this.sserr, this.hasIntercept, false);
        }
    }
File Line
org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java 136
org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java 148
System.arraycopy(source.values, 0, values, 0, length);
        states = new byte[length];
        System.arraycopy(source.states, 0, states, 0, length);
        missingEntries = source.missingEntries;
        size  = source.size;
        mask  = source.mask;
        count = source.count;
    }

    /**
     * Compute the capacity needed for a given size.
     * @param expectedSize expected size of the map
     * @return capacity to use for the specified size
     */
    private static int computeCapacity(final int expectedSize) {
        if (expectedSize == 0) {
            return 1;
        }
        final int capacity   = (int) JdkMath.ceil(expectedSize / LOAD_FACTOR);
        final int powerOfTwo = Integer.highestOneBit(capacity);
        if (powerOfTwo == capacity) {
            return capacity;
        }
        return nextPowerOfTwo(capacity);
    }

    /**
     * Find the smallest power of two greater than the input value.
     * @param i input value
     * @return smallest power of two greater than the input value
     */
    private static int nextPowerOfTwo(final int i) {
        return Integer.highestOneBit(i) << 1;
    }

    /**
     * Get the stored value associated with the given key.
     * @param key key associated with the data
     * @return data associated with the key
     */
    public double get(final int key) {
File Line
org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java 346
org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java 358
public double remove(final int key) {

        final int hash  = hashOf(key);
        int index = hash & mask;
        if (containsKey(key, index)) {
            return doRemove(index);
        }

        if (states[index] == FREE) {
            return missingEntries;
        }

        int j = index;
        for (int perturb = perturb(hash); states[index] != FREE; perturb >>= PERTURB_SHIFT) {
            j = probe(perturb, j);
            index = j & mask;
            if (containsKey(key, index)) {
                return doRemove(index);
            }
        }

        return missingEntries;
    }

    /**
     * Check if the tables contain an element associated with specified key
     * at specified index.
     * @param key key to check
     * @param index index to check
     * @return true if an element is associated with key at index
     */
    private boolean containsKey(final int key, final int index) {
        return (key != 0 || states[index] == FULL) && keys[index] == key;
    }

    /**
     * Remove an element at specified index.
     * @param index index of the element to remove
     * @return removed value
     */
    private double doRemove(int index) {
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1457
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1482
public T walkInOptimizedOrder(final FieldMatrixChangingVisitor<T> visitor) {
        visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
        int blockIndex = 0;
        for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
            final int pStart = iBlock * BLOCK_SIZE;
            final int pEnd   = JdkMath.min(pStart + BLOCK_SIZE, rows);
            for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                final int qStart = jBlock * BLOCK_SIZE;
                final int qEnd   = JdkMath.min(qStart + BLOCK_SIZE, columns);
                final T[] block = blocks[blockIndex];
                int k = 0;
                for (int p = pStart; p < pEnd; ++p) {
                    for (int q = qStart; q < qEnd; ++q) {
File Line
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldIntegrator.java 137
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince853FieldIntegrator.java 173
minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance);
        e1_01 = fraction(        116092271.0,       8848465920.0);
        e1_06 = fraction(         -1871647.0,          1527680.0);
        e1_07 = fraction(        -69799717.0,        140793660.0);
        e1_08 = fraction(    1230164450203.0,     739113984000.0);
        e1_09 = fraction(-1980813971228885.0, 5654156025964544.0);
        e1_10 = fraction(        464500805.0,       1389975552.0);
        e1_11 = fraction(    1606764981773.0,   19613062656000.0);
        e1_12 = fraction(          -137909.0,          6168960.0);
        e2_01 = fraction(          -364463.0,          1920240.0);
        e2_06 = fraction(          3399327.0,           763840.0);
        e2_07 = fraction(         66578432.0,         35198415.0);
        e2_08 = fraction(      -1674902723.0,        288716400.0);
        e2_09 = fraction(  -74684743568175.0,  176692375811392.0);
        e2_10 = fraction(          -734375.0,          4826304.0);
        e2_11 = fraction(        171414593.0,        851261400.0);
        e2_12 = fraction(            69869.0,          3084480.0);
    }
File Line
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1451
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1476
public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor) {
        visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
        int blockIndex = 0;
        for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
            final int pStart = iBlock * BLOCK_SIZE;
            final int pEnd = JdkMath.min(pStart + BLOCK_SIZE, rows);
            for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                final int qStart = jBlock * BLOCK_SIZE;
                final int qEnd = JdkMath.min(qStart + BLOCK_SIZE, columns);
                final double[] block = blocks[blockIndex];
                int k = 0;
                for (int p = pStart; p < pEnd; ++p) {
                    for (int q = qStart; q < qEnd; ++q) {
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1552
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1548
final T[] block = blocks[iBlock * blockColumns + jBlock];
                for (int p = pStart; p < pEnd; ++p) {
                    int k = (p - p0) * jWidth + qStart - q0;
                    for (int q = qStart; q < qEnd; ++q) {
                        visitor.visit(p, q, block[k]);
                        ++k;
                    }
                }
            }
        }
        return visitor.end();
    }

    /**
     * Get the height of a block.
     * @param blockRow row index (in block sense) of the block
     * @return height (number of rows) of the block
     */
    private int blockHeight(final int blockRow) {
        return (blockRow == blockRows - 1) ? rows - blockRow * BLOCK_SIZE : BLOCK_SIZE;
    }

    /**
     * Get the width of a block.
     * @param blockColumn column index (in block sense) of the block
     * @return width (number of columns) of the block
     */
    private int blockWidth(final int blockColumn) {
        return (blockColumn == blockColumns - 1) ? columns - blockColumn * BLOCK_SIZE : BLOCK_SIZE;
    }
}
File Line
org/apache/commons/math4/legacy/linear/OpenIntToDoubleHashMap.java 534
org/apache/commons/math4/legacy/linear/OpenIntToFieldHashMap.java 546
public double value()
            throws ConcurrentModificationException, NoSuchElementException {
            if (referenceCount != count) {
                throw new ConcurrentModificationException();
            }
            if (current < 0) {
                throw new NoSuchElementException();
            }
            return values[current];
        }

        /**
         * Advance iterator one step further.
         * @exception ConcurrentModificationException if the map is modified during iteration
         * @exception NoSuchElementException if there is no element left in the map
         */
        public void advance()
            throws ConcurrentModificationException, NoSuchElementException {

            if (referenceCount != count) {
                throw new ConcurrentModificationException();
            }

            // advance on step
            current = next;

            // prepare next step
            try {
                do {
                    ++next;
                } while (states[next] != FULL);
            } catch (ArrayIndexOutOfBoundsException e) {
                next = -2;
                if (current < 0) {
                    throw new NoSuchElementException();
                }
            }
        }
    }

    /**
     * Read a serialized object.
     * @param stream input stream
     * @throws IOException if object cannot be read
     * @throws ClassNotFoundException if the class corresponding
     * to the serialized object cannot be found
     */
    private void readObject(final ObjectInputStream stream)
        throws IOException, ClassNotFoundException {
        stream.defaultReadObject();
        count = 0;
    }
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 49
{ 2,-2,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 64
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 65
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/ode/nonstiff/GillStepInterpolator.java 118
org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesStepInterpolator.java 111
final double coeff4    = s * (-3 * theta + fourTheta2);
        for (int i = 0; i < interpolatedState.length; ++i) {
            final double yDot1 = yDotK[0][i];
            final double yDot2 = yDotK[1][i];
            final double yDot3 = yDotK[2][i];
            final double yDot4 = yDotK[3][i];
            interpolatedState[i] =
                    previousState[i] + coeff1 * yDot1 + coeff2 * yDot2 + coeff3 * yDot3 + coeff4 * yDot4;
            interpolatedDerivatives[i] =
                    coeffDot1 * yDot1 + coeffDot2 * yDot2 + coeffDot3 * yDot3 + coeffDot4 * yDot4;
        }
    } else {
        final double s      = oneMinusThetaH / 6.0;
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 61
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 64
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/ode/nonstiff/GillStepInterpolator.java 135
org/apache/commons/math4/legacy/ode/nonstiff/ThreeEighthesStepInterpolator.java 128
final double coeff4 = s * (1 + theta + fourTheta2);
        for (int i = 0; i < interpolatedState.length; ++i) {
            final double yDot1 = yDotK[0][i];
            final double yDot2 = yDotK[1][i];
            final double yDot3 = yDotK[2][i];
            final double yDot4 = yDotK[3][i];
            interpolatedState[i] =
                    currentState[i] - coeff1 * yDot1 - coeff2 * yDot2 - coeff3 * yDot3 - coeff4 * yDot4;
            interpolatedDerivatives[i] =
                    coeffDot1 * yDot1 + coeffDot2 * yDot2 + coeffDot3 * yDot3 + coeffDot4 * yDot4;
        }
    }
  }
}
File Line
org/apache/commons/math4/legacy/linear/Array2DRowFieldMatrix.java 227
org/apache/commons/math4/legacy/linear/Array2DRowFieldMatrix.java 255
public Array2DRowFieldMatrix<T> add(final Array2DRowFieldMatrix<T> m)
        throws MatrixDimensionMismatchException {
        // safety check
        checkAdd(m);

        final int rowCount    = getRowDimension();
        final int columnCount = getColumnDimension();
        final T[][] outData = MathArrays.buildArray(getField(), rowCount, columnCount);
        for (int row = 0; row < rowCount; row++) {
            final T[] dataRow    = data[row];
            final T[] mRow       = m.data[row];
            final T[] outDataRow = outData[row];
            for (int col = 0; col < columnCount; col++) {
                outDataRow[col] = dataRow[col].add(mRow[col]);
File Line
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1391
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1501
public double walkInRowOrder(final RealMatrixChangingVisitor visitor,
                                 final int startRow, final int endRow,
                                 final int startColumn, final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0 = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int p = pStart; p < pEnd; ++p) {
File Line
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1421
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1532
public double walkInRowOrder(final RealMatrixPreservingVisitor visitor,
                                 final int startRow, final int endRow,
                                 final int startColumn, final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0 = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int p = pStart; p < pEnd; ++p) {
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1397
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1507
public T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor,
                            final int startRow, final int endRow,
                            final int startColumn, final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0     = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd   = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int p = pStart; p < pEnd; ++p) {
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1427
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1537
public T walkInRowOrder(final FieldMatrixPreservingVisitor<T> visitor,
                            final int startRow, final int endRow,
                            final int startColumn, final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0     = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd   = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int p = pStart; p < pEnd; ++p) {
File Line
org/apache/commons/math4/legacy/linear/ArrayFieldVector.java 1092
org/apache/commons/math4/legacy/linear/SparseFieldVector.java 527
index, 0, getDimension() - 1);
        }
    }

    /**
     * Checks that the indices of a subvector are valid.
     *
     * @param start the index of the first entry of the subvector
     * @param end the index of the last entry of the subvector (inclusive)
     * @throws OutOfRangeException if {@code start} of {@code end} are not valid
     * @throws NumberIsTooSmallException if {@code end < start}
     * @since 3.3
     */
    private void checkIndices(final int start, final int end)
        throws NumberIsTooSmallException, OutOfRangeException {
        final int dim = getDimension();
        if (start < 0 || start >= dim) {
            throw new OutOfRangeException(LocalizedFormats.INDEX, start, 0,
                                          dim - 1);
        }
        if (end < 0 || end >= dim) {
            throw new OutOfRangeException(LocalizedFormats.INDEX, end, 0,
                                          dim - 1);
        }
        if (end < start) {
            throw new NumberIsTooSmallException(LocalizedFormats.INITIAL_ROW_AFTER_FINAL_ROW,
                                                end, start, false);
        }
    }
File Line
org/apache/commons/math4/legacy/linear/MatrixUtils.java 830
org/apache/commons/math4/legacy/linear/MatrixUtils.java 875
public static void solveLowerTriangularSystem(RealMatrix rm, RealVector b)
        throws DimensionMismatchException, MathArithmeticException,
        NonSquareMatrixException {
        if (rm == null || b == null || rm.getRowDimension() != b.getDimension()) {
            throw new DimensionMismatchException(
                    (rm == null) ? 0 : rm.getRowDimension(),
                    (b == null) ? 0 : b.getDimension());
        }
        if( rm.getColumnDimension() != rm.getRowDimension() ){
            throw new NonSquareMatrixException(rm.getRowDimension(),
                                               rm.getColumnDimension());
        }
        int rows = rm.getRowDimension();
        for( int i = 0 ; i < rows ; i++ ){
File Line
org/apache/commons/math4/legacy/stat/inference/ChiSquareTest.java 80
org/apache/commons/math4/legacy/stat/inference/GTest.java 76
public double chiSquare(final double[] expected, final long[] observed)
        throws NotPositiveException, NotStrictlyPositiveException,
        DimensionMismatchException {

        if (expected.length < 2) {
            throw new DimensionMismatchException(expected.length, 2);
        }
        if (expected.length != observed.length) {
            throw new DimensionMismatchException(expected.length, observed.length);
        }
        MathArrays.checkPositive(expected);
        MathArrays.checkNonNegative(observed);

        double sumExpected = 0d;
        double sumObserved = 0d;
        for (int i = 0; i < observed.length; i++) {
            sumExpected += expected[i];
            sumObserved += observed[i];
        }
        double ratio = 1.0d;
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 51
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 63
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 78
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 81
{ 0,0,0,0,0,0,0,0,-3,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 840
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 851
final T[] block = blocks[iBlock * blockColumns + jBlock];
            final int available  = outBlock.length - outIndex;
            if (jWidth > available) {
                System.arraycopy(block, iRow * jWidth, outBlock, outIndex, available);
                outBlock = out.blocks[++outBlockIndex];
                System.arraycopy(block, iRow * jWidth, outBlock, 0, jWidth - available);
                outIndex = jWidth - available;
            } else {
                System.arraycopy(block, iRow * jWidth, outBlock, outIndex, jWidth);
                outIndex += jWidth;
            }
        }

        return out;
    }

    /** {@inheritDoc} */
    @Override
    public void setRowMatrix(final int row, final FieldMatrix<T> matrix)
File Line
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1391
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1532
public double walkInRowOrder(final RealMatrixChangingVisitor visitor,
                                 final int startRow, final int endRow,
                                 final int startColumn, final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0 = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int p = pStart; p < pEnd; ++p) {
File Line
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1421
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1501
public double walkInRowOrder(final RealMatrixPreservingVisitor visitor,
                                 final int startRow, final int endRow,
                                 final int startColumn, final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0 = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int p = pStart; p < pEnd; ++p) {
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 49
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 61
{ 2,-2,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 61
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 65
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 64
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 65
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1349
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1373
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1343
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 1367
public T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor) {
        visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
        for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
            final int pStart = iBlock * BLOCK_SIZE;
            final int pEnd   = JdkMath.min(pStart + BLOCK_SIZE, rows);
            for (int p = pStart; p < pEnd; ++p) {
                for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                    final int jWidth = blockWidth(jBlock);
                    final int qStart = jBlock * BLOCK_SIZE;
                    final int qEnd   = JdkMath.min(qStart + BLOCK_SIZE, columns);
                    final T[] block = blocks[iBlock * blockColumns + jBlock];
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1397
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1537
public T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor,
                            final int startRow, final int endRow,
                            final int startColumn, final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0     = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd   = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int p = pStart; p < pEnd; ++p) {
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1427
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 1507
public T walkInRowOrder(final FieldMatrixPreservingVisitor<T> visitor,
                            final int startRow, final int endRow,
                            final int startColumn, final int endColumn)
        throws OutOfRangeException, NumberIsTooSmallException {
        checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
        visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
        for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
            final int p0     = iBlock * BLOCK_SIZE;
            final int pStart = JdkMath.max(startRow, p0);
            final int pEnd   = JdkMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
            for (int p = pStart; p < pEnd; ++p) {
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ -3,3,0,0,0,0,0,0,-2,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 2,-2,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 52
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 64
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 94
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 97
{ 0,0,0,0,0,0,0,0,2,0,0,0,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 49
{ 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 49
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 61
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 49
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 64
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 50
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 62
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 50
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 61
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 62
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 65
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 64
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 65
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 67
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 65
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 363
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 433
public BlockFieldMatrix<T> add(final BlockFieldMatrix<T> m)
        throws MatrixDimensionMismatchException {

        // safety check
        checkAdd(m);

        final BlockFieldMatrix<T> out = new BlockFieldMatrix<>(getField(), rows, columns);

        // perform addition block-wise, to ensure good cache behavior
        for (int blockIndex = 0; blockIndex < out.blocks.length; ++blockIndex) {
            final T[] outBlock = out.blocks[blockIndex];
            final T[] tBlock   = blocks[blockIndex];
            final T[] mBlock   = m.blocks[blockIndex];
            for (int k = 0; k < outBlock.length; ++k) {
                outBlock[k] = tBlock[k].add(mBlock[k]);
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 53
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 57
{ -3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,-3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 69
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 73
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,-2,0,-1,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 658
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 669
new BlockFieldMatrix<>(getField(), endRow - startRow + 1, endColumn - startColumn + 1);

        // compute blocks shifts
        final int blockStartRow    = startRow    / BLOCK_SIZE;
        final int rowsShift        = startRow    % BLOCK_SIZE;
        final int blockStartColumn = startColumn / BLOCK_SIZE;
        final int columnsShift     = startColumn % BLOCK_SIZE;

        // perform extraction block-wise, to ensure good cache behavior
        int pBlock = blockStartRow;
        for (int iBlock = 0; iBlock < out.blockRows; ++iBlock) {
            final int iHeight = out.blockHeight(iBlock);
            int qBlock = blockStartColumn;
            for (int jBlock = 0; jBlock < out.blockColumns; ++jBlock) {
                final int jWidth = out.blockWidth(jBlock);

                // handle one block of the output matrix
                final int      outIndex = iBlock * out.blockColumns + jBlock;
                final T[] outBlock = out.blocks[outIndex];
File Line
org/apache/commons/math4/legacy/ode/events/FilterType.java 154
org/apache/commons/math4/legacy/ode/events/FilterType.java 276
} else if (g < 0) {
                            // initialize as if previous root (i.e. forward one) was an ignored increasing event
                            return Transformer.MIN;
                        } else {
                            // we are exactly at a root, we don't know if it is an increasing
                            // or a decreasing event, we remain in uninitialized state
                            return Transformer.UNINITIALIZED;
                        }
                    case PLUS  :
                        if (g <= 0) {
                            // we have crossed the zero line on an ignored increasing event,
                            // we must change the transformer
                            return Transformer.MAX;
                        } else {
                            // we are still in the same status
                            return previous;
                        }
                    case MINUS :
                        if (g <= 0) {
                            // we have crossed the zero line on an ignored increasing event,
                            // we must change the transformer
                            return Transformer.MIN;
                        } else {
                            // we are still in the same status
                            return previous;
                        }
                    case MIN   :
                        if (g >= 0) {
                            // we have crossed the zero line on a triggered decreasing event,
                            // we must change the transformer
                            return Transformer.PLUS;
                        } else {
                            // we are still in the same status
                            return previous;
                        }
                    case MAX   :
                        if (g >= 0) {
                            // we have crossed the zero line on a triggered decreasing event,
                            // we must change the transformer
                            return Transformer.MINUS;
                        } else {
                            // we are still in the same status
                            return previous;
                        }
                    default    :
                        // this should never happen
                        throw new MathInternalError();
                }
            }
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 49
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 53
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 57
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 61
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 64
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 65
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 69
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 73
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 161
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 157
} else {
            // reference existing array
            blocks = blockData;
        }

        int index = 0;
        for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
            final int iHeight = blockHeight(iBlock);
            for (int jBlock = 0; jBlock < blockColumns; ++jBlock, ++index) {
                if (blockData[index].length != iHeight * blockWidth(jBlock)) {
                    throw new DimensionMismatchException(blockData[index].length,
                                                         iHeight * blockWidth(jBlock));
                }
                if (copyArray) {
                    blocks[index] = blockData[index].clone();
                }
            }
        }
    }

    /**
     * Convert a data array from raw layout to blocks layout.
     * <p>
     * Raw layout is the straightforward layout where element at row i and
     * column j is in array element <code>rawData[i][j]</code>. Blocks layout
     * is the layout used in {@link BlockFieldMatrix} instances, where the matrix
     * is split in square blocks (except at right and bottom side where blocks may
     * be rectangular to fit matrix size) and each block is stored in a flattened
     * one-dimensional array.
     * </p>
     * <p>
     * This method creates an array in blocks layout from an input array in raw layout.
     * It can be used to provide the array argument of the {@link
     * #BlockFieldMatrix(int, int, FieldElement[][], boolean)}
     * constructor.
     * </p>
     * @param <T> Type of the field elements.
     * @param rawData Data array in raw layout.
     * @return a new data array containing the same entries but in blocks layout
     * @throws DimensionMismatchException if {@code rawData} is not rectangular
     *  (not all rows have the same length).
     * @see #createBlocksLayout(Field, int, int)
     * @see #BlockFieldMatrix(int, int, FieldElement[][], boolean)
     */
    public static <T extends FieldElement<T>> T[][] toBlocksLayout(final T[][] rawData)
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 49
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 60
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 61
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
        { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/linear/Array2DRowRealMatrix.java 151
org/apache/commons/math4/legacy/linear/Array2DRowRealMatrix.java 178
public Array2DRowRealMatrix add(final Array2DRowRealMatrix m) {
        // Safety check.
        checkAdd(m);

        final int rowCount    = getRowDimension();
        final int columnCount = getColumnDimension();
        final double[][] outData = new double[rowCount][columnCount];
        for (int row = 0; row < rowCount; row++) {
            final double[] dataRow    = data[row];
            final double[] mRow       = m.data[row];
            final double[] outDataRow = outData[row];
            for (int col = 0; col < columnCount; col++) {
                outDataRow[col] = dataRow[col] + mRow[col];
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 223
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 272
final T[][] blocks = MathArrays.buildArray(field, blockRows * blockColumns, -1);
        int blockIndex = 0;
        for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
            final int pStart  = iBlock * BLOCK_SIZE;
            final int pEnd    = JdkMath.min(pStart + BLOCK_SIZE, rows);
            final int iHeight = pEnd - pStart;
            for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                final int qStart = jBlock * BLOCK_SIZE;
                final int qEnd   = JdkMath.min(qStart + BLOCK_SIZE, columns);
                final int jWidth = qEnd - qStart;
File Line
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldIntegrator.java 221
org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54FieldIntegrator.java 194
final T yScale = RealFieldElement.max(y0[j].abs(), y1[j].abs());
            final T tol    = (vecAbsoluteTolerance == null) ?
                             yScale.multiply(scalRelativeTolerance).add(scalAbsoluteTolerance) :
                             yScale.multiply(vecRelativeTolerance[j]).add(vecAbsoluteTolerance[j]);
            final T ratio  = h.multiply(errSum).divide(tol);
            error = error.add(ratio.multiply(ratio));
        }

        return error.divide(mainSetDimension).sqrt();
    }
}
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaFieldIntegrator.java 152
org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaFieldIntegrator.java 240
yDotK[0] = equations.getMapper().mapDerivative(getStepStart());

            // next stages
            for (int k = 1; k < stages; ++k) {

                for (int j = 0; j < y0.length; ++j) {
                    T sum = yDotK[0][j].multiply(a[k-1][0]);
                    for (int l = 1; l < k; ++l) {
                        sum = sum.add(yDotK[l][j].multiply(a[k-1][l]));
                    }
                    yTmp[j] = y[j].add(getStepSize().multiply(sum));
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/genetics/OnePointCrossover.java 97
org/apache/commons/math4/legacy/genetics/UniformCrossover.java 104
private ChromosomePair crossover(final AbstractListChromosome<T> first,
                                     final AbstractListChromosome<T> second) throws DimensionMismatchException {
        final int length = first.getLength();
        if (length != second.getLength()) {
            throw new DimensionMismatchException(second.getLength(), length);
        }

        // array representations of the parents
        final List<T> parent1Rep = first.getRepresentation();
        final List<T> parent2Rep = second.getRepresentation();
        // and of the children
        final List<T> child1Rep = new ArrayList<>(length);
        final List<T> child2Rep = new ArrayList<>(length);

        // select a crossover point at random (0 and length makes no sense)
        final int crossoverIndex = 1 + (GeneticAlgorithm.getRandomGenerator().nextInt(length-2));
File Line
org/apache/commons/math4/legacy/linear/BlockFieldMatrix.java 897
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 908
final T[] block = blocks[iBlock * blockColumns + jBlock];
            final int available  = mBlock.length - mIndex;
            if (jWidth > available) {
                System.arraycopy(mBlock, mIndex, block, iRow * jWidth, available);
                mBlock = matrix.blocks[++mBlockIndex];
                System.arraycopy(mBlock, 0, block, iRow * jWidth, jWidth - available);
                mIndex = jWidth - available;
            } else {
                System.arraycopy(mBlock, mIndex, block, iRow * jWidth, jWidth);
                mIndex += jWidth;
           }
        }
    }

    /** {@inheritDoc} */
    @Override
    public FieldMatrix<T> getColumnMatrix(final int column)
File Line
org/apache/commons/math4/legacy/ode/nonstiff/DormandPrince54FieldIntegrator.java 138
org/apache/commons/math4/legacy/ode/nonstiff/HighamHall54FieldIntegrator.java 113
c[3] = fraction(8,  9);
        c[4] = getField().getOne();
        c[5] = getField().getOne();
        return c;
    }

    /** {@inheritDoc} */
    @Override
    public T[][] getA() {
        final T[][] a = MathArrays.buildArray(getField(), 6, -1);
        for (int i = 0; i < a.length; ++i) {
            a[i] = MathArrays.buildArray(getField(), i + 1);
        }
        a[0][0] = fraction(     1,     5);
File Line
org/apache/commons/math4/legacy/ode/nonstiff/EmbeddedRungeKuttaFieldIntegrator.java 273
org/apache/commons/math4/legacy/ode/nonstiff/RungeKuttaFieldIntegrator.java 243
for (int k = 1; k < stages; ++k) {

                    for (int j = 0; j < y0.length; ++j) {
                        T sum = yDotK[0][j].multiply(a[k-1][0]);
                        for (int l = 1; l < k; ++l) {
                            sum = sum.add(yDotK[l][j].multiply(a[k-1][l]));
                        }
                        yTmp[j] = y[j].add(getStepSize().multiply(sum));
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 214
org/apache/commons/math4/legacy/linear/BlockRealMatrix.java 258
final double[][] blocks = new double[blockRows * blockColumns][];
        int blockIndex = 0;
        for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
            final int pStart = iBlock * BLOCK_SIZE;
            final int pEnd = JdkMath.min(pStart + BLOCK_SIZE, rows);
            final int iHeight = pEnd - pStart;
            for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                final int qStart = jBlock * BLOCK_SIZE;
                final int qEnd = JdkMath.min(qStart + BLOCK_SIZE, columns);
                final int jWidth = qEnd - qStart;
File Line
org/apache/commons/math4/legacy/ode/nonstiff/LutherStepInterpolator.java 140
org/apache/commons/math4/legacy/ode/nonstiff/LutherStepInterpolator.java 163
final double coeff7    =      theta * (   3            /  10.0 + theta * (   -1                   + theta * (   3            /  4.0)));
            for (int i = 0; i < interpolatedState.length; ++i) {
                final double yDot1 = yDotK[0][i];
                final double yDot2 = yDotK[1][i];
                final double yDot3 = yDotK[2][i];
                final double yDot4 = yDotK[3][i];
                final double yDot5 = yDotK[4][i];
                final double yDot6 = yDotK[5][i];
                final double yDot7 = yDotK[6][i];
                interpolatedState[i] = previousState[i] +
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/linear/ArrayFieldVector.java 1105
org/apache/commons/math4/legacy/linear/RealVector.java 205
org/apache/commons/math4/legacy/linear/SparseFieldVector.java 540
private void checkIndices(final int start, final int end)
        throws NumberIsTooSmallException, OutOfRangeException {
        final int dim = getDimension();
        if (start < 0 || start >= dim) {
            throw new OutOfRangeException(LocalizedFormats.INDEX, start, 0,
                                          dim - 1);
        }
        if (end < 0 || end >= dim) {
            throw new OutOfRangeException(LocalizedFormats.INDEX, end, 0,
                                          dim - 1);
        }
        if (end < start) {
            throw new NumberIsTooSmallException(LocalizedFormats.INITIAL_ROW_AFTER_FINAL_ROW,
                                                end, start, false);
        }
    }
File Line
org/apache/commons/math4/legacy/stat/correlation/KendallsCorrelation.java 121
org/apache/commons/math4/legacy/stat/correlation/PearsonsCorrelation.java 228
int nVars = matrix.getColumnDimension();
        RealMatrix outMatrix = new BlockRealMatrix(nVars, nVars);
        for (int i = 0; i < nVars; i++) {
            for (int j = 0; j < i; j++) {
                double corr = correlation(matrix.getColumn(i), matrix.getColumn(j));
                outMatrix.setEntry(i, j, corr);
                outMatrix.setEntry(j, i, corr);
            }
            outMatrix.setEntry(i, i, 1d);
        }
        return outMatrix;
    }

    /**
     * Computes the Kendall's Tau rank correlation matrix for the columns of
     * the input rectangular array.  The columns of the array represent values
     * of variables to be correlated.
     *
     * @param matrix matrix with columns representing variables to correlate
     * @return correlation matrix
     */
    public RealMatrix computeCorrelationMatrix(final double[][] matrix) {
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 66
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
File Line
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 45
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 46
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 47
org/apache/commons/math4/legacy/analysis/interpolation/TricubicInterpolatingFunction.java 48
{ 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },