On 07/08/2010 03:42 PM, Waldek Hebisch wrote:
Ralf Hemmecke wrote:
remove__denoms : (VI, PPA, PPA, Integer) -> PPA
++ remove__denoms(offsets, nums, denoms, p) removes common
++ denominator from vectors of rational functions. Several
++ vectors of rational functions are packed into nums
++ (storing numerators) and dens (storing denomiantors)
++ Vector i starts at position offsets(i). Computations
++ are done modulo p.
Rational functions? All I can see is a PPA (PrimitiveArray U32Vector).
Where is the rational function type?
This package provides relatively low-level operations which are
"generic" in a sense that different high-level views lead to the
same low-level operations. I would appreciate any ideas how to
make types more specific but allow reuse and retain efficiency
(this code package is performance critical for modular computations).
Of course, I understand the performance issue, but my problem is that I
am unable to use it, because it is by no means clear from the
specification, what the actual input is.
This is one point. Making the specification clear, then there is not
really a need to put that information into the type, because of the low
level and the time critical behaviour of that function. But if we could
add types without losing speed that would of course be better. But
before I can think about something, I need a clear specification. For
example, I have the impression that you encode just univariate rational
functions, but I would also call elements of K(x,y,z) rational
functions. So it's unclear (to me at least).
Where is the description of the way you pack rational functions?
Rational functions are _not_ packed.
Uff, then I must have misinterpreted
>> ++ ... Several
>> ++ vectors of rational functions are packed into nums
>> ++ (storing numerators) and dens (storing denomiantors)
from above.
Each rational function is
stored as a pair of numerator and denominator. Both numerator
and denominator use type U32Vector and store all coefficient
of polynomial (coefficient number i is stored in element number i).
I think that's an important piece of information and should live in the
++ documentation.
As written in the description numerators and denominators are
stored in two parallel arrays: nums(j) give you numerator of
function number j, dens(j) gives you denominator.
Vectors of rational functions are packed. Packing is done in
obvous way: we store several vectors one after another.
So that is the usual way to store two-dimensional arrays of where sizes
are known.
The offsets tells you where each vector starts (this simultaneously
tells you where previous vector ended).
Ah, OK, I see, the rational functions might have different degrees. So
each of the subarrays might have different length matching the degree of
the respective polynomial.
May I ask about U32Vector? Why does this claim
OneDimensionalArrayAggregate(Integer) if the elements are assumed to be
32-bit integers? Why not U32Integer? Well, of course, one would have to
create that type.
I don't know yet exactly whether it would make sense to create a type of
univariate rational functions over PF(p) with the representation
Record(vi: Vector Integer, nums: PPA, dens: PPA)
The p would be stored in the type argument.
What do you think?
Ralf
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.