/**
* Test vector product exceptions.
*/
public void testVectorProductExceptions() {
try {
new MathVector(2).vectorProduct(new MathVector(3));
fail();
} catch (MatrixException e) {
assertTrue(true);
} catch (Exception e) {
fail();
}
// The cross product is only defined in 3 and 7 dimensions. Thus 2 and 4
// dimensions must yield an error!
try {
new MathVector(2).vectorProduct(new MathVector(2));
assertTrue(
"The cross-product isn't really defined in two-dimensional space. ",
false);
} catch (MatrixException e) {
assertTrue(true);
} catch (Exception e) {
fail();
}
try {
new MathVector(4).vectorProduct(new MathVector(4));
assertTrue("The cross-product isn't really defined for dimensions other"
+ "than three and seven.", false);
} catch (MatrixException e) {
assertTrue(true);
} catch (Exception e) {