login  home  contents  what's new  discussion  bug reports help  links  subscribe  changes  refresh  edit

Note: Common denominator in FriCAS is extended in such a way.

This package extends UnivariatePolynomialCommonDenominator? for arbitrary polynomial categories. In fact, I don't understand why the original package is so restrictive.

)abbrev package PCDEN PolynomialCommonDenominator
PolynomialCommonDenominator(R, Q, P, E, VarSet): Exports == Impl where
R : IntegralDomain
Q : QuotientFieldCategory R
E : OrderedAbelianMonoidSup
VarSet: OrderedSet
P: PolynomialCategory(Q, E,VarSet)
Exports ==> with
commonDenominator: P -> R
++ commonDenominator(q) returns a common denominator d for
++ the coefficients of q.
clearDenominator : P -> P
++ clearDenominator(q) returns p such that \spad{q = p/d} where d is
++ a common denominator for the coefficients of q.
splitDenominator : P -> Record(num: P, den: R)
++ splitDenominator(q) returns \spad{[p, d]} such that \spad{q = p/d} and d
++ is a common denominator for the coefficients of q.
import CommonDenominator(R, Q, List Q)
commonDenominator p == commonDenominator coefficients p
clearDenominator p ==
d := commonDenominator p
map(numer(d * #1)::Q, p)
splitDenominator p ==
d := commonDenominator p
[map(numer(d * #1)::Q, p), d]
   Compiling FriCAS source code from file
using old system compiler.
PCDEN abbreviates package PolynomialCommonDenominator
------------------------------------------------------------------------
initializing NRLIB PCDEN for PolynomialCommonDenominator
compiling into NRLIB PCDEN
importing CommonDenominator(R,Q,List Q)
compiling exported commonDenominator : P -> R
Time: 0.05 SEC.
compiling exported clearDenominator : P -> P
Time: 0 SEC.
compiling exported splitDenominator : P -> Record(num: P,den: R)
Time: 0 SEC.
(time taken in buildFunctor:  0)
;;;     ***       |PolynomialCommonDenominator| REDEFINED
;;;     ***       |PolynomialCommonDenominator| REDEFINED
Time: 0.01 SEC.
Cumulative Statistics for Constructor PolynomialCommonDenominator
Time: 0.06 seconds
finalizing NRLIB PCDEN
Processing PolynomialCommonDenominator for Browser database:
--------(commonDenominator (R P))---------
--------(clearDenominator (P P))---------
--------(splitDenominator ((Record (: num P) (: den R)) P))---------
; compiling file "/var/aw/var/LatexWiki/PCDEN.NRLIB/PCDEN.lsp" (written 07 MAY 2016 12:57:05 PM):
; /var/aw/var/LatexWiki/PCDEN.NRLIB/PCDEN.fasl written
; compilation finished in 0:00:00.038
------------------------------------------------------------------------
PolynomialCommonDenominator is now explicitly exposed in frame
initial
PolynomialCommonDenominator will be automatically loaded when needed
from /var/aw/var/LatexWiki/PCDEN.NRLIB/PCDEN

Example use:

fricas
)set mess type off
dom:=DMP([x,y], FRAC DMP([z],INT));
p:dom:=x*y^3/(z^2-1) + 3*x*y/(z^3-1)
 (1)
fricas
commonDenominator p
 (2)
fricas
clearDenominator p
 (3)
fricas
splitDenominator p
 (4)

 Subject:   Be Bold !! ( 13 subscribers )