On Sat, Apr 30, 2022 at 04:15:46PM +0200, Kurt Pagani wrote:
> In the meantime I've been trying to rewrite some
> functions avoiding XDP, i.e. just using Free-Monoid/Module. In the course of
> this I found the following peculiarity when using listOfTerms/construct:
> 
> R:=EXPR INT
> FMR:=FreeModule(R,Symbol)
> [a,b,c]:=[s::FMR for s in [a,b,c]]
> T:=a+b+c
> lT:=listOfTerms T
> clT:=concat(lT,lT)
> c1:=construct(clT)$FMR
> c2:=constructOrdered(clT)$FMR
> c1+c2
> c1-c2
> c1-c1
> c1+c1
> --- better!
> d1:=reduce(_+,[construct([s])$FMR for s in clT])
> d1-d1
> d1+d1
> 
> Apparently it's favourable to construct each term as the single member of a
> list, otherwise the collection/simpl procedure seems to be puzzled (like me).
> Is this intentional?

ATM 'construct' assume that you give it valid term list, that is
k-coordinates are different.  'construct' will (if needed) sort the
list for you, 'constructOrdered' assumes that list is already
sorted.  Both 'construct' and 'constructOrdered' are speed hacks,
for people who know what they are doing.

-- 
                              Waldek Hebisch

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/20220430213108.GA15573%40fricas.math.uni.wroc.pl.

Reply via email to