https://github.com/oldk1331/fricas/commit/32c831064c33084ce39a59ab1c3af47c39c8ae6c.patch
diff --git a/src/algebra/fr.spad b/src/algebra/fr.spad
index 36cbe7b7..7d4589e2 100644
--- a/src/algebra/fr.spad
+++ b/src/algebra/fr.spad
@@ -60,7 +60,7 @@
++ a single factor whose base is asserted to be irreducible
++ (flag = "irred").
- numberOfFactors : % -> NonNegativeInteger
+ numberOfFactors : % -> NonNegativeInteger
++ numberOfFactors(u) returns the number of factors in \spadvar{u}.
primeFactor : (R, Integer) -> %
@@ -179,7 +179,7 @@
unit u == u.unt
numberOfFactors u == # u.fct
0 == [1, [["nil", 0, 1]$FF]]
- zero? u == # u.fct = 1 and
+ zero? u == size?(u.fct, 1) and
first(u.fct).flag case "nil" and
zero? first(u.fct).factor and
(u.unt = 1)
@@ -376,7 +376,7 @@
unitNormalize mkFF(1, [[fl, r, i]$FF])
differentiate(u : %, deriv : R -> R) ==
- ans := deriv(unit u) * ((u exquo unit(u)::%)::%)
+ ans := deriv(unit u) * mkFF(1, factorList u)
ans + (_+/[fact.exponent * deriv(fact.factor) *
((u exquo nilFactor(fact.factor, 1))::%) for fact in factorList u])
@@ -463,8 +463,8 @@
if R has UniqueFactorizationDomain then
prime? u ==
- not(empty?(l := factorList u)) and (empty? rest l) and
- (l.first.exponent = 1) and (l.first.flag case "prime")
+ l := factorList u
+ size?(l, 1) and (l.first.exponent = 1) and (l.first.flag
case "prime")
)abbrev package FRUTIL FactoredFunctionUtilities
++ Author:
@@ -503,8 +503,8 @@
u := u*unit(fitem) ^ (item.exponent :: NonNegativeInteger)
if item.exponent = 1 then
l := concat(factorList fitem, l)
- else l := concat([[v.flag, v.factor, v.exponent*item.exponent]
- for v in factorList fitem], l)
+ else l := concat!([[v.flag, v.factor, v.exponent * item.exponent]
+ for v in factorList fitem], l)
makeFR(u, l)
)abbrev package FR2 FactoredFunctions2
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.