exceptions.py 503 B

1234567891011121314151617181920212223242526
  1. """
  2. Exceptions raised by the matrix module.
  3. """
  4. class MatrixError(Exception):
  5. pass
  6. class ShapeError(ValueError, MatrixError):
  7. """Wrong matrix shape"""
  8. pass
  9. class NonSquareMatrixError(ShapeError):
  10. pass
  11. class NonInvertibleMatrixError(ValueError, MatrixError):
  12. """The matrix in not invertible (division by multidimensional zero error)."""
  13. pass
  14. class NonPositiveDefiniteMatrixError(ValueError, MatrixError):
  15. """The matrix is not a positive-definite matrix."""
  16. pass