Previous Next

Run All Correctness Tests

Syntax
all_ok

Test Utility Functions
test_path.m Set Up Path for Testing

Source Code
 
function [ok] = all_ok()
test_path;
ok = true;
t0 = cputime;
ok = ok & one_ok('affine_ok_box');
ok = ok & one_ok('blkdiag_mul_ok');
ok = ok & one_ok('blkdiag_mul_t_ok');
ok = ok & one_ok('kuhn_tucker_ok');
ok = ok & one_ok('newton_step_ok');
ok = ok & one_ok('get_started_ok');
ok = ok & one_ok('sumsq_grad_ok');
ok = ok & one_ok('sumsq_hes_ok');
ok = ok & one_ok('sumsq_obj_ok');
ok = ok & one_ok('tridiag_solve_ok');
ok = ok & one_ok('vanderpol_sim_ok');
ok = ok & one_ok('vanderpol_ok');
constraint={'no_constraint', 'box_constraint', 'sine_constraint'};
for c = 1 : 3
	if sine_wave_ok(constraint{c}, false)
		['Ok:    sine_wave_ok ', constraint{c}]
	else
		['Error: sine_wave_ok ', constraint{c}]
		ok = false
	end
end
% 
t1 = cputime;
if ok 
	disp(['All tests passed: cputime (secs) = ', num2str(t1-t0)]);
else
	disp(['One or more tests failed: cputime (secs) = ', num2str(t1-t0)]);
end
return
end
function [ok] = one_ok(name)
ok = feval(name);
if ok 
	['Ok:    ', name ]
else
	['Error: ', name ]
end
return
end

Input File: example/all_ok.m