| 1 |
% Copyright © 2021-2023 Dynare Team |
| 2 |
% |
| 3 |
% This file is part of Dynare. |
| 4 |
% |
| 5 |
% Dynare is free software: you can redistribute it and/or modify |
| 6 |
% it under the terms of the GNU General Public License as published by |
| 7 |
% the Free Software Foundation, either version 3 of the License, or |
| 8 |
% (at your option) any later version. |
| 9 |
% |
| 10 |
% Dynare is distributed in the hope that it will be useful, |
| 11 |
% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
% GNU General Public License for more details. |
| 14 |
% |
| 15 |
% You should have received a copy of the GNU General Public License |
| 16 |
% along with Dynare. If not, see <https://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
source_dir = getenv('source_root'); |
| 19 |
addpath([source_dir filesep 'matlab']); |
| 20 |
|
| 21 |
dynare_config |
| 22 |
|
| 23 |
cd kronecker |
| 24 |
|
| 25 |
disp('**** Testing sparse_hessian_times_B_kronecker_C MEX...') |
| 26 |
disp('') |
| 27 |
disp('** Test 1') |
| 28 |
info(1) = test_kron(1, num_procs); |
| 29 |
disp('') |
| 30 |
disp('** Test 2') |
| 31 |
info(2) = test_kron(2, num_procs); |
| 32 |
disp('') |
| 33 |
disp('**** Testing A_times_B_kronecker_C MEX...') |
| 34 |
info(3) = test_kron(3, num_procs); |
| 35 |
|
| 36 |
num_failed_tests = sum(~info); |
| 37 |
tests = { 'sparse1', 'sparse2', 'dense' }; |
| 38 |
failed_tests = tests(find(~info)); |
| 39 |
|
| 40 |
if num_failed_tests > 0 |
| 41 |
fprintf('\n*** Failed tests: %s\n', failed_tests{:}) |
| 42 |
end |
| 43 |
|
| 44 |
quit(num_failed_tests > 0) |