diff options
| author | Gertjan van den Burg <burg@ese.eur.nl> | 2016-12-05 20:06:26 +0100 |
|---|---|---|
| committer | Gertjan van den Burg <burg@ese.eur.nl> | 2016-12-05 20:06:26 +0100 |
| commit | 463e406d4af8ad20a1ec2c3b9e01f3f80267c0dd (patch) | |
| tree | c263185666cc4abf474c9f53830de482ed3bcb79 /tests/aux | |
| parent | add octave testfiles to git (diff) | |
| download | gensvm-463e406d4af8ad20a1ec2c3b9e01f3f80267c0dd.tar.gz gensvm-463e406d4af8ad20a1ec2c3b9e01f3f80267c0dd.zip | |
fix missing test in gensvm_optimize and expose doublesort
Diffstat (limited to 'tests/aux')
| -rw-r--r-- | tests/aux/test_optimize.m | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/aux/test_optimize.m b/tests/aux/test_optimize.m index ecd10a3..deae960 100644 --- a/tests/aux/test_optimize.m +++ b/tests/aux/test_optimize.m @@ -27,6 +27,8 @@ set_vector(rho); V = [t'; W]; +assert_matrix(V, "model->V", "model->K-1"); + end function set_matrix(A) @@ -41,4 +43,15 @@ function set_vector(a) for i=1:numel(a) fprintf('A[%i] = %.16f;\n', i-1, a(i)); end +end + +function assert_matrix(A, name, cols) + for ii=1:size(A, 1) + for jj=1:size(A, 2) + fprintf(["mu_assert(fabs(matrix_get(%s, %s, %i, %i) -\n%.16f) <", ... + " eps,\n\"Incorrect %s at %i, %i\");\n"], name, cols, ... + ii-1, jj-1, A(ii, jj), name, ii-1, jj-1); + end + end + fprintf("\n"); end
\ No newline at end of file |
