comparison scripts/statistics/ranks.m @ 31551:fd29c7a50a78 stable

maint: use commas, semicolons consistently with Octave conventions. * makeValidName.m: Remove %!test and move BIST %!asserts to column 1. * base64decode.m, base64encode.m, which.m, logm.m, uniquetol.m, perms.m: Delete semicolon (';') at end of %!assert BIST. * lin2mu.m, interp2.m, interpn.m, lsqnonneg.m, pqpnonneg.m, uniquetol.m, betainc.m, normalize.m: Add semicolon (';') to end of assert statement within %!test BIST. * __memoize__.m, tar_is_bsd.m, publish.m: Add semicolon (';') to line with keyword "persistent". * stft.m: Use comma (',') after "case" keyword when code immediately follows. * gallery.m: Align commas used in case statements in massive switch block. Remove unnecessary parentheses around a numeric case argument. * ranks.m: Remove semicolon (';') from case statemnt argument.
author Rik <rik@octave.org>
date Sat, 26 Nov 2022 06:32:08 -0800
parents 5d3faba0342e
children 597f3ee61a48
comparison
equal deleted inserted replaced
31549:ed7b17c7ddf3 31551:fd29c7a50a78
90 90
91 [sx, ids] = sort (x); # sx is sorted x. 91 [sx, ids] = sort (x); # sx is sorted x.
92 lin = repmat ((1:rows (x))', [1, sz(2:end)]); # linearly increasing array. 92 lin = repmat ((1:rows (x))', [1, sz(2:end)]); # linearly increasing array.
93 93
94 switch (rtype) 94 switch (rtype)
95 case {0, "fractional"}; 95 case {0, "fractional"}
96 lin = (_competition (lin, sx, sz) + _modified (lin, sx, sz)) / 2; 96 lin = (_competition (lin, sx, sz) + _modified (lin, sx, sz)) / 2;
97 case {1, "competition"}; 97 case {1, "competition"}
98 lin = _competition (lin, sx, sz); 98 lin = _competition (lin, sx, sz);
99 case {2, "modified"}; 99 case {2, "modified"}
100 lin = _modified (lin, sx, sz); 100 lin = _modified (lin, sx, sz);
101 case {3, "ordinal"}; 101 case {3, "ordinal"}
102 ## no processing needed here. 102 ## no processing needed here.
103 case {4, "dense"}; 103 case {4, "dense"}
104 lin = _dense (lin, sx, sz); 104 lin = _dense (lin, sx, sz);
105 otherwise 105 otherwise
106 if (! ischar (rtype)) 106 if (! ischar (rtype))
107 rtype = num2str (rtype); 107 rtype = num2str (rtype);
108 endif 108 endif