Ralf Hemmecke wrote:
>
> Hi,
>
> DirectProducts can be created with the unitVector function.
>
> However, I find the respective condition in DirectProductCategory that
> the argument domain must be of type Ring a bit restrictive.
>
> https://github.com/hemmecke/fricas/blob/master-hemmecke/src/algebra/vector.spad#L276
>
> if R has Ring then
> BiModule(R, R)
> DifferentialExtension R
> FullyLinearlyExplicitRingOver R
> unitVector : PositiveInteger -> %
> ++ unitVector(n) produces a vector with 1 in position n and
> ++ zero elsewhere.
>
> What is needed for this function is 0 and 1 and that is clearly already
> in SemiRing or even in Join(AbelianMonoid, Monoid). And since nothing
> more is claimed for unitVector it would even be sufficient to do
> something lik
>
> ZeroOne ==> with (0: %, 1: %)
> if R has ZeroOne then
> unitVector : PositiveInteger -> %
> ++ unitVector(n) produces a vector with 1 in position n and
> ++ zero elsewhere.
>
> Given that NNI is used for exponent vectors, having unitVector exported
> wouldn't be that bad.
I have now commited a change to direct product. Using
'with (0: %, 1: %)' leads to troubles with Spad compiler.
'if R has AbelianMonoid and R has Monoid' works fine, so I
used this. I also generalized a few other operations.
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.