Reverted incompatible changes not detected by CLIRR.
The changes were detected by running the former 2.1 test (which is a realistic approximation of what existing user code may look like) against version 2.2 of the library itself. This showed that user code that did use DerivativeException (but also FunctionEvaluationException) which have recently been switched back to checked did not compile anymore (the revert did disable the attempt for a smooth transition). Hence this fix declares again all these exception throughout the API. CLIRR still sees nothing about this huge change ... git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/branches/MATH_2_X@1073158 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7658aa9592
commit
66cd473d1d
|
@ -18,7 +18,7 @@
|
|||
package org.apache.commons.math.analysis;
|
||||
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
|
||||
/**
|
||||
* An interface representing a multivariate matrix function.
|
||||
|
@ -31,10 +31,10 @@ public interface MultivariateMatrixFunction {
|
|||
* Compute the value for the function at the given point.
|
||||
* @param point point at which the function must be evaluated
|
||||
* @return function value for the given point
|
||||
* @exception MathUserException if the function evaluation fails
|
||||
* @exception FunctionEvaluationException if the function evaluation fails
|
||||
* @exception IllegalArgumentException if points dimension is wrong
|
||||
*/
|
||||
double[][] value(double[] point)
|
||||
throws MathUserException, IllegalArgumentException;
|
||||
throws FunctionEvaluationException, IllegalArgumentException;
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.Arrays;
|
|||
import org.apache.commons.math.Field;
|
||||
import org.apache.commons.math.FieldElement;
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
|
||||
/**
|
||||
|
@ -776,7 +776,7 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -792,7 +792,7 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public T walkInRowOrder(final FieldMatrixPreservingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -808,7 +808,7 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements
|
|||
public T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -826,7 +826,7 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements
|
|||
public T walkInRowOrder(final FieldMatrixPreservingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -840,7 +840,7 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public T walkInColumnOrder(final FieldMatrixChangingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -856,7 +856,7 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public T walkInColumnOrder(final FieldMatrixPreservingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -872,7 +872,7 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements
|
|||
public T walkInColumnOrder(final FieldMatrixChangingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -890,7 +890,7 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements
|
|||
public T walkInColumnOrder(final FieldMatrixPreservingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -904,13 +904,13 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public T walkInOptimizedOrder(final FieldMatrixChangingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
return walkInRowOrder(visitor);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public T walkInOptimizedOrder(final FieldMatrixPreservingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
return walkInRowOrder(visitor);
|
||||
}
|
||||
|
||||
|
@ -918,7 +918,7 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements
|
|||
public T walkInOptimizedOrder(final FieldMatrixChangingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
return walkInRowOrder(visitor, startRow, endRow, startColumn, endColumn);
|
||||
}
|
||||
|
||||
|
@ -926,7 +926,7 @@ public abstract class AbstractFieldMatrix<T extends FieldElement<T>> implements
|
|||
public T walkInOptimizedOrder(final FieldMatrixPreservingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
return walkInRowOrder(visitor, startRow, endRow, startColumn, endColumn);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package org.apache.commons.math.linear;
|
||||
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.util.MathUtils;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
@ -778,7 +778,7 @@ public abstract class AbstractRealMatrix implements RealMatrix {
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public double walkInRowOrder(final RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -795,7 +795,7 @@ public abstract class AbstractRealMatrix implements RealMatrix {
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public double walkInRowOrder(final RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -811,7 +811,7 @@ public abstract class AbstractRealMatrix implements RealMatrix {
|
|||
public double walkInRowOrder(final RealMatrixChangingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -830,7 +830,7 @@ public abstract class AbstractRealMatrix implements RealMatrix {
|
|||
public double walkInRowOrder(final RealMatrixPreservingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -844,7 +844,7 @@ public abstract class AbstractRealMatrix implements RealMatrix {
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public double walkInColumnOrder(final RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -861,7 +861,7 @@ public abstract class AbstractRealMatrix implements RealMatrix {
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -877,7 +877,7 @@ public abstract class AbstractRealMatrix implements RealMatrix {
|
|||
public double walkInColumnOrder(final RealMatrixChangingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -896,7 +896,7 @@ public abstract class AbstractRealMatrix implements RealMatrix {
|
|||
public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -910,13 +910,13 @@ public abstract class AbstractRealMatrix implements RealMatrix {
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
return walkInRowOrder(visitor);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
return walkInRowOrder(visitor);
|
||||
}
|
||||
|
||||
|
@ -924,7 +924,7 @@ public abstract class AbstractRealMatrix implements RealMatrix {
|
|||
public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
return walkInRowOrder(visitor, startRow, endRow, startColumn, endColumn);
|
||||
}
|
||||
|
||||
|
@ -932,7 +932,7 @@ public abstract class AbstractRealMatrix implements RealMatrix {
|
|||
public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
return walkInRowOrder(visitor, startRow, endRow, startColumn, endColumn);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.io.Serializable;
|
|||
import org.apache.commons.math.Field;
|
||||
import org.apache.commons.math.FieldElement;
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
|
||||
/**
|
||||
|
@ -450,7 +450,7 @@ public class Array2DRowFieldMatrix<T extends FieldElement<T>> extends AbstractFi
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -466,7 +466,7 @@ public class Array2DRowFieldMatrix<T extends FieldElement<T>> extends AbstractFi
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T walkInRowOrder(final FieldMatrixPreservingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -484,7 +484,7 @@ public class Array2DRowFieldMatrix<T extends FieldElement<T>> extends AbstractFi
|
|||
public T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -502,7 +502,7 @@ public class Array2DRowFieldMatrix<T extends FieldElement<T>> extends AbstractFi
|
|||
public T walkInRowOrder(final FieldMatrixPreservingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -518,7 +518,7 @@ public class Array2DRowFieldMatrix<T extends FieldElement<T>> extends AbstractFi
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T walkInColumnOrder(final FieldMatrixChangingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -534,7 +534,7 @@ public class Array2DRowFieldMatrix<T extends FieldElement<T>> extends AbstractFi
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T walkInColumnOrder(final FieldMatrixPreservingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -551,7 +551,7 @@ public class Array2DRowFieldMatrix<T extends FieldElement<T>> extends AbstractFi
|
|||
public T walkInColumnOrder(final FieldMatrixChangingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -569,7 +569,7 @@ public class Array2DRowFieldMatrix<T extends FieldElement<T>> extends AbstractFi
|
|||
public T walkInColumnOrder(final FieldMatrixPreservingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
checkSubMatrixIndex(startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.apache.commons.math.linear;
|
|||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
|
||||
/**
|
||||
|
@ -458,7 +458,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInRowOrder(final RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -474,7 +474,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInRowOrder(final RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -492,7 +492,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ
|
|||
public double walkInRowOrder(final RealMatrixChangingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -510,7 +510,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ
|
|||
public double walkInRowOrder(final RealMatrixPreservingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -526,7 +526,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInColumnOrder(final RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -542,7 +542,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -559,7 +559,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ
|
|||
public double walkInColumnOrder(final RealMatrixChangingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -577,7 +577,7 @@ public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializ
|
|||
public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.io.Serializable;
|
|||
import org.apache.commons.math.Field;
|
||||
import org.apache.commons.math.FieldElement;
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
|
@ -1430,7 +1430,7 @@ public class BlockFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMa
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
|
||||
final int pStart = iBlock * BLOCK_SIZE;
|
||||
|
@ -1455,7 +1455,7 @@ public class BlockFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMa
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T walkInRowOrder(final FieldMatrixPreservingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
|
||||
final int pStart = iBlock * BLOCK_SIZE;
|
||||
|
@ -1482,7 +1482,7 @@ public class BlockFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMa
|
|||
public T walkInRowOrder(final FieldMatrixChangingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
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) {
|
||||
|
@ -1512,7 +1512,7 @@ public class BlockFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMa
|
|||
public T walkInRowOrder(final FieldMatrixPreservingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
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) {
|
||||
|
@ -1540,7 +1540,7 @@ public class BlockFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMa
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T walkInOptimizedOrder(final FieldMatrixChangingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
int blockIndex = 0;
|
||||
for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
|
||||
|
@ -1566,7 +1566,7 @@ public class BlockFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMa
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T walkInOptimizedOrder(final FieldMatrixPreservingVisitor<T> visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
int blockIndex = 0;
|
||||
for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
|
||||
|
@ -1594,7 +1594,7 @@ public class BlockFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMa
|
|||
public T walkInOptimizedOrder(final FieldMatrixChangingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
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) {
|
||||
|
@ -1624,7 +1624,7 @@ public class BlockFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMa
|
|||
public T walkInOptimizedOrder(final FieldMatrixPreservingVisitor<T> visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
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) {
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.io.Serializable;
|
|||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
|
@ -1450,7 +1450,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInRowOrder(final RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
|
||||
final int pStart = iBlock * BLOCK_SIZE;
|
||||
|
@ -1475,7 +1475,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInRowOrder(final RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
|
||||
final int pStart = iBlock * BLOCK_SIZE;
|
||||
|
@ -1502,7 +1502,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable
|
|||
public double walkInRowOrder(final RealMatrixChangingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
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) {
|
||||
|
@ -1532,7 +1532,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable
|
|||
public double walkInRowOrder(final RealMatrixPreservingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
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) {
|
||||
|
@ -1560,7 +1560,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
int blockIndex = 0;
|
||||
for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
|
||||
|
@ -1586,7 +1586,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
int blockIndex = 0;
|
||||
for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
|
||||
|
@ -1614,7 +1614,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable
|
|||
public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
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) {
|
||||
|
@ -1644,7 +1644,7 @@ public class BlockRealMatrix extends AbstractRealMatrix implements Serializable
|
|||
public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
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) {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package org.apache.commons.math.linear;
|
||||
|
||||
import org.apache.commons.math.FieldElement;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Default implementation of the {@link FieldMatrixChangingVisitor} interface.
|
||||
|
@ -50,7 +50,7 @@ public class DefaultFieldMatrixChangingVisitor<T extends FieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public T visit(int row, int column, T value) throws MathUserException {
|
||||
public T visit(int row, int column, T value) throws MatrixVisitorException {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package org.apache.commons.math.linear;
|
||||
|
||||
import org.apache.commons.math.FieldElement;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Default implementation of the {@link FieldMatrixPreservingVisitor} interface.
|
||||
|
@ -51,7 +51,7 @@ public class DefaultFieldMatrixPreservingVisitor<T extends FieldElement<T>>
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public void visit(int row, int column, T value)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.linear;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Default implementation of the {@link RealMatrixChangingVisitor} interface.
|
||||
|
@ -37,7 +37,7 @@ public class DefaultRealMatrixChangingVisitor implements RealMatrixChangingVisit
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public double visit(int row, int column, double value) throws MathUserException {
|
||||
public double visit(int row, int column, double value) throws MatrixVisitorException {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.linear;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Default implementation of the {@link RealMatrixPreservingVisitor} interface.
|
||||
|
@ -38,7 +38,7 @@ public class DefaultRealMatrixPreservingVisitor implements RealMatrixPreservingV
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public void visit(int row, int column, double value)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.apache.commons.math.linear;
|
|||
|
||||
import org.apache.commons.math.Field;
|
||||
import org.apache.commons.math.FieldElement;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Interface defining field-valued matrix with basic algebraic operations.
|
||||
|
@ -481,7 +481,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* of a row from left to right before going to the leftmost element
|
||||
* of the next row.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int)
|
||||
|
@ -497,7 +497,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
T walkInRowOrder(FieldMatrixChangingVisitor<T> visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) all matrix entries in row order.
|
||||
|
@ -505,7 +505,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* of a row from left to right before going to the leftmost element
|
||||
* of the next row.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int)
|
||||
|
@ -521,7 +521,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
T walkInRowOrder(FieldMatrixPreservingVisitor<T> visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (and possibly change) some matrix entries in row order.
|
||||
|
@ -533,7 +533,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
|
@ -551,7 +551,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
*/
|
||||
T walkInRowOrder(FieldMatrixChangingVisitor<T> visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) some matrix entries in row order.
|
||||
|
@ -563,7 +563,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
|
@ -581,7 +581,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
*/
|
||||
T walkInRowOrder(FieldMatrixPreservingVisitor<T> visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (and possibly change) all matrix entries in column order.
|
||||
|
@ -589,7 +589,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* of a column from top to bottom before going to the topmost element
|
||||
* of the next column.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -605,7 +605,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
T walkInColumnOrder(FieldMatrixChangingVisitor<T> visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) all matrix entries in column order.
|
||||
|
@ -613,7 +613,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* of a column from top to bottom before going to the topmost element
|
||||
* of the next column.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -629,7 +629,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
T walkInColumnOrder(FieldMatrixPreservingVisitor<T> visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (and possibly change) some matrix entries in column order.
|
||||
|
@ -641,7 +641,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
|
@ -659,7 +659,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
*/
|
||||
T walkInColumnOrder(FieldMatrixChangingVisitor<T> visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) some matrix entries in column order.
|
||||
|
@ -671,7 +671,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
|
@ -689,14 +689,14 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
*/
|
||||
T walkInColumnOrder(FieldMatrixPreservingVisitor<T> visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (and possibly change) all matrix entries using the fastest possible order.
|
||||
* <p>The fastest walking order depends on the exact matrix class. It may be
|
||||
* different from traditional row or column orders.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -712,14 +712,14 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
T walkInOptimizedOrder(FieldMatrixChangingVisitor<T> visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) all matrix entries using the fastest possible order.
|
||||
* <p>The fastest walking order depends on the exact matrix class. It may be
|
||||
* different from traditional row or column orders.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -735,7 +735,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
T walkInOptimizedOrder(FieldMatrixPreservingVisitor<T> visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (and possibly change) some matrix entries using the fastest possible order.
|
||||
|
@ -746,7 +746,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index (inclusive)
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
|
@ -764,7 +764,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
*/
|
||||
T walkInOptimizedOrder(FieldMatrixChangingVisitor<T> visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) some matrix entries using the fastest possible order.
|
||||
|
@ -775,7 +775,7 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index (inclusive)
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
|
@ -793,6 +793,6 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
*/
|
||||
T walkInOptimizedOrder(FieldMatrixPreservingVisitor<T> visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package org.apache.commons.math.linear;
|
||||
|
||||
import org.apache.commons.math.FieldElement;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Interface defining a visitor for matrix entries.
|
||||
|
@ -48,10 +48,10 @@ public interface FieldMatrixChangingVisitor<T extends FieldElement<?>> {
|
|||
* @param column column index of the entry
|
||||
* @param value current value of the entry
|
||||
* @return the new value to be set for the entry
|
||||
* @throws MathUserException if something wrong occurs
|
||||
* @throws MatrixVisitorException if something wrong occurs
|
||||
*/
|
||||
T visit(int row, int column, T value)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* End visiting a matrix.
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package org.apache.commons.math.linear;
|
||||
|
||||
import org.apache.commons.math.FieldElement;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Interface defining a visitor for matrix entries.
|
||||
|
@ -47,10 +47,10 @@ public interface FieldMatrixPreservingVisitor<T extends FieldElement<?>> {
|
|||
* @param row row index of the entry
|
||||
* @param column column index of the entry
|
||||
* @param value current value of the entry
|
||||
* @throws MathUserException if something wrong occurs
|
||||
* @throws MatrixVisitorException if something wrong occurs
|
||||
*/
|
||||
void visit(int row, int column, T value)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* End visiting a matrix.
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.linear;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -526,7 +526,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* of a row from left to right before going to the leftmost element
|
||||
* of the next row.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int)
|
||||
|
@ -542,7 +542,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
double walkInRowOrder(RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) all matrix entries in row order.
|
||||
|
@ -550,7 +550,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* of a row from left to right before going to the leftmost element
|
||||
* of the next row.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int)
|
||||
|
@ -566,7 +566,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
double walkInRowOrder(RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (and possibly change) some matrix entries in row order.
|
||||
|
@ -578,7 +578,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
|
@ -596,7 +596,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
*/
|
||||
double walkInRowOrder(RealMatrixChangingVisitor visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) some matrix entries in row order.
|
||||
|
@ -608,7 +608,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
|
@ -626,7 +626,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
*/
|
||||
double walkInRowOrder(RealMatrixPreservingVisitor visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (and possibly change) all matrix entries in column order.
|
||||
|
@ -634,7 +634,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* of a column from top to bottom before going to the topmost element
|
||||
* of the next column.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -650,7 +650,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
double walkInColumnOrder(RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) all matrix entries in column order.
|
||||
|
@ -658,7 +658,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* of a column from top to bottom before going to the topmost element
|
||||
* of the next column.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -674,7 +674,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
double walkInColumnOrder(RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (and possibly change) some matrix entries in column order.
|
||||
|
@ -686,7 +686,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
|
@ -704,7 +704,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
*/
|
||||
double walkInColumnOrder(RealMatrixChangingVisitor visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) some matrix entries in column order.
|
||||
|
@ -716,7 +716,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
|
@ -734,14 +734,14 @@ public interface RealMatrix extends AnyMatrix {
|
|||
*/
|
||||
double walkInColumnOrder(RealMatrixPreservingVisitor visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (and possibly change) all matrix entries using the fastest possible order.
|
||||
* <p>The fastest walking order depends on the exact matrix class. It may be
|
||||
* different from traditional row or column orders.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -757,14 +757,14 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
double walkInOptimizedOrder(RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) all matrix entries using the fastest possible order.
|
||||
* <p>The fastest walking order depends on the exact matrix class. It may be
|
||||
* different from traditional row or column orders.</p>
|
||||
* @param visitor visitor used to process all matrix entries
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -780,7 +780,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* of the walk
|
||||
*/
|
||||
double walkInOptimizedOrder(RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (and possibly change) some matrix entries using the fastest possible order.
|
||||
|
@ -791,7 +791,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index (inclusive)
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
|
@ -809,7 +809,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
*/
|
||||
double walkInOptimizedOrder(RealMatrixChangingVisitor visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Visit (but don't change) some matrix entries using the fastest possible order.
|
||||
|
@ -820,7 +820,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index (inclusive)
|
||||
* @exception MathUserException if the visitor cannot process an entry
|
||||
* @exception MatrixVisitorException if the visitor cannot process an entry
|
||||
* @exception MatrixIndexException if the indices are not valid
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
|
@ -838,7 +838,7 @@ public interface RealMatrix extends AnyMatrix {
|
|||
*/
|
||||
double walkInOptimizedOrder(RealMatrixPreservingVisitor visitor,
|
||||
int startRow, int endRow, int startColumn, int endColumn)
|
||||
throws MatrixIndexException, MathUserException;
|
||||
throws MatrixIndexException, MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Returns the solution vector for a linear system with coefficient
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.linear;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Interface defining a visitor for matrix entries.
|
||||
|
@ -47,10 +47,10 @@ public interface RealMatrixChangingVisitor {
|
|||
* @param column column index of the entry
|
||||
* @param value current value of the entry
|
||||
* @return the new value to be set for the entry
|
||||
* @throws MathUserException if something wrong occurs
|
||||
* @throws MatrixVisitorException if something wrong occurs
|
||||
*/
|
||||
double visit(int row, int column, double value)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* End visiting a matrix.
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.apache.commons.math.linear;
|
|||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
|
||||
/**
|
||||
|
@ -466,7 +466,7 @@ public class RealMatrixImpl extends AbstractRealMatrix implements Serializable {
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInRowOrder(final RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -482,7 +482,7 @@ public class RealMatrixImpl extends AbstractRealMatrix implements Serializable {
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInRowOrder(final RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -500,7 +500,7 @@ public class RealMatrixImpl extends AbstractRealMatrix implements Serializable {
|
|||
public double walkInRowOrder(final RealMatrixChangingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -518,7 +518,7 @@ public class RealMatrixImpl extends AbstractRealMatrix implements Serializable {
|
|||
public double walkInRowOrder(final RealMatrixPreservingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -534,7 +534,7 @@ public class RealMatrixImpl extends AbstractRealMatrix implements Serializable {
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInColumnOrder(final RealMatrixChangingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -550,7 +550,7 @@ public class RealMatrixImpl extends AbstractRealMatrix implements Serializable {
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor)
|
||||
throws MathUserException {
|
||||
throws MatrixVisitorException {
|
||||
final int rows = getRowDimension();
|
||||
final int columns = getColumnDimension();
|
||||
visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
|
||||
|
@ -567,7 +567,7 @@ public class RealMatrixImpl extends AbstractRealMatrix implements Serializable {
|
|||
public double walkInColumnOrder(final RealMatrixChangingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
@ -585,7 +585,7 @@ public class RealMatrixImpl extends AbstractRealMatrix implements Serializable {
|
|||
public double walkInColumnOrder(final RealMatrixPreservingVisitor visitor,
|
||||
final int startRow, final int endRow,
|
||||
final int startColumn, final int endColumn)
|
||||
throws MatrixIndexException, MathUserException {
|
||||
throws MatrixIndexException, MatrixVisitorException {
|
||||
MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
|
||||
visitor.start(getRowDimension(), getColumnDimension(),
|
||||
startRow, endRow, startColumn, endColumn);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.linear;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* Interface defining a visitor for matrix entries.
|
||||
|
@ -46,10 +46,10 @@ public interface RealMatrixPreservingVisitor {
|
|||
* @param row row index of the entry
|
||||
* @param column column index of the entry
|
||||
* @param value current value of the entry
|
||||
* @throws MathUserException if something wrong occurs
|
||||
* @throws MatrixVisitorException if something wrong occurs
|
||||
*/
|
||||
void visit(int row, int column, double value)
|
||||
throws MathUserException;
|
||||
throws MatrixVisitorException;
|
||||
|
||||
/**
|
||||
* End visiting a matrix.
|
||||
|
|
|
@ -28,7 +28,6 @@ import java.util.TreeSet;
|
|||
|
||||
import org.apache.commons.math.ConvergenceException;
|
||||
import org.apache.commons.math.MaxEvaluationsExceededException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.ode.events.CombinedEventsManager;
|
||||
import org.apache.commons.math.ode.events.EventException;
|
||||
|
@ -200,13 +199,13 @@ public abstract class AbstractIntegrator implements FirstOrderIntegrator {
|
|||
* @param t current value of the independent <I>time</I> variable
|
||||
* @param y array containing the current value of the state vector
|
||||
* @param yDot placeholder array where to put the time derivative of the state vector
|
||||
* @throws MathUserException this user-defined exception should be used if an error is
|
||||
* @throws DerivativeException this user-defined exception should be used if an error is
|
||||
* is triggered by user code
|
||||
*/
|
||||
public void computeDerivatives(final double t, final double[] y, final double[] yDot)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
if (++evaluations > maxEvaluations) {
|
||||
throw new MathUserException(new MaxEvaluationsExceededException(maxEvaluations));
|
||||
throw new DerivativeException(new MaxEvaluationsExceededException(maxEvaluations));
|
||||
}
|
||||
equations.computeDerivatives(t, y, yDot);
|
||||
}
|
||||
|
@ -228,11 +227,13 @@ public abstract class AbstractIntegrator implements FirstOrderIntegrator {
|
|||
* @param yDot placeholder array where to put the time derivative of the state vector
|
||||
* @param tEnd final integration time
|
||||
* @return time at end of step
|
||||
* @throws DerivativeException this exception is propagated to the caller if
|
||||
* the underlying user function triggers one
|
||||
* @exception IntegratorException if the value of one event state cannot be evaluated
|
||||
*/
|
||||
protected double acceptStep(final AbstractStepInterpolator interpolator,
|
||||
final double[] y, final double[] yDot, final double tEnd)
|
||||
throws IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
try {
|
||||
double previousT = interpolator.getGlobalPreviousTime();
|
||||
|
@ -332,8 +333,8 @@ public abstract class AbstractIntegrator implements FirstOrderIntegrator {
|
|||
return currentT;
|
||||
} catch (EventException se) {
|
||||
final Throwable cause = se.getCause();
|
||||
if ((cause != null) && (cause instanceof MathUserException)) {
|
||||
throw (MathUserException) cause;
|
||||
if ((cause != null) && (cause instanceof DerivativeException)) {
|
||||
throw (DerivativeException) cause;
|
||||
}
|
||||
throw new IntegratorException(se);
|
||||
} catch (ConvergenceException ce) {
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.ode.sampling.StepHandler;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
|
@ -117,14 +117,14 @@ public class ContinuousOutputModel
|
|||
|
||||
/** Append another model at the end of the instance.
|
||||
* @param model model to add at the end of the instance
|
||||
* @exception MathUserException if user code called from step interpolator
|
||||
* @exception DerivativeException if user code called from step interpolator
|
||||
* finalization triggers one
|
||||
* @exception IllegalArgumentException if the model to append is not
|
||||
* compatible with the instance (dimension of the state vector,
|
||||
* propagation direction, hole between the dates)
|
||||
*/
|
||||
public void append(final ContinuousOutputModel model)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
if (model.steps.size() == 0) {
|
||||
return;
|
||||
|
@ -194,11 +194,11 @@ public class ContinuousOutputModel
|
|||
* the instance for later use.
|
||||
* @param interpolator interpolator for the last accepted step.
|
||||
* @param isLast true if the step is the last one
|
||||
* @exception MathUserException if user code called from step interpolator
|
||||
* @exception DerivativeException if user code called from step interpolator
|
||||
* finalization triggers one
|
||||
*/
|
||||
public void handleStep(final StepInterpolator interpolator, final boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
if (steps.size() == 0) {
|
||||
initialTime = interpolator.getPreviousTime();
|
||||
|
@ -343,10 +343,10 @@ public class ContinuousOutputModel
|
|||
/**
|
||||
* Get the state vector of the interpolated point.
|
||||
* @return state vector at time {@link #getInterpolatedTime}
|
||||
* @exception MathUserException if user code called from step interpolator
|
||||
* @exception DerivativeException if user code called from step interpolator
|
||||
* finalization triggers one
|
||||
*/
|
||||
public double[] getInterpolatedState() throws MathUserException {
|
||||
public double[] getInterpolatedState() throws DerivativeException {
|
||||
return steps.get(index).getInterpolatedState();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
|
||||
/** This class converts second order differential equations to first
|
||||
* order ones.
|
||||
|
@ -97,11 +97,11 @@ public class FirstOrderConverter implements FirstOrderDifferentialEquations {
|
|||
* @param t current value of the independent <I>time</I> variable
|
||||
* @param y array containing the current value of the state vector
|
||||
* @param yDot placeholder array where to put the time derivative of the state vector
|
||||
* @throws MathUserException this exception is propagated to the caller if the
|
||||
* @throws DerivativeException this exception is propagated to the caller if the
|
||||
* underlying user function triggers one
|
||||
*/
|
||||
public void computeDerivatives(final double t, final double[] y, final double[] yDot)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
// split the state vector in two
|
||||
System.arraycopy(y, 0, z, 0, dimension);
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package org.apache.commons.math.ode;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
|
||||
|
||||
/** This interface represents a first order differential equations set.
|
||||
|
@ -58,10 +57,10 @@ public interface FirstOrderDifferentialEquations {
|
|||
* @param t current value of the independent <I>time</I> variable
|
||||
* @param y array containing the current value of the state vector
|
||||
* @param yDot placeholder array where to put the time derivative of the state vector
|
||||
* @throws MathUserException this user-defined exception should be used if an error is
|
||||
* @throws DerivativeException this user-defined exception should be used if an error is
|
||||
* is triggered by user code
|
||||
*/
|
||||
void computeDerivatives(double t, double[] y, double[] yDot)
|
||||
throws MathUserException;
|
||||
throws DerivativeException;
|
||||
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package org.apache.commons.math.ode;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
|
||||
/** This interface represents a first order integrator for
|
||||
* differential equations.
|
||||
|
@ -51,12 +50,12 @@ public interface FirstOrderIntegrator extends ODEIntegrator {
|
|||
* @return stop time, will be the same as target time if integration reached its
|
||||
* target, but may be different if some {@link
|
||||
* org.apache.commons.math.ode.events.EventHandler} stops it at some point.
|
||||
* @throws IntegratorException if the integrator cannot perform integration
|
||||
* @throws MathUserException this exception is propagated to the caller if
|
||||
* @throws DerivativeException this exception is propagated to the caller if
|
||||
* the underlying user function triggers one
|
||||
* @throws IntegratorException if the integrator cannot perform integration
|
||||
*/
|
||||
double integrate (FirstOrderDifferentialEquations equations,
|
||||
double t0, double[] y0,
|
||||
double t, double[] y) throws MathUserException, IntegratorException;
|
||||
double t, double[] y) throws DerivativeException, IntegratorException;
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package org.apache.commons.math.ode;
|
||||
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.linear.Array2DRowRealMatrix;
|
||||
import org.apache.commons.math.linear.RealMatrix;
|
||||
|
@ -206,11 +206,11 @@ public abstract class MultistepIntegrator extends AdaptiveStepsizeIntegrator {
|
|||
* @param t target time for the integration
|
||||
* (can be set to a value smaller than <code>t0</code> for backward integration)
|
||||
* @throws IntegratorException if the integrator cannot perform integration
|
||||
* @throws MathUserException this exception is propagated to the caller if
|
||||
* @throws DerivativeException this exception is propagated to the caller if
|
||||
* the underlying user function triggers one
|
||||
*/
|
||||
protected void start(final double t0, final double[] y0, final double t)
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
// make sure NO user event nor user step handler is triggered,
|
||||
// this is the task of the top level integrator, not the task
|
||||
|
@ -225,7 +225,7 @@ public abstract class MultistepIntegrator extends AdaptiveStepsizeIntegrator {
|
|||
try {
|
||||
starter.integrate(new CountingDifferentialEquations(y0.length),
|
||||
t0, y0, t, new double[y0.length]);
|
||||
} catch (MathUserException mue) {
|
||||
} catch (DerivativeException mue) {
|
||||
if (!(mue instanceof InitializationCompletedMarkerException)) {
|
||||
// this is not the expected nominal interruption of the start integrator
|
||||
throw mue;
|
||||
|
@ -322,7 +322,7 @@ public abstract class MultistepIntegrator extends AdaptiveStepsizeIntegrator {
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public void handleStep(StepInterpolator interpolator, boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
final double prev = interpolator.getPreviousTime();
|
||||
final double curr = interpolator.getCurrentTime();
|
||||
|
@ -367,7 +367,7 @@ public abstract class MultistepIntegrator extends AdaptiveStepsizeIntegrator {
|
|||
|
||||
/** Marker exception used ONLY to stop the starter integrator after first step. */
|
||||
private static class InitializationCompletedMarkerException
|
||||
extends MathUserException {
|
||||
extends DerivativeException {
|
||||
|
||||
/** Serializable version identifier. */
|
||||
private static final long serialVersionUID = -4105805787353488365L;
|
||||
|
@ -394,7 +394,7 @@ public abstract class MultistepIntegrator extends AdaptiveStepsizeIntegrator {
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public void computeDerivatives(double t, double[] y, double[] dot)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
MultistepIntegrator.this.computeDerivatives(t, y, dot);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
|
||||
/** This interface represents a second order differential equations set.
|
||||
|
||||
|
@ -60,10 +60,10 @@ public interface SecondOrderDifferentialEquations {
|
|||
* of the state vector
|
||||
* @param yDDot placeholder array where to put the second time derivative
|
||||
* of the state vector
|
||||
* @throws MathUserException this user-defined exception should be used if an error is
|
||||
* @throws DerivativeException this user-defined exception should be used if an error is
|
||||
* is triggered by user code
|
||||
*/
|
||||
void computeSecondDerivatives(double t, double[] y, double[] yDot, double[] yDDot)
|
||||
throws MathUserException;
|
||||
throws DerivativeException;
|
||||
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
|
||||
|
||||
/** This interface represents a second order integrator for
|
||||
|
@ -49,12 +49,12 @@ public interface SecondOrderIntegrator extends ODEIntegrator {
|
|||
* @param yDot placeholder where to put the first derivative of
|
||||
* the state vector at time t, can be the same object as yDot0
|
||||
* @throws IntegratorException if the integrator cannot perform integration
|
||||
* @throws MathUserException this exception is propagated to the caller if the
|
||||
* @throws DerivativeException this exception is propagated to the caller if the
|
||||
* underlying user function triggers one
|
||||
*/
|
||||
void integrate(SecondOrderDifferentialEquations equations,
|
||||
double t0, double[] y0, double[] yDot0,
|
||||
double t, double[] y, double[] yDot)
|
||||
throws MathUserException, IntegratorException;
|
||||
throws DerivativeException, IntegratorException;
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
|
||||
import org.apache.commons.math.ConvergenceException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
|
||||
|
@ -116,12 +116,12 @@ public class CombinedEventsManager {
|
|||
* @return true if at least one event handler triggers an event
|
||||
* before the end of the proposed step (this implies the step should
|
||||
* be rejected)
|
||||
* @exception MathUserException if the interpolator fails to
|
||||
* @exception DerivativeException if the interpolator fails to
|
||||
* compute the function somewhere within the step
|
||||
* @exception IntegratorException if an event cannot be located
|
||||
*/
|
||||
public boolean evaluateStep(final StepInterpolator interpolator)
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
try {
|
||||
|
||||
|
@ -169,8 +169,8 @@ public class CombinedEventsManager {
|
|||
|
||||
} catch (EventException se) {
|
||||
final Throwable cause = se.getCause();
|
||||
if ((cause != null) && (cause instanceof MathUserException)) {
|
||||
throw (MathUserException) cause;
|
||||
if ((cause != null) && (cause instanceof DerivativeException)) {
|
||||
throw (DerivativeException) cause;
|
||||
}
|
||||
throw new IntegratorException(se);
|
||||
} catch (ConvergenceException ce) {
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.apache.commons.math.FunctionEvaluationException;
|
|||
import org.apache.commons.math.analysis.UnivariateRealFunction;
|
||||
import org.apache.commons.math.analysis.solvers.BrentSolver;
|
||||
import org.apache.commons.math.exception.MathInternalError;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
|
@ -180,7 +180,7 @@ public class EventState {
|
|||
g0Positive = g0 >= 0;
|
||||
}
|
||||
|
||||
} catch (MathUserException mue) {
|
||||
} catch (DerivativeException mue) {
|
||||
throw new EventException(mue);
|
||||
}
|
||||
}
|
||||
|
@ -189,14 +189,14 @@ public class EventState {
|
|||
* @param interpolator step interpolator for the proposed step
|
||||
* @return true if the event handler triggers an event before
|
||||
* the end of the proposed step
|
||||
* @exception MathUserException if the interpolator fails to
|
||||
* @exception DerivativeException if the interpolator fails to
|
||||
* compute the switching function somewhere within the step
|
||||
* @exception EventException if the switching function
|
||||
* cannot be evaluated
|
||||
* @exception ConvergenceException if an event cannot be located
|
||||
*/
|
||||
public boolean evaluateStep(final StepInterpolator interpolator)
|
||||
throws MathUserException, EventException, ConvergenceException {
|
||||
throws DerivativeException, EventException, ConvergenceException {
|
||||
|
||||
try {
|
||||
|
||||
|
@ -228,12 +228,14 @@ public class EventState {
|
|||
increasing = gb >= ga;
|
||||
|
||||
final UnivariateRealFunction f = new UnivariateRealFunction() {
|
||||
public double value(final double t) throws MathUserException {
|
||||
public double value(final double t) {
|
||||
try {
|
||||
interpolator.setInterpolatedTime(t);
|
||||
return handler.g(t, interpolator.getInterpolatedState());
|
||||
} catch (DerivativeException e) {
|
||||
throw new EmbeddedDerivativeException(e);
|
||||
} catch (EventException e) {
|
||||
throw new MathUserException(e);
|
||||
throw new EmbeddedEventException(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -253,7 +255,7 @@ public class EventState {
|
|||
try {
|
||||
ga = f.value(ta);
|
||||
} catch (FunctionEvaluationException ex) {
|
||||
throw new MathUserException(ex);
|
||||
throw new DerivativeException(ex);
|
||||
}
|
||||
}
|
||||
if (ga * gb > 0) {
|
||||
|
@ -268,7 +270,7 @@ public class EventState {
|
|||
solver.solve(maxIterationCount, f, ta, tb) :
|
||||
solver.solve(maxIterationCount, f, tb, ta);
|
||||
} catch (FunctionEvaluationException ex) {
|
||||
throw new MathUserException(ex);
|
||||
throw new DerivativeException(ex);
|
||||
}
|
||||
|
||||
if ((!Double.isNaN(previousEventTime)) &&
|
||||
|
@ -301,12 +303,10 @@ public class EventState {
|
|||
pendingEventTime = Double.NaN;
|
||||
return false;
|
||||
|
||||
} catch (MathUserException mue) {
|
||||
final Throwable cause = mue.getCause();
|
||||
if ((cause != null) && (cause instanceof EventException)) {
|
||||
throw (EventException) cause;
|
||||
}
|
||||
throw mue;
|
||||
} catch (EmbeddedDerivativeException ede) {
|
||||
throw ede.getDerivativeException();
|
||||
} catch (EmbeddedEventException eee) {
|
||||
throw eee.getEventException();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -379,4 +379,53 @@ public class EventState {
|
|||
|
||||
}
|
||||
|
||||
/** Local exception for embedding DerivativeException. */
|
||||
private static class EmbeddedDerivativeException extends RuntimeException {
|
||||
|
||||
/** Serializable UID. */
|
||||
private static final long serialVersionUID = 3574188382434584610L;
|
||||
|
||||
/** Embedded exception. */
|
||||
private final DerivativeException derivativeException;
|
||||
|
||||
/** Simple constructor.
|
||||
* @param derivativeException embedded exception
|
||||
*/
|
||||
public EmbeddedDerivativeException(final DerivativeException derivativeException) {
|
||||
this.derivativeException = derivativeException;
|
||||
}
|
||||
|
||||
/** Get the embedded exception.
|
||||
* @return embedded exception
|
||||
*/
|
||||
public DerivativeException getDerivativeException() {
|
||||
return derivativeException;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Local exception for embedding EventException. */
|
||||
private static class EmbeddedEventException extends RuntimeException {
|
||||
|
||||
/** Serializable UID. */
|
||||
private static final long serialVersionUID = -1337749250090455474L;
|
||||
|
||||
/** Embedded exception. */
|
||||
private final EventException eventException;
|
||||
|
||||
/** Simple constructor.
|
||||
* @param eventException embedded exception
|
||||
*/
|
||||
public EmbeddedEventException(final EventException eventException) {
|
||||
this.eventException = eventException;
|
||||
}
|
||||
|
||||
/** Get the embedded exception.
|
||||
* @return embedded exception
|
||||
*/
|
||||
public EventException getEventException() {
|
||||
return eventException;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.util.Collection;
|
|||
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.MaxEvaluationsExceededException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.ode.ExtendedFirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
|
@ -209,13 +209,13 @@ public class FirstOrderIntegratorWithJacobians {
|
|||
* @return stop time, will be the same as target time if integration reached its
|
||||
* target, but may be different if some event handler stops it at some point.
|
||||
* @throws IntegratorException if the integrator cannot perform integration
|
||||
* @throws MathUserException this exception is propagated to the caller if
|
||||
* @throws DerivativeException this exception is propagated to the caller if
|
||||
* the underlying user function triggers one
|
||||
*/
|
||||
public double integrate(final double t0, final double[] y0, final double[][] dY0dP,
|
||||
final double t, final double[] y,
|
||||
final double[][] dYdY0, final double[][] dYdP)
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final int n = ode.getDimension();
|
||||
final int k = ode.getParametersDimension();
|
||||
|
@ -398,7 +398,7 @@ public class FirstOrderIntegratorWithJacobians {
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public void computeDerivatives(final double t, final double[] z, final double[] zDot)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
final int n = y.length;
|
||||
final int k = dFdP[0].length;
|
||||
|
@ -406,7 +406,7 @@ public class FirstOrderIntegratorWithJacobians {
|
|||
// compute raw ODE and its jacobians: dy/dt, d[dy/dt]/dy0 and d[dy/dt]/dp
|
||||
System.arraycopy(z, 0, y, 0, n);
|
||||
if (++evaluations > maxEvaluations) {
|
||||
throw new MathUserException(new MaxEvaluationsExceededException(maxEvaluations));
|
||||
throw new DerivativeException(new MaxEvaluationsExceededException(maxEvaluations));
|
||||
}
|
||||
ode.computeDerivatives(t, y, yDot);
|
||||
ode.computeJacobians(t, y, yDot, dFdY, dFdP);
|
||||
|
@ -488,7 +488,7 @@ public class FirstOrderIntegratorWithJacobians {
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public void computeDerivatives(double t, double[] y, double[] yDot) throws MathUserException {
|
||||
public void computeDerivatives(double t, double[] y, double[] yDot) throws DerivativeException {
|
||||
// this call to computeDerivatives has already been counted,
|
||||
// we must not increment the counter again
|
||||
ode.computeDerivatives(t, y, yDot);
|
||||
|
@ -502,14 +502,14 @@ public class FirstOrderIntegratorWithJacobians {
|
|||
/** {@inheritDoc} */
|
||||
public void computeJacobians(double t, double[] y, double[] yDot,
|
||||
double[][] dFdY, double[][] dFdP)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
final int n = hY.length;
|
||||
final int k = hP.length;
|
||||
|
||||
evaluations += n + k;
|
||||
if (evaluations > maxEvaluations) {
|
||||
throw new MathUserException(new MaxEvaluationsExceededException(maxEvaluations));
|
||||
throw new DerivativeException(new MaxEvaluationsExceededException(maxEvaluations));
|
||||
}
|
||||
|
||||
// compute df/dy where f is the ODE and y is the state array
|
||||
|
@ -570,7 +570,7 @@ public class FirstOrderIntegratorWithJacobians {
|
|||
|
||||
/** {@inheritDoc} */
|
||||
public void handleStep(StepInterpolator interpolator, boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
handler.handleStep(new StepInterpolatorWrapper(interpolator, n, k), isLast);
|
||||
}
|
||||
|
||||
|
@ -655,14 +655,14 @@ public class FirstOrderIntegratorWithJacobians {
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public double[] getInterpolatedY() throws MathUserException {
|
||||
public double[] getInterpolatedY() throws DerivativeException {
|
||||
double[] extendedState = interpolator.getInterpolatedState();
|
||||
System.arraycopy(extendedState, 0, y, 0, y.length);
|
||||
return y;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public double[][] getInterpolatedDyDy0() throws MathUserException {
|
||||
public double[][] getInterpolatedDyDy0() throws DerivativeException {
|
||||
double[] extendedState = interpolator.getInterpolatedState();
|
||||
final int n = y.length;
|
||||
int start = n;
|
||||
|
@ -674,7 +674,7 @@ public class FirstOrderIntegratorWithJacobians {
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public double[][] getInterpolatedDyDp() throws MathUserException {
|
||||
public double[][] getInterpolatedDyDp() throws DerivativeException {
|
||||
double[] extendedState = interpolator.getInterpolatedState();
|
||||
final int n = y.length;
|
||||
final int k = dydp[0].length;
|
||||
|
@ -687,14 +687,14 @@ public class FirstOrderIntegratorWithJacobians {
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public double[] getInterpolatedYDot() throws MathUserException {
|
||||
public double[] getInterpolatedYDot() throws DerivativeException {
|
||||
double[] extendedDerivatives = interpolator.getInterpolatedDerivatives();
|
||||
System.arraycopy(extendedDerivatives, 0, yDot, 0, yDot.length);
|
||||
return yDot;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public double[][] getInterpolatedDyDy0Dot() throws MathUserException {
|
||||
public double[][] getInterpolatedDyDy0Dot() throws DerivativeException {
|
||||
double[] extendedDerivatives = interpolator.getInterpolatedDerivatives();
|
||||
final int n = y.length;
|
||||
int start = n;
|
||||
|
@ -706,7 +706,7 @@ public class FirstOrderIntegratorWithJacobians {
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public double[][] getInterpolatedDyDpDot() throws MathUserException {
|
||||
public double[][] getInterpolatedDyDpDot() throws DerivativeException {
|
||||
double[] extendedDerivatives = interpolator.getInterpolatedDerivatives();
|
||||
final int n = y.length;
|
||||
final int k = dydpDot[0].length;
|
||||
|
@ -724,7 +724,7 @@ public class FirstOrderIntegratorWithJacobians {
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public StepInterpolatorWithJacobians copy() throws MathUserException {
|
||||
public StepInterpolatorWithJacobians copy() throws DerivativeException {
|
||||
final int n = y.length;
|
||||
final int k = dydp[0].length;
|
||||
StepInterpolatorWrapper copied =
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.jacobians;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
|
||||
|
||||
|
@ -45,10 +45,10 @@ public interface ODEWithJacobians extends FirstOrderDifferentialEquations {
|
|||
* @param yDot array containing the current value of the time derivative of the state vector
|
||||
* @param dFdY placeholder array where to put the jacobian of the ODE with respect to the state vector
|
||||
* @param dFdP placeholder array where to put the jacobian of the ODE with respect to the parameters
|
||||
* @throws MathUserException this exception is propagated to the caller if the
|
||||
* @throws DerivativeException this exception is propagated to the caller if the
|
||||
* underlying user function triggers one
|
||||
*/
|
||||
void computeJacobians(double t, double[] y, double[] yDot, double[][] dFdY, double[][] dFdP)
|
||||
throws MathUserException;
|
||||
throws DerivativeException;
|
||||
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.jacobians;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
|
||||
/**
|
||||
* This interface represents a handler that should be called after
|
||||
|
@ -89,9 +89,9 @@ public interface StepHandlerWithJacobians {
|
|||
* Keeping only a reference to the interpolator and reusing it will
|
||||
* result in unpredictable behavior (potentially crashing the application).
|
||||
* @param isLast true if the step is the last one
|
||||
* @throws MathUserException this exception is propagated to the
|
||||
* @throws DerivativeException this exception is propagated to the
|
||||
* caller if the underlying user function triggers one
|
||||
*/
|
||||
void handleStep(StepInterpolatorWithJacobians interpolator, boolean isLast) throws MathUserException;
|
||||
void handleStep(StepInterpolatorWithJacobians interpolator, boolean isLast) throws DerivativeException;
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.ode.jacobians;
|
|||
|
||||
import java.io.Externalizable;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
|
||||
/** This interface represents an interpolator over the last step
|
||||
* during an ODE integration.
|
||||
|
@ -90,10 +90,10 @@ public interface StepInterpolatorWithJacobians extends Externalizable {
|
|||
* to be preserved across several calls.</p>
|
||||
* @return state vector at time {@link #getInterpolatedTime}
|
||||
* @see #getInterpolatedYDot()
|
||||
* @throws MathUserException if this call induces an automatic
|
||||
* @throws DerivativeException if this call induces an automatic
|
||||
* step finalization that throws one
|
||||
*/
|
||||
double[] getInterpolatedY() throws MathUserException;
|
||||
double[] getInterpolatedY() throws DerivativeException;
|
||||
|
||||
/**
|
||||
* Get the partial derivatives of the state vector with respect to
|
||||
|
@ -104,10 +104,10 @@ public interface StepInterpolatorWithJacobians extends Externalizable {
|
|||
* @return partial derivatives of the state vector with respect to
|
||||
* the initial state at time {@link #getInterpolatedTime}
|
||||
* @see #getInterpolatedY()
|
||||
* @throws MathUserException if this call induces an automatic
|
||||
* @throws DerivativeException if this call induces an automatic
|
||||
* step finalization that throws one
|
||||
*/
|
||||
double[][] getInterpolatedDyDy0() throws MathUserException;
|
||||
double[][] getInterpolatedDyDy0() throws DerivativeException;
|
||||
|
||||
/**
|
||||
* Get the partial derivatives of the state vector with respect to
|
||||
|
@ -118,10 +118,10 @@ public interface StepInterpolatorWithJacobians extends Externalizable {
|
|||
* @return partial derivatives of the state vector with respect to
|
||||
* the ODE parameters at time {@link #getInterpolatedTime}
|
||||
* @see #getInterpolatedY()
|
||||
* @throws MathUserException if this call induces an automatic
|
||||
* @throws DerivativeException if this call induces an automatic
|
||||
* step finalization that throws one
|
||||
*/
|
||||
double[][] getInterpolatedDyDp() throws MathUserException;
|
||||
double[][] getInterpolatedDyDp() throws DerivativeException;
|
||||
|
||||
/**
|
||||
* Get the time derivatives of the state vector of the interpolated point.
|
||||
|
@ -130,10 +130,10 @@ public interface StepInterpolatorWithJacobians extends Externalizable {
|
|||
* to be preserved across several calls.</p>
|
||||
* @return derivatives of the state vector at time {@link #getInterpolatedTime}
|
||||
* @see #getInterpolatedY()
|
||||
* @throws MathUserException if this call induces an automatic
|
||||
* @throws DerivativeException if this call induces an automatic
|
||||
* step finalization that throws one
|
||||
*/
|
||||
double[] getInterpolatedYDot() throws MathUserException;
|
||||
double[] getInterpolatedYDot() throws DerivativeException;
|
||||
|
||||
/**
|
||||
* Get the time derivatives of the jacobian of the state vector
|
||||
|
@ -144,10 +144,10 @@ public interface StepInterpolatorWithJacobians extends Externalizable {
|
|||
* @return time derivatives of the jacobian of the state vector
|
||||
* with respect to the initial state at time {@link #getInterpolatedTime}
|
||||
* @see #getInterpolatedY()
|
||||
* @throws MathUserException if this call induces an automatic
|
||||
* @throws DerivativeException if this call induces an automatic
|
||||
* step finalization that throws one
|
||||
*/
|
||||
double[][] getInterpolatedDyDy0Dot() throws MathUserException;
|
||||
double[][] getInterpolatedDyDy0Dot() throws DerivativeException;
|
||||
|
||||
/**
|
||||
* Get the time derivatives of the jacobian of the state vector
|
||||
|
@ -158,10 +158,10 @@ public interface StepInterpolatorWithJacobians extends Externalizable {
|
|||
* @return time derivatives of the jacobian of the state vector
|
||||
* with respect to the ODE parameters at time {@link #getInterpolatedTime}
|
||||
* @see #getInterpolatedY()
|
||||
* @throws MathUserException if this call induces an automatic
|
||||
* @throws DerivativeException if this call induces an automatic
|
||||
* step finalization that throws one
|
||||
*/
|
||||
double[][] getInterpolatedDyDpDot() throws MathUserException;
|
||||
double[][] getInterpolatedDyDpDot() throws DerivativeException;
|
||||
|
||||
/** Check if the natural integration direction is forward.
|
||||
* <p>This method provides the integration direction as specified by
|
||||
|
@ -179,10 +179,10 @@ public interface StepInterpolatorWithJacobians extends Externalizable {
|
|||
* original one. Both can be used with different settings for
|
||||
* interpolated time without any side effect.</p>
|
||||
* @return a deep copy of the instance, which can be used independently.
|
||||
* @throws MathUserException if this call induces an automatic
|
||||
* @throws DerivativeException if this call induces an automatic
|
||||
* step finalization that throws one
|
||||
* @see #setInterpolatedTime(double)
|
||||
*/
|
||||
StepInterpolatorWithJacobians copy() throws MathUserException;
|
||||
StepInterpolatorWithJacobians copy() throws DerivativeException;
|
||||
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.Array2DRowRealMatrix;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.sampling.NordsieckStepInterpolator;
|
||||
|
@ -188,7 +188,7 @@ public class AdamsBashforthIntegrator extends AdamsIntegrator {
|
|||
public double integrate(final FirstOrderDifferentialEquations equations,
|
||||
final double t0, final double[] y0,
|
||||
final double t, final double[] y)
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final int n = y0.length;
|
||||
sanityChecks(equations, t0, y0, t, y);
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.Array2DRowRealMatrix;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.MultistepIntegrator;
|
||||
|
@ -85,7 +85,7 @@ public abstract class AdamsIntegrator extends MultistepIntegrator {
|
|||
public abstract double integrate(final FirstOrderDifferentialEquations equations,
|
||||
final double t0, final double[] y0,
|
||||
final double t, final double[] y)
|
||||
throws MathUserException, IntegratorException;
|
||||
throws DerivativeException, IntegratorException;
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
|
|
|
@ -19,9 +19,9 @@ package org.apache.commons.math.ode.nonstiff;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.Array2DRowRealMatrix;
|
||||
import org.apache.commons.math.linear.RealMatrixPreservingVisitor;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.sampling.NordsieckStepInterpolator;
|
||||
|
@ -205,7 +205,7 @@ public class AdamsMoultonIntegrator extends AdamsIntegrator {
|
|||
public double integrate(final FirstOrderDifferentialEquations equations,
|
||||
final double t0, final double[] y0,
|
||||
final double t, final double[] y)
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final int n = y0.length;
|
||||
sanityChecks(equations, t0, y0, t, y);
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.ode.AbstractIntegrator;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ExtendedFirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
|
@ -213,14 +213,14 @@ public abstract class AdaptiveStepsizeIntegrator
|
|||
* @param y1 work array for a state vector
|
||||
* @param yDot1 work array for the first time derivative of y1
|
||||
* @return first integration step
|
||||
* @exception MathUserException this exception is propagated to
|
||||
* @exception DerivativeException this exception is propagated to
|
||||
* the caller if the underlying user function triggers one
|
||||
*/
|
||||
public double initializeStep(final FirstOrderDifferentialEquations equations,
|
||||
final boolean forward, final int order, final double[] scale,
|
||||
final double t0, final double[] y0, final double[] yDot0,
|
||||
final double[] y1, final double[] yDot1)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
if (initialStep > 0) {
|
||||
// use the user provided value
|
||||
|
@ -318,7 +318,7 @@ public abstract class AdaptiveStepsizeIntegrator
|
|||
public abstract double integrate (FirstOrderDifferentialEquations equations,
|
||||
double t0, double[] y0,
|
||||
double t, double[] y)
|
||||
throws MathUserException, IntegratorException;
|
||||
throws DerivativeException, IntegratorException;
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
|
||||
/**
|
||||
|
@ -83,7 +83,7 @@ class ClassicalRungeKuttaStepInterpolator
|
|||
@Override
|
||||
protected void computeInterpolatedStateAndDerivatives(final double theta,
|
||||
final double oneMinusThetaH)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
final double fourTheta = 4 * theta;
|
||||
final double oneMinusTheta = 1 - theta;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.AbstractIntegrator;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
|
||||
|
@ -166,7 +166,7 @@ class DormandPrince54StepInterpolator
|
|||
@Override
|
||||
protected void computeInterpolatedStateAndDerivatives(final double theta,
|
||||
final double oneMinusThetaH)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
if (! vectorsInitialized) {
|
||||
|
||||
|
|
|
@ -21,8 +21,8 @@ import java.io.IOException;
|
|||
import java.io.ObjectInput;
|
||||
import java.io.ObjectOutput;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.AbstractIntegrator;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
|
||||
/**
|
||||
|
@ -312,7 +312,7 @@ class DormandPrince853StepInterpolator
|
|||
@Override
|
||||
protected void computeInterpolatedStateAndDerivatives(final double theta,
|
||||
final double oneMinusThetaH)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
if (! vectorsInitialized) {
|
||||
|
||||
|
@ -386,7 +386,7 @@ class DormandPrince853StepInterpolator
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected void doFinalize()
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
if (currentState == null) {
|
||||
// we are finalizing an uninitialized instance
|
||||
|
@ -436,7 +436,7 @@ class DormandPrince853StepInterpolator
|
|||
try {
|
||||
// save the local attributes
|
||||
finalizeStep();
|
||||
} catch (MathUserException e) {
|
||||
} catch (DerivativeException e) {
|
||||
IOException ioe = new IOException(e.getLocalizedMessage());
|
||||
ioe.initCause(e);
|
||||
throw ioe;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.sampling.AbstractStepInterpolator;
|
||||
|
@ -192,7 +192,7 @@ public abstract class EmbeddedRungeKuttaIntegrator
|
|||
public double integrate(final FirstOrderDifferentialEquations equations,
|
||||
final double t0, final double[] y0,
|
||||
final double t, final double[] y)
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
sanityChecks(equations, t0, y0, t, y);
|
||||
setEquations(equations);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
|
||||
/**
|
||||
|
@ -79,7 +79,7 @@ class EulerStepInterpolator
|
|||
@Override
|
||||
protected void computeInterpolatedStateAndDerivatives(final double theta,
|
||||
final double oneMinusThetaH)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
for (int i = 0; i < interpolatedState.length; ++i) {
|
||||
interpolatedState[i] = currentState[i] - oneMinusThetaH * yDotK[0][i];
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
|
@ -91,7 +91,7 @@ class GillStepInterpolator
|
|||
@Override
|
||||
protected void computeInterpolatedStateAndDerivatives(final double theta,
|
||||
final double oneMinusThetaH)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
final double twoTheta = 2 * theta;
|
||||
final double fourTheta = 4 * theta;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.events.EventHandler;
|
||||
|
@ -453,14 +453,14 @@ public class GraggBulirschStoerIntegrator extends AdaptiveStepsizeIntegrator {
|
|||
* @param yTmp placeholder for one state vector
|
||||
* @return true if computation was done properly,
|
||||
* false if stability check failed before end of computation
|
||||
* @throws MathUserException this exception is propagated to the caller if the
|
||||
* @throws DerivativeException this exception is propagated to the caller if the
|
||||
* underlying user function triggers one
|
||||
*/
|
||||
private boolean tryStep(final double t0, final double[] y0, final double step, final int k,
|
||||
final double[] scale, final double[][] f,
|
||||
final double[] yMiddle, final double[] yEnd,
|
||||
final double[] yTmp)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
final int n = sequence[k];
|
||||
final double subStep = step / n;
|
||||
|
@ -549,7 +549,7 @@ public class GraggBulirschStoerIntegrator extends AdaptiveStepsizeIntegrator {
|
|||
@Override
|
||||
public double integrate(final FirstOrderDifferentialEquations equations,
|
||||
final double t0, final double[] y0, final double t, final double[] y)
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
sanityChecks(equations, t0, y0, t, y);
|
||||
setEquations(equations);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
|
||||
/**
|
||||
|
@ -71,7 +71,7 @@ class HighamHall54StepInterpolator
|
|||
@Override
|
||||
protected void computeInterpolatedStateAndDerivatives(final double theta,
|
||||
final double oneMinusThetaH)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
final double theta2 = theta * theta;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
|
||||
/**
|
||||
|
@ -81,7 +81,7 @@ class MidpointStepInterpolator
|
|||
@Override
|
||||
protected void computeInterpolatedStateAndDerivatives(final double theta,
|
||||
final double oneMinusThetaH)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
final double coeff1 = oneMinusThetaH * theta;
|
||||
final double coeff2 = oneMinusThetaH * (1.0 + theta);
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.AbstractIntegrator;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.sampling.AbstractStepInterpolator;
|
||||
|
@ -95,7 +95,7 @@ public abstract class RungeKuttaIntegrator extends AbstractIntegrator {
|
|||
public double integrate(final FirstOrderDifferentialEquations equations,
|
||||
final double t0, final double[] y0,
|
||||
final double t, final double[] y)
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
sanityChecks(equations, t0, y0, t, y);
|
||||
setEquations(equations);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
|
||||
/**
|
||||
|
@ -86,7 +86,7 @@ class ThreeEighthesStepInterpolator
|
|||
@Override
|
||||
protected void computeInterpolatedStateAndDerivatives(final double theta,
|
||||
final double oneMinusThetaH)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
final double fourTheta2 = 4 * theta * theta;
|
||||
final double s = oneMinusThetaH / 8.0;
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.io.IOException;
|
|||
import java.io.ObjectInput;
|
||||
import java.io.ObjectOutput;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
|
||||
/** This abstract class represents an interpolator over the last step
|
||||
* during an ODE integration.
|
||||
|
@ -197,7 +197,7 @@ public abstract class AbstractStepInterpolator
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public StepInterpolator copy() throws MathUserException {
|
||||
public StepInterpolator copy() throws DerivativeException {
|
||||
|
||||
// finalize the step before performing copy
|
||||
finalizeStep();
|
||||
|
@ -328,15 +328,15 @@ public abstract class AbstractStepInterpolator
|
|||
* (theta is zero at the previous time step and one at the current time step)
|
||||
* @param oneMinusThetaH time gap between the interpolated time and
|
||||
* the current time
|
||||
* @throws MathUserException this exception is propagated to the caller if the
|
||||
* @throws DerivativeException this exception is propagated to the caller if the
|
||||
* underlying user function triggers one
|
||||
*/
|
||||
protected abstract void computeInterpolatedStateAndDerivatives(double theta,
|
||||
double oneMinusThetaH)
|
||||
throws MathUserException;
|
||||
throws DerivativeException;
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public double[] getInterpolatedState() throws MathUserException {
|
||||
public double[] getInterpolatedState() throws DerivativeException {
|
||||
|
||||
// lazy evaluation of the state
|
||||
if (dirtyState) {
|
||||
|
@ -351,7 +351,7 @@ public abstract class AbstractStepInterpolator
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public double[] getInterpolatedDerivatives() throws MathUserException {
|
||||
public double[] getInterpolatedDerivatives() throws DerivativeException {
|
||||
|
||||
// lazy evaluation of the state
|
||||
if (dirtyState) {
|
||||
|
@ -403,11 +403,11 @@ public abstract class AbstractStepInterpolator
|
|||
* Therefore, subclasses are not allowed not reimplement it, they
|
||||
* should rather reimplement <code>doFinalize</code>.</p>
|
||||
*
|
||||
* @throws MathUserException this exception is propagated to the
|
||||
* @throws DerivativeException this exception is propagated to the
|
||||
* caller if the underlying user function triggers one
|
||||
*/
|
||||
public final void finalizeStep()
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
if (! finalized) {
|
||||
doFinalize();
|
||||
finalized = true;
|
||||
|
@ -417,11 +417,11 @@ public abstract class AbstractStepInterpolator
|
|||
/**
|
||||
* Really finalize the step.
|
||||
* The default implementation of this method does nothing.
|
||||
* @throws MathUserException this exception is propagated to the
|
||||
* @throws DerivativeException this exception is propagated to the
|
||||
* caller if the underlying user function triggers one
|
||||
*/
|
||||
protected void doFinalize()
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
@ -467,7 +467,7 @@ public abstract class AbstractStepInterpolator
|
|||
// finalize the step (and don't bother saving the now true flag)
|
||||
try {
|
||||
finalizeStep();
|
||||
} catch (MathUserException e) {
|
||||
} catch (DerivativeException e) {
|
||||
IOException ioe = new IOException(e.getLocalizedMessage());
|
||||
ioe.initCause(e);
|
||||
throw ioe;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.sampling;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
|
||||
/**
|
||||
* This interface represents a handler that should be called after
|
||||
|
@ -55,8 +55,8 @@ public interface FixedStepHandler {
|
|||
* provide at the end of the integration a complete array of all
|
||||
* steps), it should build a local copy store this copy.
|
||||
* @param isLast true if the step is the last one
|
||||
* @throws MathUserException if some error condition is encountered
|
||||
* @throws DerivativeException if some error condition is encountered
|
||||
*/
|
||||
void handleStep(double t, double[] y, double[] yDot, boolean isLast) throws MathUserException;
|
||||
void handleStep(double t, double[] y, double[] yDot, boolean isLast) throws DerivativeException;
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.io.ObjectInput;
|
|||
import java.io.ObjectOutput;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.linear.Array2DRowRealMatrix;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
|
@ -171,11 +171,11 @@ public class NordsieckStepInterpolator extends AbstractStepInterpolator {
|
|||
* to be preserved across several calls.</p>
|
||||
* @return state vector at time {@link #getInterpolatedTime}
|
||||
* @see #getInterpolatedDerivatives()
|
||||
* @throws MathUserException if this call induces an automatic
|
||||
* @throws DerivativeException if this call induces an automatic
|
||||
* step finalization that throws one
|
||||
*/
|
||||
public double[] getInterpolatedStateVariation()
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
// compute and ignore interpolated state
|
||||
// to make sure state variation is computed as a side effect
|
||||
getInterpolatedState();
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.sampling;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
|
||||
/**
|
||||
* This interface represents a handler that should be called after
|
||||
|
@ -70,9 +70,9 @@ public interface StepHandler {
|
|||
* Keeping only a reference to the interpolator and reusing it will
|
||||
* result in unpredictable behavior (potentially crashing the application).
|
||||
* @param isLast true if the step is the last one
|
||||
* @exception MathUserException if user code called from step interpolator
|
||||
* @exception DerivativeException if user code called from step interpolator
|
||||
* finalization triggers one
|
||||
*/
|
||||
void handleStep(StepInterpolator interpolator, boolean isLast) throws MathUserException;
|
||||
void handleStep(StepInterpolator interpolator, boolean isLast) throws DerivativeException;
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.ode.sampling;
|
|||
|
||||
import java.io.Externalizable;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
|
||||
/** This interface represents an interpolator over the last step
|
||||
* during an ODE integration.
|
||||
|
@ -89,10 +89,10 @@ public interface StepInterpolator extends Externalizable {
|
|||
* to be preserved across several calls.</p>
|
||||
* @return state vector at time {@link #getInterpolatedTime}
|
||||
* @see #getInterpolatedDerivatives()
|
||||
* @exception MathUserException if user code called from step interpolator
|
||||
* @exception DerivativeException if user code called from step interpolator
|
||||
* finalization triggers one
|
||||
*/
|
||||
double[] getInterpolatedState() throws MathUserException;
|
||||
double[] getInterpolatedState() throws DerivativeException;
|
||||
|
||||
/**
|
||||
* Get the derivatives of the state vector of the interpolated point.
|
||||
|
@ -101,11 +101,11 @@ public interface StepInterpolator extends Externalizable {
|
|||
* to be preserved across several calls.</p>
|
||||
* @return derivatives of the state vector at time {@link #getInterpolatedTime}
|
||||
* @see #getInterpolatedState()
|
||||
* @exception MathUserException if user code called from step interpolator
|
||||
* @exception DerivativeException if user code called from step interpolator
|
||||
* finalization triggers one
|
||||
* @since 2.0
|
||||
*/
|
||||
double[] getInterpolatedDerivatives() throws MathUserException;
|
||||
double[] getInterpolatedDerivatives() throws DerivativeException;
|
||||
|
||||
/** Check if the natural integration direction is forward.
|
||||
* <p>This method provides the integration direction as specified by
|
||||
|
@ -123,10 +123,10 @@ public interface StepInterpolator extends Externalizable {
|
|||
* original one. Both can be used with different settings for
|
||||
* interpolated time without any side effect.</p>
|
||||
* @return a deep copy of the instance, which can be used independently.
|
||||
* @exception MathUserException if user code called from step interpolator
|
||||
* @exception DerivativeException if user code called from step interpolator
|
||||
* finalization triggers one
|
||||
* @see #setInterpolatedTime(double)
|
||||
*/
|
||||
StepInterpolator copy() throws MathUserException;
|
||||
StepInterpolator copy() throws DerivativeException;
|
||||
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.sampling;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
/**
|
||||
|
@ -109,11 +109,11 @@ public class StepNormalizer implements StepHandler {
|
|||
* should build a local copy using the clone method and store this
|
||||
* copy.
|
||||
* @param isLast true if the step is the last one
|
||||
* @throws MathUserException this exception is propagated to the
|
||||
* @throws DerivativeException this exception is propagated to the
|
||||
* caller if the underlying user function triggers one
|
||||
*/
|
||||
public void handleStep(final StepInterpolator interpolator, final boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
if (lastState == null) {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
package org.apache.commons.math.optimization;
|
||||
|
||||
import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
|
||||
/**
|
||||
* This interface represents an optimization algorithm for {@link DifferentiableMultivariateVectorialFunction
|
||||
|
@ -101,7 +101,7 @@ public interface DifferentiableMultivariateVectorialOptimizer {
|
|||
* @param weights weight for the least squares cost computation
|
||||
* @param startPoint the start point for optimization
|
||||
* @return the point/value pair giving the optimal value for objective function
|
||||
* @exception MathUserException if the objective function throws one during
|
||||
* @exception FunctionEvaluationException if the objective function throws one during
|
||||
* the search
|
||||
* @exception OptimizationException if the algorithm failed to converge
|
||||
* @exception IllegalArgumentException if the start point dimension is wrong
|
||||
|
@ -109,6 +109,6 @@ public interface DifferentiableMultivariateVectorialOptimizer {
|
|||
VectorialPointValuePair optimize(DifferentiableMultivariateVectorialFunction f,
|
||||
double[] target, double[] weights,
|
||||
double[] startPoint)
|
||||
throws MathUserException, OptimizationException, IllegalArgumentException;
|
||||
throws FunctionEvaluationException, OptimizationException, IllegalArgumentException;
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.Comparator;
|
|||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.analysis.DifferentiableMultivariateRealFunction;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.random.RandomVectorGenerator;
|
||||
|
||||
|
@ -173,7 +172,7 @@ public class MultiStartDifferentiableMultivariateRealOptimizer
|
|||
public RealPointValuePair optimize(final DifferentiableMultivariateRealFunction f,
|
||||
final GoalType goalType,
|
||||
double[] startPoint)
|
||||
throws MathUserException, OptimizationException, FunctionEvaluationException {
|
||||
throws FunctionEvaluationException, OptimizationException, FunctionEvaluationException {
|
||||
|
||||
optima = new RealPointValuePair[starts];
|
||||
totalIterations = 0;
|
||||
|
@ -188,7 +187,7 @@ public class MultiStartDifferentiableMultivariateRealOptimizer
|
|||
optimizer.setMaxEvaluations(maxEvaluations - totalEvaluations);
|
||||
optima[i] = optimizer.optimize(f, goalType,
|
||||
(i == 0) ? startPoint : generator.nextVector());
|
||||
} catch (MathUserException fee) {
|
||||
} catch (FunctionEvaluationException fee) {
|
||||
optima[i] = null;
|
||||
} catch (OptimizationException oe) {
|
||||
optima[i] = null;
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.Comparator;
|
|||
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.random.RandomVectorGenerator;
|
||||
|
||||
|
@ -176,7 +176,7 @@ public class MultiStartDifferentiableMultivariateVectorialOptimizer
|
|||
public VectorialPointValuePair optimize(final DifferentiableMultivariateVectorialFunction f,
|
||||
final double[] target, final double[] weights,
|
||||
final double[] startPoint)
|
||||
throws MathUserException, OptimizationException, IllegalArgumentException {
|
||||
throws FunctionEvaluationException, OptimizationException, IllegalArgumentException {
|
||||
|
||||
optima = new VectorialPointValuePair[starts];
|
||||
totalIterations = 0;
|
||||
|
@ -191,7 +191,7 @@ public class MultiStartDifferentiableMultivariateVectorialOptimizer
|
|||
optimizer.setMaxEvaluations(maxEvaluations - totalEvaluations);
|
||||
optima[i] = optimizer.optimize(f, target, weights,
|
||||
(i == 0) ? startPoint : generator.nextVector());
|
||||
} catch (MathUserException fee) {
|
||||
} catch (FunctionEvaluationException fee) {
|
||||
optima[i] = null;
|
||||
} catch (OptimizationException oe) {
|
||||
optima[i] = null;
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.Comparator;
|
|||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
import org.apache.commons.math.MathRuntimeException;
|
||||
import org.apache.commons.math.analysis.MultivariateRealFunction;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.random.RandomVectorGenerator;
|
||||
|
||||
|
@ -163,7 +162,7 @@ public class MultiStartMultivariateRealOptimizer
|
|||
public RealPointValuePair optimize(final MultivariateRealFunction f,
|
||||
final GoalType goalType,
|
||||
double[] startPoint)
|
||||
throws MathUserException, OptimizationException, FunctionEvaluationException {
|
||||
throws FunctionEvaluationException, OptimizationException, FunctionEvaluationException {
|
||||
|
||||
optima = new RealPointValuePair[starts];
|
||||
totalIterations = 0;
|
||||
|
@ -177,7 +176,7 @@ public class MultiStartMultivariateRealOptimizer
|
|||
optimizer.setMaxEvaluations(maxEvaluations - totalEvaluations);
|
||||
optima[i] = optimizer.optimize(f, goalType,
|
||||
(i == 0) ? startPoint : generator.nextVector());
|
||||
} catch (MathUserException fee) {
|
||||
} catch (FunctionEvaluationException fee) {
|
||||
optima[i] = null;
|
||||
} catch (OptimizationException oe) {
|
||||
optima[i] = null;
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||
|
||||
import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
|
||||
import org.apache.commons.math.analysis.MultivariateMatrixFunction;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
import org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer;
|
||||
import org.apache.commons.math.optimization.OptimizationException;
|
||||
import org.apache.commons.math.optimization.VectorialPointValuePair;
|
||||
|
@ -118,13 +118,13 @@ public class CurveFitter {
|
|||
* @param f parametric function to fit
|
||||
* @param initialGuess first guess of the function parameters
|
||||
* @return fitted parameters
|
||||
* @exception MathUserException if the objective function throws one during the search
|
||||
* @exception FunctionEvaluationException if the objective function throws one during the search
|
||||
* @exception OptimizationException if the algorithm failed to converge
|
||||
* @exception IllegalArgumentException if the start point dimension is wrong
|
||||
*/
|
||||
public double[] fit(final ParametricRealFunction f,
|
||||
final double[] initialGuess)
|
||||
throws MathUserException, OptimizationException, IllegalArgumentException {
|
||||
throws FunctionEvaluationException, OptimizationException, IllegalArgumentException {
|
||||
|
||||
// prepare least squares problem
|
||||
double[] target = new double[observations.size()];
|
||||
|
@ -163,7 +163,7 @@ public class CurveFitter {
|
|||
public MultivariateMatrixFunction jacobian() {
|
||||
return new MultivariateMatrixFunction() {
|
||||
public double[][] value(double[] point)
|
||||
throws MathUserException, IllegalArgumentException {
|
||||
throws FunctionEvaluationException, IllegalArgumentException {
|
||||
|
||||
final double[][] jacobian = new double[observations.size()][];
|
||||
|
||||
|
@ -179,7 +179,7 @@ public class CurveFitter {
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
public double[] value(double[] point) throws MathUserException, IllegalArgumentException {
|
||||
public double[] value(double[] point) throws FunctionEvaluationException, IllegalArgumentException {
|
||||
|
||||
// compute the residuals
|
||||
final double[] values = new double[observations.size()];
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.optimization.fitting;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
import org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer;
|
||||
import org.apache.commons.math.optimization.OptimizationException;
|
||||
import org.apache.commons.math.optimization.fitting.CurveFitter;
|
||||
|
@ -91,13 +91,13 @@ public class GaussianFitter {
|
|||
*
|
||||
* @return Gaussian function best fitting the observed points
|
||||
*
|
||||
* @throws MathUserException if <code>CurveFitter.fit</code> throws it
|
||||
* @throws FunctionEvaluationException if <code>CurveFitter.fit</code> throws it
|
||||
* @throws OptimizationException if <code>CurveFitter.fit</code> throws it
|
||||
* @throws IllegalArgumentException if <code>CurveFitter.fit</code> throws it
|
||||
*
|
||||
* @see CurveFitter
|
||||
*/
|
||||
public GaussianFunction fit() throws MathUserException, OptimizationException {
|
||||
public GaussianFunction fit() throws FunctionEvaluationException, OptimizationException {
|
||||
return new GaussianFunction(fitter.fit(new ParametricGaussianFunction(),
|
||||
createParametersGuesser(fitter.getObservations()).guess()));
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.optimization.fitting;
|
||||
|
||||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer;
|
||||
import org.apache.commons.math.optimization.OptimizationException;
|
||||
|
@ -95,8 +96,13 @@ public class HarmonicFitter {
|
|||
|
||||
}
|
||||
|
||||
double[] fitted = fitter.fit(new ParametricHarmonicFunction(), parameters);
|
||||
return new HarmonicFunction(fitted[0], fitted[1], fitted[2]);
|
||||
try {
|
||||
double[] fitted = fitter.fit(new ParametricHarmonicFunction(), parameters);
|
||||
return new HarmonicFunction(fitted[0], fitted[1], fitted[2]);
|
||||
} catch (FunctionEvaluationException fee) {
|
||||
// should never happen
|
||||
throw new RuntimeException(fee);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.optimization.fitting;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
|
||||
/**
|
||||
* An interface representing a real function that depends on one independent
|
||||
|
@ -32,19 +32,19 @@ public interface ParametricRealFunction {
|
|||
* @param x the point for which the function value should be computed
|
||||
* @param parameters function parameters
|
||||
* @return the value
|
||||
* @throws MathUserException if the function evaluation fails
|
||||
* @throws FunctionEvaluationException if the function evaluation fails
|
||||
*/
|
||||
double value(double x, double[] parameters)
|
||||
throws MathUserException;
|
||||
throws FunctionEvaluationException;
|
||||
|
||||
/**
|
||||
* Compute the gradient of the function with respect to its parameters.
|
||||
* @param x the point for which the function value should be computed
|
||||
* @param parameters function parameters
|
||||
* @return the value
|
||||
* @throws MathUserException if the function evaluation fails
|
||||
* @throws FunctionEvaluationException if the function evaluation fails
|
||||
*/
|
||||
double[] gradient(double x, double[] parameters)
|
||||
throws MathUserException;
|
||||
throws FunctionEvaluationException;
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.optimization.fitting;
|
||||
|
||||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
import org.apache.commons.math.analysis.polynomials.PolynomialFunction;
|
||||
import org.apache.commons.math.optimization.DifferentiableMultivariateVectorialOptimizer;
|
||||
import org.apache.commons.math.optimization.OptimizationException;
|
||||
|
@ -70,7 +71,12 @@ public class PolynomialFitter {
|
|||
* @exception OptimizationException if the algorithm failed to converge
|
||||
*/
|
||||
public PolynomialFunction fit() throws OptimizationException {
|
||||
return new PolynomialFunction(fitter.fit(new ParametricPolynomial(), new double[degree + 1]));
|
||||
try {
|
||||
return new PolynomialFunction(fitter.fit(new ParametricPolynomial(), new double[degree + 1]));
|
||||
} catch (FunctionEvaluationException fee) {
|
||||
// should never happen
|
||||
throw new RuntimeException(fee);
|
||||
}
|
||||
}
|
||||
|
||||
/** Dedicated parametric polynomial class. */
|
||||
|
|
|
@ -23,7 +23,6 @@ import org.apache.commons.math.MaxIterationsExceededException;
|
|||
import org.apache.commons.math.analysis.DifferentiableMultivariateVectorialFunction;
|
||||
import org.apache.commons.math.analysis.MultivariateMatrixFunction;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.InvalidMatrixException;
|
||||
import org.apache.commons.math.linear.LUDecompositionImpl;
|
||||
import org.apache.commons.math.linear.MatrixUtils;
|
||||
|
@ -327,7 +326,7 @@ public abstract class AbstractLeastSquaresOptimizer implements DifferentiableMul
|
|||
public VectorialPointValuePair optimize(final DifferentiableMultivariateVectorialFunction f,
|
||||
final double[] target, final double[] weights,
|
||||
final double[] startPoint)
|
||||
throws MathUserException, OptimizationException, IllegalArgumentException {
|
||||
throws FunctionEvaluationException, OptimizationException, IllegalArgumentException {
|
||||
|
||||
if (target.length != weights.length) {
|
||||
throw new OptimizationException(LocalizedFormats.DIMENSIONS_MISMATCH_SIMPLE,
|
||||
|
@ -357,11 +356,7 @@ public abstract class AbstractLeastSquaresOptimizer implements DifferentiableMul
|
|||
|
||||
cost = Double.POSITIVE_INFINITY;
|
||||
|
||||
try {
|
||||
return doOptimize();
|
||||
} catch (FunctionEvaluationException ex) {
|
||||
throw new MathUserException(ex);
|
||||
}
|
||||
return doOptimize();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
package org.apache.commons.math.optimization.general;
|
||||
|
||||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.linear.BlockRealMatrix;
|
||||
import org.apache.commons.math.linear.DecompositionSolver;
|
||||
|
@ -63,7 +62,7 @@ public class GaussNewtonOptimizer extends AbstractLeastSquaresOptimizer {
|
|||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public VectorialPointValuePair doOptimize()
|
||||
throws MathUserException, OptimizationException, IllegalArgumentException {
|
||||
throws FunctionEvaluationException, OptimizationException, IllegalArgumentException {
|
||||
|
||||
// iterate until convergence is reached
|
||||
VectorialPointValuePair current = null;
|
||||
|
@ -73,16 +72,8 @@ public class GaussNewtonOptimizer extends AbstractLeastSquaresOptimizer {
|
|||
|
||||
// evaluate the objective function and its jacobian
|
||||
VectorialPointValuePair previous = current;
|
||||
try {
|
||||
updateResidualsAndCost();
|
||||
} catch (FunctionEvaluationException ex) {
|
||||
throw new MathUserException(ex);
|
||||
}
|
||||
try {
|
||||
updateJacobian();
|
||||
} catch (FunctionEvaluationException ex) {
|
||||
throw new MathUserException(ex);
|
||||
}
|
||||
updateJacobian();
|
||||
current = new VectorialPointValuePair(point, objective);
|
||||
|
||||
// build the linear problem
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.optimization.general;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
|
||||
/**
|
||||
* This interface represents a preconditioner for differentiable scalar
|
||||
|
@ -43,10 +43,10 @@ public interface Preconditioner {
|
|||
* @param point current point at which the search direction was computed
|
||||
* @param r raw search direction (i.e. opposite of the gradient)
|
||||
* @return approximation of H<sup>-1</sup>r where H is the objective function hessian
|
||||
* @exception MathUserException if no cost can be computed for the parameters
|
||||
* @exception FunctionEvaluationException if no cost can be computed for the parameters
|
||||
* @exception IllegalArgumentException if point dimension is wrong
|
||||
*/
|
||||
double[] precondition(double[] point, double[] r)
|
||||
throws MathUserException, IllegalArgumentException;
|
||||
throws FunctionEvaluationException, IllegalArgumentException;
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.linear;
|
|||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.commons.math.TestUtils;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
/**
|
||||
|
@ -840,7 +840,7 @@ public final class Array2DRowRealMatrixTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
public void testWalk() throws MathUserException {
|
||||
public void testWalk() throws MatrixVisitorException {
|
||||
int rows = 150;
|
||||
int columns = 75;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import junit.framework.TestCase;
|
|||
|
||||
import org.apache.commons.math.TestUtils;
|
||||
import org.apache.commons.math.analysis.UnivariateRealFunction;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
/**
|
||||
|
@ -62,15 +62,15 @@ public class ArrayRealVectorTest extends TestCase {
|
|||
data = d.clone();
|
||||
}
|
||||
|
||||
private MathUserException unsupported() {
|
||||
return new MathUserException(new UnsupportedOperationException("Not supported, unneeded for test purposes"));
|
||||
private MatrixVisitorException unsupported() {
|
||||
return new MatrixVisitorException("Not supported, unneeded for test purposes", new Object[0]);
|
||||
}
|
||||
|
||||
public RealVector map(UnivariateRealFunction function) throws MathUserException {
|
||||
public RealVector map(UnivariateRealFunction function) throws MatrixVisitorException {
|
||||
throw unsupported();
|
||||
}
|
||||
|
||||
public RealVector mapToSelf(UnivariateRealFunction function) throws MathUserException {
|
||||
public RealVector mapToSelf(UnivariateRealFunction function) throws MatrixVisitorException {
|
||||
throw unsupported();
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.Random;
|
|||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.commons.math.TestUtils;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.fraction.Fraction;
|
||||
import org.apache.commons.math.fraction.FractionField;
|
||||
|
||||
|
@ -1151,7 +1151,7 @@ public final class BlockFieldMatrixTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
public void testWalk() throws MathUserException {
|
||||
public void testWalk() throws MatrixVisitorException {
|
||||
int rows = 150;
|
||||
int columns = 75;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.Random;
|
|||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.commons.math.TestUtils;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
/**
|
||||
|
@ -1063,7 +1063,7 @@ public final class BlockRealMatrixTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
public void testWalk() throws MathUserException {
|
||||
public void testWalk() throws MatrixVisitorException {
|
||||
int rows = 150;
|
||||
int columns = 75;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.linear;
|
|||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.commons.math.TestUtils;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.fraction.Fraction;
|
||||
import org.apache.commons.math.fraction.FractionField;
|
||||
|
||||
|
@ -836,7 +836,7 @@ public final class FieldMatrixImplTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
public void testWalk() throws MathUserException {
|
||||
public void testWalk() throws MatrixVisitorException {
|
||||
int rows = 150;
|
||||
int columns = 75;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.linear;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
@ -54,8 +54,8 @@ public class QRDecompositionImplTest extends TestCase {
|
|||
}
|
||||
|
||||
/** test dimensions
|
||||
* @throws MathUserException */
|
||||
public void testDimensions() throws MathUserException {
|
||||
* @throws MatrixVisitorException */
|
||||
public void testDimensions() throws MatrixVisitorException {
|
||||
checkDimension(MatrixUtils.createRealMatrix(testData3x3NonSingular));
|
||||
|
||||
checkDimension(MatrixUtils.createRealMatrix(testData4x3));
|
||||
|
@ -81,8 +81,8 @@ public class QRDecompositionImplTest extends TestCase {
|
|||
}
|
||||
|
||||
/** test A = QR
|
||||
* @throws MathUserException */
|
||||
public void testAEqualQR() throws MathUserException {
|
||||
* @throws MatrixVisitorException */
|
||||
public void testAEqualQR() throws MatrixVisitorException {
|
||||
checkAEqualQR(MatrixUtils.createRealMatrix(testData3x3NonSingular));
|
||||
|
||||
checkAEqualQR(MatrixUtils.createRealMatrix(testData3x3Singular));
|
||||
|
@ -107,8 +107,8 @@ public class QRDecompositionImplTest extends TestCase {
|
|||
}
|
||||
|
||||
/** test the orthogonality of Q
|
||||
* @throws MathUserException */
|
||||
public void testQOrthogonal() throws MathUserException {
|
||||
* @throws MatrixVisitorException */
|
||||
public void testQOrthogonal() throws MatrixVisitorException {
|
||||
checkQOrthogonal(MatrixUtils.createRealMatrix(testData3x3NonSingular));
|
||||
|
||||
checkQOrthogonal(MatrixUtils.createRealMatrix(testData3x3Singular));
|
||||
|
@ -134,7 +134,7 @@ public class QRDecompositionImplTest extends TestCase {
|
|||
}
|
||||
|
||||
/** test that R is upper triangular */
|
||||
public void testRUpperTriangular() throws MathUserException {
|
||||
public void testRUpperTriangular() throws MatrixVisitorException {
|
||||
RealMatrix matrix = MatrixUtils.createRealMatrix(testData3x3NonSingular);
|
||||
checkUpperTriangular(new QRDecompositionImpl(matrix).getR());
|
||||
|
||||
|
@ -158,7 +158,7 @@ public class QRDecompositionImplTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
private void checkUpperTriangular(RealMatrix m) throws MathUserException {
|
||||
private void checkUpperTriangular(RealMatrix m) throws MatrixVisitorException {
|
||||
m.walkInOptimizedOrder(new DefaultRealMatrixPreservingVisitor() {
|
||||
@Override
|
||||
public void visit(int row, int column, double value) {
|
||||
|
@ -170,8 +170,8 @@ public class QRDecompositionImplTest extends TestCase {
|
|||
}
|
||||
|
||||
/** test that H is trapezoidal
|
||||
* @throws MathUserException */
|
||||
public void testHTrapezoidal() throws MathUserException {
|
||||
* @throws MatrixVisitorException */
|
||||
public void testHTrapezoidal() throws MatrixVisitorException {
|
||||
RealMatrix matrix = MatrixUtils.createRealMatrix(testData3x3NonSingular);
|
||||
checkTrapezoidal(new QRDecompositionImpl(matrix).getH());
|
||||
|
||||
|
@ -195,7 +195,7 @@ public class QRDecompositionImplTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
private void checkTrapezoidal(RealMatrix m) throws MathUserException {
|
||||
private void checkTrapezoidal(RealMatrix m) throws MatrixVisitorException {
|
||||
m.walkInOptimizedOrder(new DefaultRealMatrixPreservingVisitor() {
|
||||
@Override
|
||||
public void visit(int row, int column, double value) {
|
||||
|
@ -242,7 +242,7 @@ public class QRDecompositionImplTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
private RealMatrix createTestMatrix(final Random r, final int rows, final int columns) throws MathUserException {
|
||||
private RealMatrix createTestMatrix(final Random r, final int rows, final int columns) throws MatrixVisitorException {
|
||||
RealMatrix m = MatrixUtils.createRealMatrix(rows, columns);
|
||||
m.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor(){
|
||||
@Override
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.linear;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
|
@ -160,7 +160,7 @@ public class QRSolverTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
public void testOverdetermined() throws MathUserException {
|
||||
public void testOverdetermined() throws MatrixVisitorException {
|
||||
final Random r = new Random(5559252868205245l);
|
||||
int p = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
|
||||
int q = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
|
||||
|
@ -183,7 +183,7 @@ public class QRSolverTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
public void testUnderdetermined() throws MathUserException {
|
||||
public void testUnderdetermined() throws MatrixVisitorException {
|
||||
final Random r = new Random(42185006424567123l);
|
||||
int p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
|
||||
int q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
|
||||
|
@ -200,7 +200,7 @@ public class QRSolverTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
private RealMatrix createTestMatrix(final Random r, final int rows, final int columns) throws MathUserException {
|
||||
private RealMatrix createTestMatrix(final Random r, final int rows, final int columns) throws MatrixVisitorException {
|
||||
RealMatrix m = MatrixUtils.createRealMatrix(rows, columns);
|
||||
m.walkInOptimizedOrder(new DefaultRealMatrixChangingVisitor(){
|
||||
@Override
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.linear;
|
|||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.commons.math.TestUtils;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
/**
|
||||
|
@ -840,7 +840,7 @@ public final class RealMatrixImplTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
public void testWalk() throws MatrixIndexException, MathUserException {
|
||||
public void testWalk() throws MatrixIndexException, MatrixVisitorException {
|
||||
int rows = 150;
|
||||
int columns = 75;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import junit.framework.TestCase;
|
|||
|
||||
import org.apache.commons.math.TestUtils;
|
||||
import org.apache.commons.math.analysis.UnivariateRealFunction;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.linear.MatrixVisitorException;
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
/**
|
||||
|
@ -60,17 +60,17 @@ public class SparseRealVectorTest extends TestCase {
|
|||
data = d.clone();
|
||||
}
|
||||
|
||||
private MathUserException unsupported() {
|
||||
return new MathUserException(new UnsupportedOperationException("Not supported, unneeded for test purposes"));
|
||||
private MatrixVisitorException unsupported() {
|
||||
return new MatrixVisitorException("Not supported, unneeded for test purposes", new Object[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RealVector map(UnivariateRealFunction function) throws MathUserException {
|
||||
public RealVector map(UnivariateRealFunction function) throws MatrixVisitorException {
|
||||
throw unsupported();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RealVector mapToSelf(UnivariateRealFunction function) throws MathUserException {
|
||||
public RealVector mapToSelf(UnivariateRealFunction function) throws MatrixVisitorException {
|
||||
throw unsupported();
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.apache.commons.math.ode;
|
|||
import junit.framework.*;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ContinuousOutputModel;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
|
@ -40,7 +40,7 @@ public class ContinuousOutputModelTest
|
|||
}
|
||||
|
||||
public void testBoundaries()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
integ.addStepHandler(new ContinuousOutputModel());
|
||||
integ.integrate(pb,
|
||||
pb.getInitialTime(), pb.getInitialState(),
|
||||
|
@ -52,7 +52,7 @@ public class ContinuousOutputModelTest
|
|||
}
|
||||
|
||||
public void testRandomAccess()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
ContinuousOutputModel cm = new ContinuousOutputModel();
|
||||
integ.addStepHandler(cm);
|
||||
|
@ -81,14 +81,14 @@ public class ContinuousOutputModelTest
|
|||
}
|
||||
|
||||
public void testModelsMerging()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
// theoretical solution: y[0] = cos(t), y[1] = sin(t)
|
||||
FirstOrderDifferentialEquations problem =
|
||||
new FirstOrderDifferentialEquations() {
|
||||
private static final long serialVersionUID = 2472449657345878299L;
|
||||
public void computeDerivatives(double t, double[] y, double[] dot)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
dot[0] = -y[1];
|
||||
dot[1] = y[0];
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public class ContinuousOutputModelTest
|
|||
}
|
||||
|
||||
public void testErrorConditions()
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
ContinuousOutputModel cm = new ContinuousOutputModel();
|
||||
cm.handleStep(buildInterpolator(0, new double[] { 0.0, 1.0, -2.0 }, 1), true);
|
||||
|
@ -154,7 +154,7 @@ public class ContinuousOutputModelTest
|
|||
|
||||
private boolean checkAppendError(ContinuousOutputModel cm,
|
||||
double t0, double[] y0, double t1)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
try {
|
||||
ContinuousOutputModel otherCm = new ContinuousOutputModel();
|
||||
otherCm.handleStep(buildInterpolator(t0, y0, t1), true);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderConverter;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.SecondOrderDifferentialEquations;
|
||||
|
@ -42,7 +42,7 @@ public class FirstOrderConverterTest
|
|||
}
|
||||
|
||||
public void testDecreasingSteps()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
double previousError = Double.NaN;
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
|
@ -59,14 +59,14 @@ public class FirstOrderConverterTest
|
|||
}
|
||||
|
||||
public void testSmallStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
double error = integrateWithSpecifiedStep(4.0, 0.0, 1.0, 1.0e-4)
|
||||
- FastMath.sin(4.0);
|
||||
assertTrue(FastMath.abs(error) < 1.0e-10);
|
||||
}
|
||||
|
||||
public void testBigStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
double error = integrateWithSpecifiedStep(4.0, 0.0, 1.0, 0.5)
|
||||
- FastMath.sin(4.0);
|
||||
assertTrue(FastMath.abs(error) > 0.1);
|
||||
|
@ -100,7 +100,7 @@ public class FirstOrderConverterTest
|
|||
private double integrateWithSpecifiedStep(double omega,
|
||||
double t0, double t,
|
||||
double step)
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
double[] y0 = new double[2];
|
||||
y0[0] = FastMath.sin(omega * t0);
|
||||
y0[1] = omega * FastMath.cos(omega * t0);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ODEIntegrator;
|
||||
import org.apache.commons.math.ode.sampling.StepHandler;
|
||||
import org.apache.commons.math.ode.sampling.StepInterpolator;
|
||||
|
@ -73,7 +73,7 @@ public class TestProblemHandler
|
|||
|
||||
public void handleStep(StepInterpolator interpolator,
|
||||
boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
double start = integrator.getCurrentStepStart();
|
||||
if (FastMath.abs((start - problem.getInitialTime()) / integrator.getCurrentSignedStepsize()) > 0.001) {
|
||||
|
|
|
@ -19,8 +19,8 @@ package org.apache.commons.math.ode.events;
|
|||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.apache.commons.math.FunctionEvaluationException;
|
||||
import org.apache.commons.math.ConvergenceException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.sampling.AbstractStepInterpolator;
|
||||
import org.apache.commons.math.ode.sampling.DummyStepInterpolator;
|
||||
import org.junit.Test;
|
||||
|
@ -30,7 +30,7 @@ public class EventStateTest {
|
|||
// JIRA: MATH-322
|
||||
@Test
|
||||
public void closeEvents()
|
||||
throws EventException, ConvergenceException, FunctionEvaluationException {
|
||||
throws EventException, ConvergenceException, DerivativeException {
|
||||
|
||||
final double r1 = 90.0;
|
||||
final double r2 = 135.0;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.jacobians;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.nonstiff.DormandPrince54Integrator;
|
||||
|
@ -31,7 +31,7 @@ public class FirstOrderIntegratorWithJacobiansTest {
|
|||
|
||||
@Test
|
||||
public void testLowAccuracyExternalDifferentiation()
|
||||
throws IntegratorException, MathUserException {
|
||||
throws IntegratorException, DerivativeException {
|
||||
// this test does not really test FirstOrderIntegratorWithJacobians,
|
||||
// it only shows that WITHOUT this class, attempting to recover
|
||||
// the jacobians from external differentiation on simple integration
|
||||
|
@ -64,7 +64,7 @@ public class FirstOrderIntegratorWithJacobiansTest {
|
|||
|
||||
@Test
|
||||
public void testHighAccuracyExternalDifferentiation()
|
||||
throws IntegratorException, MathUserException {
|
||||
throws IntegratorException, DerivativeException {
|
||||
FirstOrderIntegrator integ =
|
||||
new DormandPrince54Integrator(1.0e-8, 100.0, new double[] { 1.0e-10, 1.0e-10 }, new double[] { 1.0e-10, 1.0e-10 });
|
||||
double hP = 1.0e-12;
|
||||
|
@ -92,7 +92,7 @@ public class FirstOrderIntegratorWithJacobiansTest {
|
|||
|
||||
@Test
|
||||
public void testInternalDifferentiation()
|
||||
throws IntegratorException, MathUserException {
|
||||
throws IntegratorException, DerivativeException {
|
||||
FirstOrderIntegrator integ =
|
||||
new DormandPrince54Integrator(1.0e-8, 100.0, new double[] { 1.0e-4, 1.0e-4 }, new double[] { 1.0e-4, 1.0e-4 });
|
||||
double hP = 1.0e-12;
|
||||
|
@ -125,7 +125,7 @@ public class FirstOrderIntegratorWithJacobiansTest {
|
|||
|
||||
@Test
|
||||
public void testAnalyticalDifferentiation()
|
||||
throws IntegratorException, MathUserException {
|
||||
throws IntegratorException, DerivativeException {
|
||||
FirstOrderIntegrator integ =
|
||||
new DormandPrince54Integrator(1.0e-8, 100.0, new double[] { 1.0e-4, 1.0e-4 }, new double[] { 1.0e-4, 1.0e-4 });
|
||||
SummaryStatistics residualsP0 = new SummaryStatistics();
|
||||
|
@ -154,7 +154,7 @@ public class FirstOrderIntegratorWithJacobiansTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testFinalResult() throws IntegratorException, MathUserException {
|
||||
public void testFinalResult() throws IntegratorException, DerivativeException {
|
||||
FirstOrderIntegrator integ =
|
||||
new DormandPrince54Integrator(1.0e-8, 100.0, new double[] { 1.0e-10, 1.0e-10 }, new double[] { 1.0e-10, 1.0e-10 });
|
||||
double[] y = new double[] { 0.0, 1.0 };
|
||||
|
@ -181,7 +181,7 @@ public class FirstOrderIntegratorWithJacobiansTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testStepHandlerResult() throws IntegratorException, MathUserException {
|
||||
public void testStepHandlerResult() throws IntegratorException, DerivativeException {
|
||||
FirstOrderIntegrator integ =
|
||||
new DormandPrince54Integrator(1.0e-8, 100.0, new double[] { 1.0e-10, 1.0e-10 }, new double[] { 1.0e-10, 1.0e-10 });
|
||||
double[] y = new double[] { 0.0, 1.0 };
|
||||
|
@ -201,7 +201,7 @@ public class FirstOrderIntegratorWithJacobiansTest {
|
|||
}
|
||||
|
||||
public void handleStep(StepInterpolatorWithJacobians interpolator, boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
double t = interpolator.getCurrentTime();
|
||||
double[] y = interpolator.getInterpolatedY();
|
||||
double[][] dydy0 = interpolator.getInterpolatedDyDy0();
|
||||
|
@ -245,7 +245,7 @@ public class FirstOrderIntegratorWithJacobiansTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testEventHandler() throws IntegratorException, MathUserException {
|
||||
public void testEventHandler() throws IntegratorException, DerivativeException {
|
||||
FirstOrderIntegrator integ =
|
||||
new DormandPrince54Integrator(1.0e-8, 100.0, new double[] { 1.0e-10, 1.0e-10 }, new double[] { 1.0e-10, 1.0e-10 });
|
||||
double[] y = new double[] { 0.0, 1.0 };
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.apache.commons.math.ode.nonstiff;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem1;
|
||||
|
@ -33,7 +33,7 @@ import org.junit.Test;
|
|||
public class AdamsBashforthIntegratorTest {
|
||||
|
||||
@Test(expected=IntegratorException.class)
|
||||
public void dimensionCheck() throws MathUserException, IntegratorException {
|
||||
public void dimensionCheck() throws DerivativeException, IntegratorException {
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
FirstOrderIntegrator integ =
|
||||
new AdamsBashforthIntegrator(2, 0.0, 1.0, 1.0e-10, 1.0e-10);
|
||||
|
@ -43,7 +43,7 @@ public class AdamsBashforthIntegratorTest {
|
|||
}
|
||||
|
||||
@Test(expected=IntegratorException.class)
|
||||
public void testMinStep() throws MathUserException, IntegratorException {
|
||||
public void testMinStep() throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double minStep = 0.1 * (pb.getFinalTime() - pb.getInitialTime());
|
||||
|
@ -64,7 +64,7 @@ public class AdamsBashforthIntegratorTest {
|
|||
|
||||
@Test
|
||||
public void testIncreasingTolerance()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
int previousCalls = Integer.MAX_VALUE;
|
||||
for (int i = -12; i < -5; ++i) {
|
||||
|
@ -99,8 +99,8 @@ public class AdamsBashforthIntegratorTest {
|
|||
|
||||
}
|
||||
|
||||
@Test(expected = MathUserException.class)
|
||||
public void exceedMaxEvaluations() throws MathUserException, IntegratorException {
|
||||
@Test(expected = DerivativeException.class)
|
||||
public void exceedMaxEvaluations() throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double range = pb.getFinalTime() - pb.getInitialTime();
|
||||
|
@ -116,7 +116,7 @@ public class AdamsBashforthIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void backward() throws MathUserException, IntegratorException {
|
||||
public void backward() throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
double range = FastMath.abs(pb.getFinalTime() - pb.getInitialTime());
|
||||
|
@ -134,7 +134,7 @@ public class AdamsBashforthIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void polynomial() throws MathUserException, IntegratorException {
|
||||
public void polynomial() throws DerivativeException, IntegratorException {
|
||||
TestProblem6 pb = new TestProblem6();
|
||||
double range = FastMath.abs(pb.getFinalTime() - pb.getInitialTime());
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.apache.commons.math.ode.nonstiff;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem1;
|
||||
|
@ -33,7 +33,7 @@ import org.junit.Test;
|
|||
public class AdamsMoultonIntegratorTest {
|
||||
|
||||
@Test(expected=IntegratorException.class)
|
||||
public void dimensionCheck() throws MathUserException, IntegratorException {
|
||||
public void dimensionCheck() throws DerivativeException, IntegratorException {
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
FirstOrderIntegrator integ =
|
||||
new AdamsMoultonIntegrator(2, 0.0, 1.0, 1.0e-10, 1.0e-10);
|
||||
|
@ -43,7 +43,7 @@ public class AdamsMoultonIntegratorTest {
|
|||
}
|
||||
|
||||
@Test(expected=IntegratorException.class)
|
||||
public void testMinStep() throws MathUserException, IntegratorException {
|
||||
public void testMinStep() throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double minStep = 0.1 * (pb.getFinalTime() - pb.getInitialTime());
|
||||
|
@ -64,7 +64,7 @@ public class AdamsMoultonIntegratorTest {
|
|||
|
||||
@Test
|
||||
public void testIncreasingTolerance()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
int previousCalls = Integer.MAX_VALUE;
|
||||
for (int i = -12; i < -2; ++i) {
|
||||
|
@ -99,8 +99,8 @@ public class AdamsMoultonIntegratorTest {
|
|||
|
||||
}
|
||||
|
||||
@Test(expected = MathUserException.class)
|
||||
public void exceedMaxEvaluations() throws MathUserException, IntegratorException {
|
||||
@Test(expected = DerivativeException.class)
|
||||
public void exceedMaxEvaluations() throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double range = pb.getFinalTime() - pb.getInitialTime();
|
||||
|
@ -116,7 +116,7 @@ public class AdamsMoultonIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void backward() throws MathUserException, IntegratorException {
|
||||
public void backward() throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
double range = FastMath.abs(pb.getFinalTime() - pb.getInitialTime());
|
||||
|
@ -134,7 +134,7 @@ public class AdamsMoultonIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void polynomial() throws MathUserException, IntegratorException {
|
||||
public void polynomial() throws DerivativeException, IntegratorException {
|
||||
TestProblem6 pb = new TestProblem6();
|
||||
double range = FastMath.abs(pb.getFinalTime() - pb.getInitialTime());
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.ode.nonstiff;
|
|||
|
||||
import junit.framework.*;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
|
@ -42,7 +42,7 @@ public class ClassicalRungeKuttaIntegratorTest
|
|||
super(name);
|
||||
}
|
||||
|
||||
public void testMissedEndEvent() throws IntegratorException, MathUserException {
|
||||
public void testMissedEndEvent() throws IntegratorException, DerivativeException {
|
||||
final double t0 = 1878250320.0000029;
|
||||
final double tEvent = 1878250379.9999986;
|
||||
final double[] k = { 1.0e-4, 1.0e-5, 1.0e-6 };
|
||||
|
@ -102,7 +102,7 @@ public class ClassicalRungeKuttaIntegratorTest
|
|||
0.0, new double[pb.getDimension()+10],
|
||||
1.0, new double[pb.getDimension()]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class ClassicalRungeKuttaIntegratorTest
|
|||
0.0, new double[pb.getDimension()],
|
||||
1.0, new double[pb.getDimension()+10]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
|
@ -122,14 +122,14 @@ public class ClassicalRungeKuttaIntegratorTest
|
|||
0.0, new double[pb.getDimension()],
|
||||
0.0, new double[pb.getDimension()]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
}
|
||||
|
||||
public void testDecreasingSteps()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblemAbstract[] problems = TestProblemFactory.getProblems();
|
||||
for (int k = 0; k < problems.length; ++k) {
|
||||
|
@ -177,7 +177,7 @@ public class ClassicalRungeKuttaIntegratorTest
|
|||
}
|
||||
|
||||
public void testSmallStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
|
@ -195,7 +195,7 @@ public class ClassicalRungeKuttaIntegratorTest
|
|||
}
|
||||
|
||||
public void testBigStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.2;
|
||||
|
@ -213,7 +213,7 @@ public class ClassicalRungeKuttaIntegratorTest
|
|||
}
|
||||
|
||||
public void testBackward()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
double step = FastMath.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
|
@ -231,7 +231,7 @@ public class ClassicalRungeKuttaIntegratorTest
|
|||
}
|
||||
|
||||
public void testKepler()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final TestProblem3 pb = new TestProblem3(0.9);
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.0003;
|
||||
|
@ -255,7 +255,7 @@ public class ClassicalRungeKuttaIntegratorTest
|
|||
maxError = 0;
|
||||
}
|
||||
public void handleStep(StepInterpolator interpolator,
|
||||
boolean isLast) throws MathUserException {
|
||||
boolean isLast) throws DerivativeException {
|
||||
|
||||
double[] interpolatedY = interpolator.getInterpolatedState ();
|
||||
double[] theoreticalY = pb.computeTheoreticalState(interpolator.getCurrentTime());
|
||||
|
@ -277,7 +277,7 @@ public class ClassicalRungeKuttaIntegratorTest
|
|||
}
|
||||
|
||||
public void testStepSize()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
final double step = 1.23456;
|
||||
FirstOrderIntegrator integ = new ClassicalRungeKuttaIntegrator(step);
|
||||
integ.addStepHandler(new StepHandler() {
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.io.ObjectInputStream;
|
|||
import java.io.ObjectOutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ContinuousOutputModel;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem3;
|
||||
|
@ -38,7 +38,7 @@ public class ClassicalRungeKuttaStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void derivativesConsistency()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
ClassicalRungeKuttaIntegrator integ = new ClassicalRungeKuttaIntegrator(step);
|
||||
|
@ -47,7 +47,7 @@ public class ClassicalRungeKuttaStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void serialization()
|
||||
throws MathUserException, IntegratorException,
|
||||
throws DerivativeException, IntegratorException,
|
||||
IOException, ClassNotFoundException {
|
||||
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem1;
|
||||
|
@ -51,7 +51,7 @@ public class DormandPrince54IntegratorTest
|
|||
0.0, new double[pb.getDimension()+10],
|
||||
1.0, new double[pb.getDimension()+10]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class DormandPrince54IntegratorTest
|
|||
pb.getInitialTime(), pb.getInitialState(),
|
||||
pb.getFinalTime(), new double[pb.getDimension()]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class DormandPrince54IntegratorTest
|
|||
}
|
||||
|
||||
public void testSmallLastStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblemAbstract pb = new TestProblem5();
|
||||
double minStep = 1.25;
|
||||
|
@ -108,7 +108,7 @@ public class DormandPrince54IntegratorTest
|
|||
}
|
||||
|
||||
public void testBackward()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
double minStep = 0;
|
||||
|
@ -162,7 +162,7 @@ public class DormandPrince54IntegratorTest
|
|||
}
|
||||
|
||||
public void testIncreasingTolerance()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
int previousCalls = Integer.MAX_VALUE;
|
||||
for (int i = -12; i < -2; ++i) {
|
||||
|
@ -203,7 +203,7 @@ public class DormandPrince54IntegratorTest
|
|||
}
|
||||
|
||||
public void testEvents()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem4 pb = new TestProblem4();
|
||||
double minStep = 0;
|
||||
|
@ -236,7 +236,7 @@ public class DormandPrince54IntegratorTest
|
|||
}
|
||||
|
||||
public void testKepler()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
|
@ -258,7 +258,7 @@ public class DormandPrince54IntegratorTest
|
|||
}
|
||||
|
||||
public void testVariableSteps()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
|
@ -289,7 +289,7 @@ public class DormandPrince54IntegratorTest
|
|||
}
|
||||
public void handleStep(StepInterpolator interpolator,
|
||||
boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
++nbSteps;
|
||||
for (int a = 1; a < 10; ++a) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.io.ObjectInputStream;
|
|||
import java.io.ObjectOutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ContinuousOutputModel;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem3;
|
||||
|
@ -41,7 +41,7 @@ public class DormandPrince54StepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void derivativesConsistency()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3(0.1);
|
||||
double minStep = 0;
|
||||
double maxStep = pb.getFinalTime() - pb.getInitialTime();
|
||||
|
@ -55,7 +55,7 @@ public class DormandPrince54StepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void serialization()
|
||||
throws MathUserException, IntegratorException,
|
||||
throws DerivativeException, IntegratorException,
|
||||
IOException, ClassNotFoundException {
|
||||
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
|
@ -106,7 +106,7 @@ public class DormandPrince54StepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void checkClone()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
double maxStep = pb.getFinalTime() - pb.getInitialTime();
|
||||
|
@ -117,7 +117,7 @@ public class DormandPrince54StepInterpolatorTest {
|
|||
scalRelativeTolerance);
|
||||
integ.addStepHandler(new StepHandler() {
|
||||
public void handleStep(StepInterpolator interpolator, boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
StepInterpolator cloned = interpolator.copy();
|
||||
double tA = cloned.getPreviousTime();
|
||||
double tB = cloned.getCurrentTime();
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
|
@ -42,7 +42,7 @@ public class DormandPrince853IntegratorTest
|
|||
super(name);
|
||||
}
|
||||
|
||||
public void testMissedEndEvent() throws IntegratorException, MathUserException {
|
||||
public void testMissedEndEvent() throws IntegratorException, DerivativeException {
|
||||
final double t0 = 1878250320.0000029;
|
||||
final double tEvent = 1878250379.9999986;
|
||||
final double[] k = { 1.0e-4, 1.0e-5, 1.0e-6 };
|
||||
|
@ -107,7 +107,7 @@ public class DormandPrince853IntegratorTest
|
|||
0.0, new double[pb.getDimension()+10],
|
||||
1.0, new double[pb.getDimension()+10]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ public class DormandPrince853IntegratorTest
|
|||
0.0, new double[pb.getDimension()],
|
||||
0.0, new double[pb.getDimension()]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ public class DormandPrince853IntegratorTest
|
|||
pb.getInitialTime(), pb.getInitialState(),
|
||||
pb.getFinalTime(), new double[pb.getDimension()]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ public class DormandPrince853IntegratorTest
|
|||
}
|
||||
|
||||
public void testIncreasingTolerance()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
int previousCalls = Integer.MAX_VALUE;
|
||||
for (int i = -12; i < -2; ++i) {
|
||||
|
@ -189,7 +189,7 @@ public class DormandPrince853IntegratorTest
|
|||
}
|
||||
|
||||
public void testBackward()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
double minStep = 0;
|
||||
|
@ -212,7 +212,7 @@ public class DormandPrince853IntegratorTest
|
|||
}
|
||||
|
||||
public void testEvents()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem4 pb = new TestProblem4();
|
||||
double minStep = 0;
|
||||
|
@ -245,7 +245,7 @@ public class DormandPrince853IntegratorTest
|
|||
}
|
||||
|
||||
public void testKepler()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
|
@ -267,7 +267,7 @@ public class DormandPrince853IntegratorTest
|
|||
}
|
||||
|
||||
public void testVariableSteps()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
|
@ -287,7 +287,7 @@ public class DormandPrince853IntegratorTest
|
|||
}
|
||||
|
||||
public void testNoDenseOutput()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem1 pb1 = new TestProblem1();
|
||||
TestProblem1 pb2 = pb1.copy();
|
||||
double minStep = 0.1 * (pb1.getFinalTime() - pb1.getInitialTime());
|
||||
|
@ -317,7 +317,7 @@ public class DormandPrince853IntegratorTest
|
|||
}
|
||||
|
||||
public void testUnstableDerivative()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
final StepProblem stepProblem = new StepProblem(0.0, 1.0, 2.0);
|
||||
FirstOrderIntegrator integ =
|
||||
new DormandPrince853Integrator(0.1, 10, 1.0e-12, 0.0);
|
||||
|
@ -341,7 +341,7 @@ public class DormandPrince853IntegratorTest
|
|||
}
|
||||
public void handleStep(StepInterpolator interpolator,
|
||||
boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
++nbSteps;
|
||||
for (int a = 1; a < 10; ++a) {
|
||||
|
@ -418,7 +418,7 @@ public class DormandPrince853IntegratorTest
|
|||
}
|
||||
public void handleStep(StepInterpolator interpolator,
|
||||
boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
double prev = interpolator.getPreviousTime();
|
||||
double curr = interpolator.getCurrentTime();
|
||||
interpolator.setInterpolatedTime(0.5*(prev + curr));
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.io.ObjectInputStream;
|
|||
import java.io.ObjectOutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ContinuousOutputModel;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem3;
|
||||
|
@ -41,7 +41,7 @@ public class DormandPrince853StepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void derivativesConsistency()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3(0.1);
|
||||
double minStep = 0;
|
||||
double maxStep = pb.getFinalTime() - pb.getInitialTime();
|
||||
|
@ -55,7 +55,7 @@ public class DormandPrince853StepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void serialization()
|
||||
throws MathUserException, IntegratorException,
|
||||
throws DerivativeException, IntegratorException,
|
||||
IOException, ClassNotFoundException {
|
||||
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
|
@ -106,7 +106,7 @@ public class DormandPrince853StepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void checklone()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
double maxStep = pb.getFinalTime() - pb.getInitialTime();
|
||||
|
@ -117,7 +117,7 @@ public class DormandPrince853StepInterpolatorTest {
|
|||
scalRelativeTolerance);
|
||||
integ.addStepHandler(new StepHandler() {
|
||||
public void handleStep(StepInterpolator interpolator, boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
StepInterpolator cloned = interpolator.copy();
|
||||
double tA = cloned.getPreviousTime();
|
||||
double tB = cloned.getCurrentTime();
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.ode.nonstiff;
|
|||
|
||||
import junit.framework.*;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
|
@ -48,14 +48,14 @@ public class EulerIntegratorTest
|
|||
0.0, new double[pb.getDimension()+10],
|
||||
1.0, new double[pb.getDimension()+10]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
}
|
||||
|
||||
public void testDecreasingSteps()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblemAbstract[] problems = TestProblemFactory.getProblems();
|
||||
for (int k = 0; k < problems.length; ++k) {
|
||||
|
@ -100,7 +100,7 @@ public class EulerIntegratorTest
|
|||
}
|
||||
|
||||
public void testSmallStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
|
@ -120,7 +120,7 @@ public class EulerIntegratorTest
|
|||
}
|
||||
|
||||
public void testBigStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.2;
|
||||
|
@ -139,7 +139,7 @@ public class EulerIntegratorTest
|
|||
}
|
||||
|
||||
public void testBackward()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
double step = FastMath.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
|
@ -157,7 +157,7 @@ public class EulerIntegratorTest
|
|||
}
|
||||
|
||||
public void testStepSize()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
final double step = 1.23456;
|
||||
FirstOrderIntegrator integ = new EulerIntegrator(step);
|
||||
integ.addStepHandler(new StepHandler() {
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.io.ObjectInputStream;
|
|||
import java.io.ObjectOutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ContinuousOutputModel;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem1;
|
||||
|
@ -39,7 +39,7 @@ import org.junit.Test;
|
|||
public class EulerStepInterpolatorTest {
|
||||
|
||||
@Test
|
||||
public void noReset() throws MathUserException {
|
||||
public void noReset() throws DerivativeException {
|
||||
|
||||
double[] y = { 0.0, 1.0, -2.0 };
|
||||
double[][] yDot = { { 1.0, 2.0, -2.0 } };
|
||||
|
@ -58,7 +58,7 @@ public class EulerStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void interpolationAtBounds()
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
double t0 = 0;
|
||||
double[] y0 = {0.0, 1.0, -2.0};
|
||||
|
@ -95,7 +95,7 @@ public class EulerStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void interpolationInside()
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
double[] y = { 1.0, 3.0, -4.0 };
|
||||
double[][] yDot = { { 1.0, 2.0, -2.0 } };
|
||||
|
@ -121,7 +121,7 @@ public class EulerStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void derivativesConsistency()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
EulerIntegrator integ = new EulerIntegrator(step);
|
||||
|
@ -130,7 +130,7 @@ public class EulerStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void serialization()
|
||||
throws MathUserException, IntegratorException,
|
||||
throws DerivativeException, IntegratorException,
|
||||
IOException, ClassNotFoundException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.ode.nonstiff;
|
|||
|
||||
import junit.framework.*;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
|
@ -49,14 +49,14 @@ public class GillIntegratorTest
|
|||
0.0, new double[pb.getDimension()+10],
|
||||
1.0, new double[pb.getDimension()+10]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
}
|
||||
|
||||
public void testDecreasingSteps()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblemAbstract[] problems = TestProblemFactory.getProblems();
|
||||
for (int k = 0; k < problems.length; ++k) {
|
||||
|
@ -101,7 +101,7 @@ public class GillIntegratorTest
|
|||
}
|
||||
|
||||
public void testSmallStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
|
@ -120,7 +120,7 @@ public class GillIntegratorTest
|
|||
}
|
||||
|
||||
public void testBigStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.2;
|
||||
|
@ -138,7 +138,7 @@ public class GillIntegratorTest
|
|||
}
|
||||
|
||||
public void testBackward()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
double step = FastMath.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
|
@ -156,7 +156,7 @@ public class GillIntegratorTest
|
|||
}
|
||||
|
||||
public void testKepler()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final TestProblem3 pb = new TestProblem3(0.9);
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.0003;
|
||||
|
@ -169,7 +169,7 @@ public class GillIntegratorTest
|
|||
}
|
||||
|
||||
public void testUnstableDerivative()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
final StepProblem stepProblem = new StepProblem(0.0, 1.0, 2.0);
|
||||
FirstOrderIntegrator integ = new GillIntegrator(0.3);
|
||||
integ.addEventHandler(stepProblem, 1.0, 1.0e-12, 1000);
|
||||
|
@ -190,7 +190,7 @@ public class GillIntegratorTest
|
|||
maxError = 0;
|
||||
}
|
||||
public void handleStep(StepInterpolator interpolator,
|
||||
boolean isLast) throws MathUserException {
|
||||
boolean isLast) throws DerivativeException {
|
||||
|
||||
double[] interpolatedY = interpolator.getInterpolatedState();
|
||||
double[] theoreticalY = pb.computeTheoreticalState(interpolator.getCurrentTime());
|
||||
|
@ -212,7 +212,7 @@ public class GillIntegratorTest
|
|||
}
|
||||
|
||||
public void testStepSize()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
final double step = 1.23456;
|
||||
FirstOrderIntegrator integ = new GillIntegrator(step);
|
||||
integ.addStepHandler(new StepHandler() {
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.io.ObjectOutputStream;
|
|||
import java.io.ObjectInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ContinuousOutputModel;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem3;
|
||||
|
@ -39,7 +39,7 @@ public class GillStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void testDerivativesConsistency()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
GillIntegrator integ = new GillIntegrator(step);
|
||||
|
@ -48,7 +48,7 @@ public class GillStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void serialization()
|
||||
throws MathUserException, IntegratorException,
|
||||
throws DerivativeException, IntegratorException,
|
||||
IOException, ClassNotFoundException {
|
||||
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
package org.apache.commons.math.ode.nonstiff;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem1;
|
||||
|
@ -50,7 +50,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
0.0, new double[pb.getDimension()+10],
|
||||
1.0, new double[pb.getDimension()+10]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
0.0, new double[pb.getDimension()],
|
||||
0.0, new double[pb.getDimension()]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
pb.getInitialTime(), pb.getInitialState(),
|
||||
pb.getFinalTime(), new double[pb.getDimension()]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
}
|
||||
|
||||
public void testBackward()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
double minStep = 0;
|
||||
|
@ -120,7 +120,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
}
|
||||
|
||||
public void testIncreasingTolerance()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
int previousCalls = Integer.MAX_VALUE;
|
||||
for (int i = -12; i < -4; ++i) {
|
||||
|
@ -157,7 +157,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
}
|
||||
|
||||
public void testIntegratorControls()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem3 pb = new TestProblem3(0.999);
|
||||
GraggBulirschStoerIntegrator integ =
|
||||
|
@ -186,7 +186,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
}
|
||||
|
||||
private double getMaxError(FirstOrderIntegrator integrator, TestProblemAbstract pb)
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblemHandler handler = new TestProblemHandler(pb, integrator);
|
||||
integrator.addStepHandler(handler);
|
||||
integrator.integrate(pb,
|
||||
|
@ -196,7 +196,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
}
|
||||
|
||||
public void testEvents()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem4 pb = new TestProblem4();
|
||||
double minStep = 0;
|
||||
|
@ -228,7 +228,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
}
|
||||
|
||||
public void testKepler()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
|
@ -250,7 +250,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
}
|
||||
|
||||
public void testVariableSteps()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
|
@ -269,7 +269,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
}
|
||||
|
||||
public void testUnstableDerivative()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
final StepProblem stepProblem = new StepProblem(0.0, 1.0, 2.0);
|
||||
FirstOrderIntegrator integ =
|
||||
new GraggBulirschStoerIntegrator(0.1, 10, 1.0e-12, 0.0);
|
||||
|
@ -293,7 +293,7 @@ public class GraggBulirschStoerIntegratorTest
|
|||
}
|
||||
public void handleStep(StepInterpolator interpolator,
|
||||
boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
++nbSteps;
|
||||
for (int a = 1; a < 100; ++a) {
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.io.ObjectInputStream;
|
|||
import java.io.ObjectOutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ContinuousOutputModel;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem3;
|
||||
|
@ -41,7 +41,7 @@ public class GraggBulirschStoerStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void derivativesConsistency()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
double maxStep = pb.getFinalTime() - pb.getInitialTime();
|
||||
|
@ -56,7 +56,7 @@ public class GraggBulirschStoerStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void serialization()
|
||||
throws MathUserException, IntegratorException,
|
||||
throws DerivativeException, IntegratorException,
|
||||
IOException, ClassNotFoundException {
|
||||
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
|
@ -108,7 +108,7 @@ public class GraggBulirschStoerStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void checklone()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
double maxStep = pb.getFinalTime() - pb.getInitialTime();
|
||||
|
@ -119,7 +119,7 @@ public class GraggBulirschStoerStepInterpolatorTest {
|
|||
scalRelativeTolerance);
|
||||
integ.addStepHandler(new StepHandler() {
|
||||
public void handleStep(StepInterpolator interpolator, boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
StepInterpolator cloned = interpolator.copy();
|
||||
double tA = cloned.getPreviousTime();
|
||||
double tB = cloned.getCurrentTime();
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.apache.commons.math.ode.nonstiff;
|
|||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.commons.math.ConvergenceException;
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
|
@ -48,11 +48,11 @@ public class HighamHall54IntegratorTest
|
|||
new FirstOrderDifferentialEquations() {
|
||||
private static final long serialVersionUID = -1157081786301178032L;
|
||||
public void computeDerivatives(double t, double[] y, double[] dot)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
if (t < -0.5) {
|
||||
throw new MathUserException(LocalizedFormats.SIMPLE_MESSAGE, "oops");
|
||||
throw new DerivativeException(LocalizedFormats.SIMPLE_MESSAGE, "oops");
|
||||
} else {
|
||||
throw new MathUserException(new RuntimeException("oops"));
|
||||
throw new DerivativeException(new RuntimeException("oops"));
|
||||
}
|
||||
}
|
||||
public int getDimension() {
|
||||
|
@ -63,14 +63,14 @@ public class HighamHall54IntegratorTest
|
|||
try {
|
||||
integrator.integrate(equations, -1.0, new double[1], 0.0, new double[1]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
// expected behavior
|
||||
}
|
||||
|
||||
try {
|
||||
integrator.integrate(equations, 0.0, new double[1], 1.0, new double[1]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
// expected behavior
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ public class HighamHall54IntegratorTest
|
|||
pb.getInitialTime(), pb.getInitialState(),
|
||||
pb.getFinalTime(), new double[pb.getDimension()]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class HighamHall54IntegratorTest
|
|||
}
|
||||
|
||||
public void testIncreasingTolerance()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
int previousCalls = Integer.MAX_VALUE;
|
||||
for (int i = -12; i < -2; ++i) {
|
||||
|
@ -137,7 +137,7 @@ public class HighamHall54IntegratorTest
|
|||
}
|
||||
|
||||
public void testBackward()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
double minStep = 0;
|
||||
|
@ -160,7 +160,7 @@ public class HighamHall54IntegratorTest
|
|||
}
|
||||
|
||||
public void testEvents()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem4 pb = new TestProblem4();
|
||||
double minStep = 0;
|
||||
|
@ -332,7 +332,7 @@ public class HighamHall54IntegratorTest
|
|||
}
|
||||
|
||||
public void testKepler()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.io.ObjectInputStream;
|
|||
import java.io.ObjectOutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ContinuousOutputModel;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem3;
|
||||
|
@ -41,7 +41,7 @@ public class HighamHall54StepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void derivativesConsistency()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3(0.1);
|
||||
double minStep = 0;
|
||||
double maxStep = pb.getFinalTime() - pb.getInitialTime();
|
||||
|
@ -55,7 +55,7 @@ public class HighamHall54StepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void serialization()
|
||||
throws MathUserException, IntegratorException,
|
||||
throws DerivativeException, IntegratorException,
|
||||
IOException, ClassNotFoundException {
|
||||
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
|
@ -106,7 +106,7 @@ public class HighamHall54StepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void checkClone()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
double minStep = 0;
|
||||
double maxStep = pb.getFinalTime() - pb.getInitialTime();
|
||||
|
@ -117,7 +117,7 @@ public class HighamHall54StepInterpolatorTest {
|
|||
scalRelativeTolerance);
|
||||
integ.addStepHandler(new StepHandler() {
|
||||
public void handleStep(StepInterpolator interpolator, boolean isLast)
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
StepInterpolator cloned = interpolator.copy();
|
||||
double tA = cloned.getPreviousTime();
|
||||
double tB = cloned.getCurrentTime();
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.ode.nonstiff;
|
|||
|
||||
import junit.framework.*;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
|
@ -48,14 +48,14 @@ public class MidpointIntegratorTest
|
|||
0.0, new double[pb.getDimension()+10],
|
||||
1.0, new double[pb.getDimension()+10]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
}
|
||||
|
||||
public void testDecreasingSteps()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblemAbstract[] problems = TestProblemFactory.getProblems();
|
||||
for (int k = 0; k < problems.length; ++k) {
|
||||
|
@ -100,7 +100,7 @@ public class MidpointIntegratorTest
|
|||
}
|
||||
|
||||
public void testSmallStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
|
@ -120,7 +120,7 @@ public class MidpointIntegratorTest
|
|||
}
|
||||
|
||||
public void testBigStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.2;
|
||||
|
@ -139,7 +139,7 @@ public class MidpointIntegratorTest
|
|||
}
|
||||
|
||||
public void testBackward()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
double step = FastMath.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
|
@ -157,7 +157,7 @@ public class MidpointIntegratorTest
|
|||
}
|
||||
|
||||
public void testStepSize()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
final double step = 1.23456;
|
||||
FirstOrderIntegrator integ = new MidpointIntegrator(step);
|
||||
integ.addStepHandler(new StepHandler() {
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.io.ObjectInputStream;
|
|||
import java.io.ObjectOutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ContinuousOutputModel;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem1;
|
||||
|
@ -39,7 +39,7 @@ public class MidpointStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void testDerivativesConsistency()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
MidpointIntegrator integ = new MidpointIntegrator(step);
|
||||
|
@ -48,7 +48,7 @@ public class MidpointStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void serialization()
|
||||
throws MathUserException, IntegratorException,
|
||||
throws DerivativeException, IntegratorException,
|
||||
IOException, ClassNotFoundException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.apache.commons.math.ode.nonstiff;
|
|||
|
||||
import junit.framework.*;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.FirstOrderDifferentialEquations;
|
||||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
|
@ -49,14 +49,14 @@ public class ThreeEighthesIntegratorTest
|
|||
0.0, new double[pb.getDimension()+10],
|
||||
1.0, new double[pb.getDimension()+10]);
|
||||
fail("an exception should have been thrown");
|
||||
} catch(MathUserException de) {
|
||||
} catch(DerivativeException de) {
|
||||
fail("wrong exception caught");
|
||||
} catch(IntegratorException ie) {
|
||||
}
|
||||
}
|
||||
|
||||
public void testDecreasingSteps()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblemAbstract[] problems = TestProblemFactory.getProblems();
|
||||
for (int k = 0; k < problems.length; ++k) {
|
||||
|
@ -101,7 +101,7 @@ public class ThreeEighthesIntegratorTest
|
|||
}
|
||||
|
||||
public void testSmallStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
|
@ -120,7 +120,7 @@ public class ThreeEighthesIntegratorTest
|
|||
}
|
||||
|
||||
public void testBigStep()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.2;
|
||||
|
@ -138,7 +138,7 @@ public class ThreeEighthesIntegratorTest
|
|||
}
|
||||
|
||||
public void testBackward()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
double step = FastMath.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
|
@ -156,7 +156,7 @@ public class ThreeEighthesIntegratorTest
|
|||
}
|
||||
|
||||
public void testKepler()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
final TestProblem3 pb = new TestProblem3(0.9);
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.0003;
|
||||
|
@ -184,7 +184,7 @@ public class ThreeEighthesIntegratorTest
|
|||
}
|
||||
|
||||
public void handleStep(StepInterpolator interpolator,
|
||||
boolean isLast) throws MathUserException {
|
||||
boolean isLast) throws DerivativeException {
|
||||
|
||||
double[] interpolatedY = interpolator.getInterpolatedState();
|
||||
double[] theoreticalY = pb.computeTheoreticalState(interpolator.getCurrentTime());
|
||||
|
@ -208,7 +208,7 @@ public class ThreeEighthesIntegratorTest
|
|||
}
|
||||
|
||||
public void testStepSize()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
final double step = 1.23456;
|
||||
FirstOrderIntegrator integ = new ThreeEighthesIntegrator(step);
|
||||
integ.addStepHandler(new StepHandler() {
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.io.ObjectInputStream;
|
|||
import java.io.ObjectOutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.ode.ContinuousOutputModel;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.TestProblem3;
|
||||
|
@ -38,7 +38,7 @@ public class ThreeEighthesStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void derivativesConsistency()
|
||||
throws MathUserException, IntegratorException {
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3();
|
||||
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
|
||||
ThreeEighthesIntegrator integ = new ThreeEighthesIntegrator(step);
|
||||
|
@ -47,7 +47,7 @@ public class ThreeEighthesStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void serialization()
|
||||
throws MathUserException, IntegratorException,
|
||||
throws DerivativeException, IntegratorException,
|
||||
IOException, ClassNotFoundException {
|
||||
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
|
|
|
@ -27,7 +27,7 @@ import java.io.ObjectOutputStream;
|
|||
import java.io.ObjectInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.ode.DerivativeException;
|
||||
import org.apache.commons.math.exception.util.Localizable;
|
||||
import org.apache.commons.math.exception.util.LocalizedFormats;
|
||||
import org.apache.commons.math.ode.sampling.AbstractStepInterpolator;
|
||||
|
@ -38,7 +38,7 @@ import org.junit.Test;
|
|||
public class DummyStepInterpolatorTest {
|
||||
|
||||
@Test
|
||||
public void testNoReset() throws MathUserException {
|
||||
public void testNoReset() throws DerivativeException {
|
||||
|
||||
double[] y = { 0.0, 1.0, -2.0 };
|
||||
DummyStepInterpolator interpolator = new DummyStepInterpolator(y, new double[y.length], true);
|
||||
|
@ -55,7 +55,7 @@ public class DummyStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void testFixedState()
|
||||
throws MathUserException {
|
||||
throws DerivativeException {
|
||||
|
||||
double[] y = { 1.0, 3.0, -4.0 };
|
||||
DummyStepInterpolator interpolator = new DummyStepInterpolator(y, new double[y.length], true);
|
||||
|
@ -79,7 +79,7 @@ public class DummyStepInterpolatorTest {
|
|||
|
||||
@Test
|
||||
public void testSerialization()
|
||||
throws MathUserException, IOException, ClassNotFoundException {
|
||||
throws DerivativeException, IOException, ClassNotFoundException {
|
||||
|
||||
double[] y = { 0.0, 1.0, -2.0 };
|
||||
DummyStepInterpolator interpolator = new DummyStepInterpolator(y, new double[y.length], true);
|
||||
|
@ -136,8 +136,8 @@ public class DummyStepInterpolatorTest {
|
|||
super(y, new double[y.length], forward);
|
||||
}
|
||||
@Override
|
||||
protected void doFinalize() throws MathUserException {
|
||||
throw new MathUserException((Localizable) null, LocalizedFormats.SIMPLE_MESSAGE, "");
|
||||
protected void doFinalize() throws DerivativeException {
|
||||
throw new DerivativeException((Localizable) null, LocalizedFormats.SIMPLE_MESSAGE, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue