Mon, 22 Jan 2018 18:23:25 +0200
added matrix all zero test
tests/subfiles.py | file | annotate | diff | comparison | revisions |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/subfiles.py Mon Jan 22 18:23:25 2018 +0200 @@ -0,0 +1,18 @@ +from testsuite import error + +def determinant_test(model): + yield from [ + error(subfile_reference, 'zero-determinant') + for subfile_reference in model.subfile_references + if abs(subfile_reference.matrix.determinant() - 0) < 1e-15 + ] + +manifest = { + 'tests': { + 'determinant': determinant_test, + }, + 'messages': { + 'zero-determinant': 'matrix determinant is zero ' + '(row or column all zero)', + }, +}