/usr/share/octave/packages/interval-3.1.0/test/mpfr_vector_dot_d.cc-tst is in octave-interval 3.1.0-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | ## DO NOT EDIT! Generated automatically from src/mpfr_vector_dot_d.cc
%!test;
%! [l, u] = mpfr_vector_dot_d (-1, -1, 2, 3, 1);
%! assert (l, -3);
%! assert (u, 6);
%!test;
%! x = [realmax, realmax, -realmax, -realmax, 1, eps/2];
%! y = ones (size (x));
%! [l, u] = mpfr_vector_dot_d (x, y, x, y, 2);
%! d = mpfr_vector_dot_d (0.5, x, y, 2);
%! assert (l, 1);
%! assert (u, 1 + eps);
%! assert (ismember (d, infsup (l, u)));
%!test;
%! [l, u] = mpfr_vector_dot_d (0, 0, inf, inf, 1);
%! d = mpfr_vector_dot_d (0.5, 0, inf, 1);
%! assert (l, 0);
%! assert (u, inf);
%! assert (isequaln (d, NaN));
%!test;
%! x = reshape (1:24, 2, 3, 4);
%! y = 2.*ones (2, 3, 4);
%! [l u] = mpfr_vector_dot_d (x, y, x, y, 3);
%! d = mpfr_vector_dot_d (0.5, x, y, 3);
%! assert (l, [80, 96, 112; 88, 104, 120]);
%! assert (u, [80, 96, 112; 88, 104, 120]);
%! assert (d, [80, 96, 112; 88, 104, 120]);
%!shared testdata
%! # Load compiled test data (from src/test/*.itl)
%! testdata = load (file_in_loadpath ("test/itl.mat"));
%!test
%! # Scalar evaluation
%! testcases = testdata.NoSignal.double.dot_nearest;
%! for testcase = [testcases]'
%! assert (isequaln (...
%! mpfr_vector_dot_d (0.5, testcase.in{1}, testcase.in{2}, 2), ...
%! testcase.out));
%! endfor
%!test
%! # Vector evaluation
%! testcases = testdata.NoSignal.double.dot_nearest;
%! in1 = vertcat (testcases.in)(:, 1);
%! in1 = cell2mat (cellfun ("postpad", in1, {(max (cellfun ("numel", in1)))}, "UniformOutput", false));
%! in2 = vertcat (testcases.in)(:, 2);
%! in2 = cell2mat (cellfun ("postpad", in2, {(max (cellfun ("numel", in2)))}, "UniformOutput", false));
%! out = vertcat (testcases.out);
%! assert (isequaln (mpfr_vector_dot_d (0.5, in1, in2, 2), out));
%!test
%! # Scalar evaluation
%! testcases = testdata.NoSignal.double.sum_sqr_nearest;
%! for testcase = [testcases]'
%! assert (isequaln (...
%! mpfr_vector_dot_d (0.5, testcase.in{1}, testcase.in{1}, 2), ...
%! testcase.out));
%! endfor
%!test
%! # Vector evaluation
%! testcases = testdata.NoSignal.double.sum_sqr_nearest;
%! in1 = vertcat (testcases.in);
%! in1 = cell2mat (cellfun ("postpad", in1, {(max (cellfun ("numel", in1)))}, "UniformOutput", false));
%! out = vertcat (testcases.out);
%! assert (isequaln (mpfr_vector_dot_d (0.5, in1, in1, 2), out));
|