-- Bugfix #3072: As discussed on IRC, matrix.invert() should throw a

ValueError exception if matrix is singular.
This commit is contained in:
Ken Hughes
2005-12-05 19:57:23 +00:00
parent e209676d3d
commit 1a2ac4e64d
2 changed files with 8 additions and 6 deletions

View File

@@ -653,19 +653,19 @@ class Quaternion:
def negate():
"""
Set the quaternion to it's negative.
Set the quaternion to its negative.
@return: a copy of itself
"""
def conjugate():
"""
Set the quaternion to it's conjugate.
Set the quaternion to its conjugate.
@return: a copy of itself
"""
def inverse():
"""
Set the quaternion to it's inverse
Set the quaternion to its inverse
@return: a copy of itself
"""
@@ -762,7 +762,7 @@ class Matrix:
def transpose():
"""
Set the matrix to it's transpose.
Set the matrix to its transpose.
@return: a copy of itself
"""
@@ -775,8 +775,9 @@ class Matrix:
def invert():
"""
Set the matrix to it's inverse.
Set the matrix to its inverse.
@return: a copy of itself
@raise ValueError: When matrix is singular.
"""
def rotationPart():

View File

@@ -228,7 +228,8 @@ PyObject *Matrix_Invert(MatrixObject * self)
//transpose
//Matrix_Transpose(self);
} else {
printf("Matrix.invert: matrix does not have an inverse\n");
return EXPP_ReturnPyObjError(PyExc_ValueError,
"matrix does not have an inverse");
}
return EXPP_incr_ret((PyObject*)self);
}