Skip to content

Commit 954086d

Browse files
committed
Function `YF: skipping / non-skipping
`YF`: With two outputs, primes that are not factors are skipped, together with thier (zero) exponents. If the input contains at least a negative entry the behaviour is changed: primes are skipped if one output, and are not skipped if two outputs.
1 parent 3bd98f4 commit 954086d

File tree

8 files changed

+7
-7377
lines changed

8 files changed

+7
-7377
lines changed

funDef.mat

291 Bytes
Binary file not shown.

funDef.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,8 @@ YE
701701
ZE
702702
F
703703
XF
704-
YF 1 1 1 1 2 1 2 true true true true f = arrayfun(@factor, in{1}, 'uniformoutput', false); Exponents of prime factor decomposition (i) With $1$ output: exponents of prime factor decomposition, without skipping primes. If the input is a numeric array it is linearized, and each result is in an output row. (ii) With $2$ outputs: first output gives the prime factors, second is as before. \sa \matl+Yf+
704+
YF 1 1 1 1 2 1 2 true true true true trim = (any(in{1}<0) && (nout==1)) || (~any(in{1}<0) && (nout==2)); in{1} = abs(in{1}); Exponents of prime factor decomposition (i) With $1$ output: exponents of prime factor decomposition, without skipping primes. If the input is a numeric array it is linearized, and each result is in an output row. If any entry in the input is negative, the absolute value is taken, and the output contains only non-zero exponents. (ii) With $2$ outputs: first output gives the prime factors, second gives the exponents. Primes that are not factors are skipped, as are their zero exponents. If any entry in the input is negative, the absolute value is taken, and all intermediate primes are included, possibly with zero exponents. \sa \matl+Yf+
705+
f = arrayfun(@factor, in{1}, 'uniformoutput', false);
705706
p = primes(max([f{:}]));
706707
y = zeros(numel(f), numel(p));
707708
for k = 1:numel(f);
@@ -711,7 +712,8 @@ YF 1 1 1 1 2 1 2 true true true true f = arrayfun(@factor, in{1}, 'uniformoutpu
711712
elseif nout==2, out = {p, y};
712713
else error('MATL:runtime', 'MATL run-time error: number of outputs not supported');
713714
end
714-
clear f p y k
715+
if trim, out = cellfun(@(c) c(:, any(y>0, 1)), out, 'UniformOutput', false); end
716+
clear f p y k trim
715717
ZF
716718
G 0 1 double(numel(CB_G)>1) 0 0 inf 1+(max(numel(CB_G),1)-1)*(numel(in)==0) true true false true if numel(CB_G)==0 paste from user-input clipboard G paste from user-input clipboard G. If $0$ input arguments: addresses all levels. If $1$ input argument: addresses specified level. In either of those cases, if clipboard G has no levels one user-input is implicitly taken to fill the first level
717719
implInput = input(implicitInputPrompt,'s');

help.mat

210 Bytes
Binary file not shown.

spec/MATL_spec.pdf

5 Bytes
Binary file not shown.

spec/functionTable/MATL.xlsx

28 Bytes
Binary file not shown.

spec/functionTable/function_table.eps

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
5 Bytes
Binary file not shown.

spec/functionTable/tmp

Lines changed: 0 additions & 7372 deletions
This file was deleted.

0 commit comments

Comments
 (0)