1function test60 2%TEST60 test min and max operators with NaNs 3 4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. 5% SPDX-License-Identifier: Apache-2.0 6 7fprintf ('min\n') ; 8for x = [3 nan inf] 9 for y = [3 nan inf -inf] 10 a = min (x, y); 11 c = min (x, y, 'includenan'); 12 b = GB_mex_op ('min', x, y) ; 13 fprintf ('x: %4g y: %4g matlab(omit): %4g matlab(incl): %4g GrB %4g match: %d\n', ... 14 x, y, a, c, b, isequalwithequalnans (a,b)) ; 15 end 16end 17 18fprintf ('\nmax\n') ; 19for x = [3 nan inf] 20 for y = [3 nan inf -inf] 21 a = max (x, y); 22 c = max (x, y, 'includenan'); 23 b = GB_mex_op ('max', x, y) ; 24 fprintf ('x: %4g y: %4g matlab(omit): %4g matlab(incl): %4g GrB %4g match: %d\n', ... 25 x, y, a, c, b, isequalwithequalnans (a,b)) ; 26 end 27end 28 29fprintf ('\ntest60: all tests passed\n') ; 30 31