removed MathUserException from linear package
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1165822 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e1836fd8ac
commit
0f0e1abde9
|
@ -481,8 +481,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int)
|
||||
|
@ -505,8 +503,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor, int, int, int, int)
|
||||
|
@ -533,8 +529,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException
|
||||
* if the indices are not valid.
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
|
@ -564,8 +558,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException
|
||||
* if the indices are not valid.
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
|
@ -591,8 +583,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -615,8 +605,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -643,8 +631,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException
|
||||
* if the indices are not valid.
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
|
@ -674,8 +660,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException
|
||||
* if the indices are not valid.
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
|
@ -700,8 +684,6 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* <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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -723,8 +705,6 @@ public interface FieldMatrix<T extends FieldElement<T>> extends AnyMatrix {
|
|||
* <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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -750,8 +730,6 @@ 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)
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException
|
||||
* if the indices are not valid.
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
|
@ -780,8 +758,6 @@ 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)
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException
|
||||
* if the indices are not valid.
|
||||
* @see #walkInRowOrder(FieldMatrixChangingVisitor)
|
||||
|
|
|
@ -46,8 +46,6 @@ 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 org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
*/
|
||||
T visit(int row, int column, T value);
|
||||
|
||||
|
|
|
@ -45,8 +45,6 @@ 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 org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
*/
|
||||
void visit(int row, int column, T value);
|
||||
|
||||
|
|
|
@ -486,8 +486,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int)
|
||||
|
@ -510,8 +508,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor, int, int, int, int)
|
||||
|
@ -538,8 +534,6 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException if
|
||||
* the indices are not valid.
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
|
@ -569,8 +563,6 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException if
|
||||
* the indices are not valid.
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
|
@ -596,8 +588,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -620,8 +610,6 @@ 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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -648,8 +636,6 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException if
|
||||
* the indices are not valid.
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
|
@ -679,8 +665,6 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException if
|
||||
* the indices are not valid.
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
|
@ -705,8 +689,6 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* <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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -728,8 +710,6 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* <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
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixPreservingVisitor)
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor, int, int, int, int)
|
||||
|
@ -755,8 +735,6 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index (inclusive)
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException if
|
||||
* the indices are not valid.
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
|
@ -785,8 +763,6 @@ public interface RealMatrix extends AnyMatrix {
|
|||
* @param endRow Final row index (inclusive)
|
||||
* @param startColumn Initial column index
|
||||
* @param endColumn Final column index (inclusive)
|
||||
* @throws org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
* @throws org.apache.commons.math.exception.OutOfRangeException if the
|
||||
* indices are not valid.
|
||||
* @see #walkInRowOrder(RealMatrixChangingVisitor)
|
||||
|
|
|
@ -44,8 +44,6 @@ 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 org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
*/
|
||||
double visit(int row, int column, double value);
|
||||
|
||||
|
|
|
@ -43,8 +43,6 @@ 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 org.apache.commons.math.exception.MathUserException if the visitor
|
||||
* cannot process an entry.
|
||||
*/
|
||||
void visit(int row, int column, double value);
|
||||
|
||||
|
|
|
@ -731,8 +731,6 @@ public abstract class RealVector {
|
|||
*
|
||||
* @param function Function to apply to each entry.
|
||||
* @return a new vector.
|
||||
* @throws org.apache.commons.math.exception.MathUserException
|
||||
* if the function throws it.
|
||||
*/
|
||||
public RealVector map(UnivariateRealFunction function) {
|
||||
return copy().mapToSelf(function);
|
||||
|
@ -750,8 +748,6 @@ public abstract class RealVector {
|
|||
*
|
||||
* @param function Function to apply to each entry.
|
||||
* @return a reference to this vector.
|
||||
* @throws org.apache.commons.math.exception.MathUserException
|
||||
* if the function throws it.
|
||||
*/
|
||||
public RealVector mapToSelf(UnivariateRealFunction function) {
|
||||
Iterator<Entry> it = (function.value(0) == 0) ? sparseIterator() : iterator();
|
||||
|
|
|
@ -972,7 +972,7 @@ public final class Array2DRowRealMatrixTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testWalk() throws MathUserException {
|
||||
public void testWalk() {
|
||||
int rows = 150;
|
||||
int columns = 75;
|
||||
|
||||
|
|
|
@ -1237,7 +1237,7 @@ public final class BlockFieldMatrixTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testWalk() throws MathUserException {
|
||||
public void testWalk() {
|
||||
int rows = 150;
|
||||
int columns = 75;
|
||||
|
||||
|
|
|
@ -1142,7 +1142,7 @@ public final class BlockRealMatrixTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testWalk() throws MathUserException {
|
||||
public void testWalk() {
|
||||
int rows = 150;
|
||||
int columns = 75;
|
||||
|
||||
|
|
|
@ -964,7 +964,7 @@ public final class FieldMatrixImplTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testWalk() throws MathUserException {
|
||||
public void testWalk() {
|
||||
int rows = 150;
|
||||
int columns = 75;
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.commons.math.linear;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -50,10 +49,9 @@ public class QRDecompositionImplTest {
|
|||
|
||||
private static final double normTolerance = 10e-14;
|
||||
|
||||
/** test dimensions
|
||||
* @throws MathUserException */
|
||||
/** test dimensions */
|
||||
@Test
|
||||
public void testDimensions() throws MathUserException {
|
||||
public void testDimensions() {
|
||||
checkDimension(MatrixUtils.createRealMatrix(testData3x3NonSingular));
|
||||
|
||||
checkDimension(MatrixUtils.createRealMatrix(testData4x3));
|
||||
|
@ -78,10 +76,9 @@ public class QRDecompositionImplTest {
|
|||
Assert.assertEquals(columns, qr.getR().getColumnDimension());
|
||||
}
|
||||
|
||||
/** test A = QR
|
||||
* @throws MathUserException */
|
||||
/** test A = QR */
|
||||
@Test
|
||||
public void testAEqualQR() throws MathUserException {
|
||||
public void testAEqualQR() {
|
||||
checkAEqualQR(MatrixUtils.createRealMatrix(testData3x3NonSingular));
|
||||
|
||||
checkAEqualQR(MatrixUtils.createRealMatrix(testData3x3Singular));
|
||||
|
@ -105,10 +102,9 @@ public class QRDecompositionImplTest {
|
|||
Assert.assertEquals(0, norm, normTolerance);
|
||||
}
|
||||
|
||||
/** test the orthogonality of Q
|
||||
* @throws MathUserException */
|
||||
/** test the orthogonality of Q */
|
||||
@Test
|
||||
public void testQOrthogonal() throws MathUserException {
|
||||
public void testQOrthogonal() {
|
||||
checkQOrthogonal(MatrixUtils.createRealMatrix(testData3x3NonSingular));
|
||||
|
||||
checkQOrthogonal(MatrixUtils.createRealMatrix(testData3x3Singular));
|
||||
|
@ -135,7 +131,7 @@ public class QRDecompositionImplTest {
|
|||
|
||||
/** test that R is upper triangular */
|
||||
@Test
|
||||
public void testRUpperTriangular() throws MathUserException {
|
||||
public void testRUpperTriangular() {
|
||||
RealMatrix matrix = MatrixUtils.createRealMatrix(testData3x3NonSingular);
|
||||
checkUpperTriangular(new QRDecompositionImpl(matrix).getR());
|
||||
|
||||
|
@ -159,7 +155,7 @@ public class QRDecompositionImplTest {
|
|||
|
||||
}
|
||||
|
||||
private void checkUpperTriangular(RealMatrix m) throws MathUserException {
|
||||
private void checkUpperTriangular(RealMatrix m) {
|
||||
m.walkInOptimizedOrder(new DefaultRealMatrixPreservingVisitor() {
|
||||
@Override
|
||||
public void visit(int row, int column, double value) {
|
||||
|
@ -170,10 +166,9 @@ public class QRDecompositionImplTest {
|
|||
});
|
||||
}
|
||||
|
||||
/** test that H is trapezoidal
|
||||
* @throws MathUserException */
|
||||
/** test that H is trapezoidal */
|
||||
@Test
|
||||
public void testHTrapezoidal() throws MathUserException {
|
||||
public void testHTrapezoidal() {
|
||||
RealMatrix matrix = MatrixUtils.createRealMatrix(testData3x3NonSingular);
|
||||
checkTrapezoidal(new QRDecompositionImpl(matrix).getH());
|
||||
|
||||
|
@ -197,7 +192,7 @@ public class QRDecompositionImplTest {
|
|||
|
||||
}
|
||||
|
||||
private void checkTrapezoidal(RealMatrix m) throws MathUserException {
|
||||
private void checkTrapezoidal(RealMatrix m) {
|
||||
m.walkInOptimizedOrder(new DefaultRealMatrixPreservingVisitor() {
|
||||
@Override
|
||||
public void visit(int row, int column, double value) {
|
||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.commons.math.linear;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.math.exception.MathUserException;
|
||||
import org.apache.commons.math.exception.MathIllegalArgumentException;
|
||||
|
||||
import org.junit.Test;
|
||||
|
@ -147,7 +146,7 @@ public class QRSolverTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testOverdetermined() throws MathUserException {
|
||||
public void testOverdetermined() {
|
||||
final Random r = new Random(5559252868205245l);
|
||||
int p = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
|
||||
int q = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
|
||||
|
@ -171,7 +170,7 @@ public class QRSolverTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testUnderdetermined() throws MathUserException {
|
||||
public void testUnderdetermined() {
|
||||
final Random r = new Random(42185006424567123l);
|
||||
int p = (5 * BlockRealMatrix.BLOCK_SIZE) / 4;
|
||||
int q = (7 * BlockRealMatrix.BLOCK_SIZE) / 4;
|
||||
|
|
Loading…
Reference in New Issue