Discussion:
functorial composition of cycle index series
Ralf Hemmecke
2007-03-12 01:17:36 UTC
Permalink
Hello,

I've just commited a firstversion of "functorialCompose" for cycle index
series. It's probably very buggy, but I wanted to get it out, because
I'll probably cannot work on it in the next few days and because it is
rather late now.

Sorry, but testcases are not really supplied, only templates for them.
And they currently even lack the correct values. If someone supplies a
couple of tests for functorial compose, that would be fine and would
make bug hunting a lot easier.

Apropos bugs... I certainly left a number of them in the code, but the
documentation is rather complete so that it should be easy to follow my
thoughts. (I tried to make the code very close to the formulas BLL.) If
a second person could look through the code that would make two eyes
more to spot nasty bugs.

I hope, you like it.

Ralf

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-12 10:34:33 UTC
Permalink
Dear Ralf,
Post by Ralf Hemmecke
I've just commited a firstversion of "functorialCompose" for cycle index
series. It's probably very buggy, but I wanted to get it out,
That's very wise. Thank's a lot.
Post by Ralf Hemmecke
Sorry, but testcases are not really supplied, only templates for them. And
they currently even lack the correct values. If someone supplies a couple of
tests for functorial compose, that would be fine and would make bug hunting a
lot easier.
I started to fill in the values from Appendix 2 of BLL. Yes, the tests
fail. I'll have a look.

Many many thanks,

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-12 18:14:29 UTC
Permalink
Hi Martin
welche Version von combinat verwendest Du da? Es sollten nur vier Tests
schiefgehen! (Versuch mal rev 177 von trunk oder 179 von iso-experiment)
Revision 180 braucht 32 Sekunden.
Yes, now AC can compute cycle index series of simple graphs up to order
6. BTW, I've just commited corrections of my previous extensions to
degree 6. And believe it or not AC is now more correct than my version
of BLL. There is an obvious typo in Z_{Graph}. They give a term

64/9 x_1^3 x_2

for in the "degree 6" polynomial. AC computes x_3 instead of x_2.
Ja, wenn man bei n=7, i.e., 1044 Graphen mit 7 Knoten aufhört.
So that doesn't make me too happy. :-(
Nich so schlimm. Wir müssen eh noch nach Bugs suchen.
Welchen bugs? Bei mir funktionieren alle Tests?
At least I am satisfied that functorial compose seems to work correctly.
More tests are welcome!!!

But we have

| | assertEquals( 1, 1 ) succeeded
| | assertEquals( 1, 1 ) succeeded
| | assertEquals( 2, 2 ) succeeded
| | assertEquals( 8, 8 ) succeeded
| |
| | failing, because an exception occurred in the test function !
| | Type:
| | RuntimeError()
| | Presentation:
| | (Aldor error) Reached a "never"
| |
| | ----------------------
| | calling tearDown function
| | tearDown function finished
| +--- end of test : testFunctorialCompose( test failed )
and that looks like ... oh... no, the iso-type generation is wrong.
Well, that is as expected.

Ralf


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-12 19:29:52 UTC
Permalink
Post by Ralf Hemmecke
Yes, now AC can compute cycle index series of simple graphs up to order
6. [...] And believe it or not AC is now more correct than my version of
BLL. There is an obvious typo in Z_{Graph}. They give a term
64/9 x_1^3 x_2
for in the "degree 6" polynomial. AC computes x_3 instead of x_2.
cute. Well, Hornegger and Pirastu confirm AC...
Post by Ralf Hemmecke
Ja, wenn man bei n=7, i.e., 1044 Graphen mit 7 Knoten aufhört.
So that doesn't make me too happy. :-(
Maybe it is possible to speed things up. Although Hornegger and Pirastu can go
much further, one has to keep in mind that they only implemented the formula,
and cannot do the general case.

I think you should stop here, what concerns functorial composition. There are
too many other interesting projects out there. If you really want to speed
things up, a profiler would be very nice. It's a pity, Axiom has a wonderful
|aldorTrace| is invalid as a function.

In any case, I would like to send you (and again, Christian Aistleitner &
AldorUnit, indispensible for debugging) a big THANK YOU! YOu did a wonderful
job!
Post by Ralf Hemmecke
But we have
| | failing, because an exception occurred in the test function !
| | RuntimeError()
| | (Aldor error) Reached a "never"
| |
| | ----------------------
| | calling tearDown function
| | tearDown function finished
| +--- end of test : testFunctorialCompose( test failed )
and that looks like ... oh... no, the iso-type generation is wrong. Well, that
is as expected.
Yes. That is another *huge* project. It would be nice to have a brute force
approach here. But to this end, I guess, we need to settle isomorphismtypes in
general first.

In fact, I think that functorial composition might be a heavy argument for your
approach to isotypes as representatives...

Consider Graphs:

P[P2 [1,2,3,4]] =

P[12, 13, 14, 23, 24, 34] =

()

(12) (13) (14) (23) (24) (34)

(12 13) (12 14) (12 23) (12 24) (12 34) (13 14) (13 23) (13 24) (13 34)
(14 23) (14 24) (14 34) (23 24) (23 34) (24 34)

...

Now, how are we going to represent isotypes of graphs? We raised that question
already once: simply replacing labels with dots does not work...

So, maybe we could have

structures: (Tuple SetSpecies L, Tuple Boolean) -> Generator %

where the second - optional - argument indicates which variables should be
generated "unlabelled". I must admit that I don't like that either. But at
least it takes away the burden to generate labels!

-------------------------------------------------------------------------------

In a private mail you suggested to define

CombinatorialSpecies: L: LabelType -> T: Tuple(L) ->
CombinatorialSpeciesCategory(L)(T)

I do not understand: a CombinatorialSpecies takes a LabelType and produces a
function from Tuple L to CombinatorialSpeciesCategory(L)(T)? Maybe you could
give a possible signature for structures and a type for generatingSeries?

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-12 20:44:25 UTC
Permalink
Post by Martin Rubey
Post by Ralf Hemmecke
Yes, now AC can compute cycle index series of simple graphs up to order
6. [...] And believe it or not AC is now more correct than my version of
BLL. There is an obvious typo in Z_{Graph}. They give a term
64/9 x_1^3 x_2
for in the "degree 6" polynomial. AC computes x_3 instead of x_2.
cute. Well, Hornegger and Pirastu confirm AC...
Ah, that means you managed to do

)co functori

?
Post by Martin Rubey
Post by Ralf Hemmecke
Ja, wenn man bei n=7, i.e., 1044 Graphen mit 7 Knoten aufhört.
So that doesn't make me too happy. :-(
Maybe it is possible to speed things up. Although Hornegger and Pirastu can go
much further, one has to keep in mind that they only implemented the formula,
and cannot do the general case.
What do you want to say by "cannot do the general case"?
Post by Martin Rubey
I think you should stop here, what concerns functorial composition. There are
too many other interesting projects out there. If you really want to speed
things up, a profiler would be very nice. It's a pity, Axiom has a wonderful
|aldorTrace| is invalid as a function.
Christian, do you have some experience with gprof? I don't want you to
do the profiling but rather have someone who shares some experience that
I could learn from.

Ralf


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-12 21:13:57 UTC
Permalink
Post by Ralf Hemmecke
Post by Martin Rubey
Well, Hornegger and Pirastu confirm AC...
Ah, that means you managed to do
)co functori
?
No, Hornegger and Pirastu implement the formula for the cycle index series for
graphs from BLL.

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Christian Aistleitner
2007-03-13 08:05:35 UTC
Permalink
Hello,
Post by Ralf Hemmecke
Post by Martin Rubey
Maybe it is possible to speed things up.
Christian, do you have some experience with gprof? I don't want you to
do the profiling but rather have someone who shares some experience that
I could learn from.
I guess that according to the mail (which I cannot find on the sourceforge
archive (yet)) with subject "speed of functorial compose" sent by Ralf it
seems the actual problem has already been solved or rather clairified.
Nevertheless, I worked with gprof some time ago. But I am no expert.
However, from the Aldor-compiler generated C code I read, I guess it is a
complete nightmare to profile Aldor code.
At any rate, if you need help to setup or walk through this nightmare,
just tell me ;)

Kind regards,
Christian

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-12 22:31:30 UTC
Permalink
Post by Martin Rubey
In fact, I think that functorial composition might be a heavy argument for your
approach to isotypes as representatives...
Ah. Finally, you begin to agree with me. ;-)
Post by Martin Rubey
P[P2 [1,2,3,4]] =
P[12, 13, 14, 23, 24, 34] =
()
(12) (13) (14) (23) (24) (34)
(12 13) (12 14) (12 23) (12 24) (12 34) (13 14) (13 23) (13 24) (13 34)
(14 23) (14 24) (14 34) (23 24) (23 34) (24 34)
Now, how are we going to represent isotypes of graphs? We raised that question
already once: simply replacing labels with dots does not work...
Yep. If people draw unlabelled graphs they take some "positions" and
then draw the edges that belong to the graph. But, hey, "positions" must
be distinguishable. So they are labelled in some sense although you
don't actually see a label. One can think of the (x,y) coordinates as
their labels.
Post by Martin Rubey
So, maybe we could have
structures: (Tuple SetSpecies L, Tuple Boolean) -> Generator %
where the second - optional - argument indicates which variables should be
generated "unlabelled". I must admit that I don't like that either. But at
least it takes away the burden to generate labels!
I don't understand what you mean by "generate labels" if you look at the
current signature of isomorphismTypes you find

SetSpecies L -> Generator %

the same as for "structures". There is no need to generate (extra)
labels. But you probably rather want

Integer -> Generator %.

Then you would need a function "elements: Integer -> Generator L" which
generates exactly the number of labels you need.
Post by Martin Rubey
-------------------------------------------------------------------------------
In a private mail you suggested to define
CombinatorialSpecies: L: LabelType -> T: Tuple(L) ->
CombinatorialSpeciesCategory(L)(T)
I do not understand: a CombinatorialSpecies takes a LabelType and produces a
function from Tuple L to CombinatorialSpeciesCategory(L)(T)? Maybe you could
give a possible signature for structures and a type for generatingSeries?
Forget about that. I rather meant

MultisortSpecies: (L: Tuple LabelType) -> MultiSortSpeciesCategory L.

Or maybe replace Tuple by Array.
The reason for this structure is that I want functorial composition to
be simple. Look at the definition of functorial composition as we have
it now. You find

FunctorialCompose(
F: SPECIES,
G: SPECIES
)(L: LabelType): CombinatorialSpecies(L) == add {
Rep == F G L;
import from Rep;
<<implementation: FunctorialCompose>>
}

Now my vision for multisort functorial compose is

macro MSPECIES==(L: Tuple LabelType)->MultisortSpeciesCategory L;
FunctorialCompose(
F: MSPECIES,
G: Tuple MSPECIES
)(L: Tuple LabelType): MultisortSpeciesCategory L == add {
Rep == F(G1(L), G2(L), ..., Gn(L));
...
}

Of course, it does not exactly work as above, but it should be *very*
close to it. In order to resolve the (G1,...,Gn), it would be perhaps
worthwhile to think of a function

Integer -> MSPECIES

instead of

Tuple MSPECIES

So perhaps

macro MSPECIES==(L: Integer->LabelType)->MultisortSpeciesCategory L;
FunctorialCompose(
F: MSPECIES,
G: Integer -> MSPECIES
)(L: Integer -> LabelType): MultisortSpeciesCategory L == add {
Rep == F((n: Integer) +-> G(L n));
...
}

could be extended to some working code. (All modulo the hope that the
Aldor compiler doesn't produce trash from that really heavy definition.)

Ralf

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-13 00:52:32 UTC
Permalink
I have running time 32 seconds for the whole test suite.
Post by Martin Rubey
Post by Ralf Hemmecke
Ja, wenn man bei n=7, i.e., 1044 Graphen mit 7 Knoten aufhört.
So that doesn't make me too happy. :-(
Maybe it is possible to speed things up.
Hmm, I have some suspicion... The functions "cycleType" as well as
"cycleTypePower" have the code wrapped by one and two BugWorkaround
macros respectively.

macro BugWorkaround(CONDITION)(CODE) == {
assert(CONDITION);
if CONDITION then CODE else never;
}

The condition is tested even two times. Actually, the compiler should
know at compile time that the condition is true. Unfortunately, it is
not yet smart enough.

However, I haven't really checked if that is the source of the speed
problem. But it certainly is an eventually unnecessary runtime penalty.

Ralf


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-13 02:34:59 UTC
Permalink
Hello,

I've found the problem with the seemingly slow functorial compose.
In the middle of the computation of functorialCompose(f,g), there is a
need to compute

count(f, t)

for t=x4^1*x8^3

That is obviously of degree 4+8*3=28. So AC computes the cycle index
series of f up to that degree. And that causes all the delay. Since f is
the Series of subsets we could probably save some time in implementing
Subsets directly without going through E*E, but there will be other
species then with the same problem.

The second thing is that we run on -q1 -DDEBUG, so that is probably
another factor that causes delay.

Have a good morning.

Ralf

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-13 08:23:37 UTC
Permalink
Dear Ralf,
Post by Ralf Hemmecke
I've found the problem with the seemingly slow functorial compose.
In the middle of the computation of functorialCompose(f,g), there is a
need to compute
count(f, t)
for t=x4^1*x8^3
A little more information would have saved me half an hour :-)

So, spelled out, with a smaller example:


f= Subset, g= Combination(2), f\square g = Graph

Z=Z_{f\square g}

n=4

We have to compute, for example, the coefficient of x1*x3 in Z. Thus
sigma=(1,0,1). We first need to compute

(g[sigma])_1, (g[sigma])_2, (g[sigma])_3.

Computational effort for this increases reasonably as n gets larger: it
involves coefficients in Z_g of degree at most n. In this case, the result
turns out to be (0,0,2). Now, however, we have to compute

f[(0,0,2)]

which is slow, since the degree is not bounded by n anymore, but rather by ???
(shouldn't be too difficult to get a bound here, but I'm lazy)


I see one possible *major* speedup: although we need many (all?) coefficients
of degree n of Z_g, we need only very few coefficients of Z_f, albeit of high
degree. So, possibly it makes sense to compute only these coefficients, rather
than the whole thing here.


-- Idea 1 ---------------------------------------------------------------------
A possible approach to do that *might* also yield a brute force approach of
generating isotypes. I'll give an example:

To compute the coefficient of x3^2/aut(0,0,2) in Z_f, we generate a permutation
of cycle type (0,0,2). Any permutation will do, so we take (1 2 3) (4 5 6). Now
we have to find all f-structures on {1,2,3,4,5,6} that are fixed points under
this permutation. In the present case (f = Subset), we obtain

{}, {1 2 3}, {4 5 6}, {1 2 3 4 5 6}

(More thinking is needed to see *how* to obtain these fixed points...)

So the coefficient we were looking for equals 4.

-- Idea 2 ---------------------------------------------------------------------

Similar to the current approach in AC of computing cycle index series via, it
might be possible to compute only certain coefficients of the cycle index
series.

But I do not have the time right now to see whether this is really doable...
Post by Ralf Hemmecke
The second thing is that we run on -q1 -DDEBUG, so that is probably another
factor that causes delay.
Yes, but almost certainly only a constant factor, not an exponential increase.

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-13 08:48:06 UTC
Permalink
Sorry for following up on my own mail...
Post by Martin Rubey
-- Idea 2 ---------------------------------------------------------------------
Similar to the current approach in AC of computing cycle index series via, it
might be possible to compute only certain coefficients of the cycle index
series.
So, I tried the easiest non-trivial example, namely that of Times:

We'd have

[x^\sigma] Z_{f*g} = \sum_{\tau <= \sigma} [x^\tau] Z_f [x^{\sigma-\tau}] Z_g

where

* \sigma is a cycle type

* x^\sigma = x1^{\sigma_1} x2^{\sigma_2} ...

* [x^\sigma] Z_f denotes the coefficient in Z_f

* \tau <= \sigma is to be understood componentwise.

I believe that this would imply a significant speedup in functorialCompose.

Ralf, don't you do something like this internally anyway, in order to obtain
the product of cycle index series? (Well, it doesn't seem so. Maybe that's a
point for having multivariate series...) In this case, it would only be a
matter of refactoring code.

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-13 09:37:39 UTC
Permalink
Post by Martin Rubey
Sorry for following up on my own mail...
Post by Martin Rubey
-- Idea 2
---------------------------------------------------------------------
Similar to the current approach in AC of computing cycle index
series via, it might be possible to compute only certain
coefficients of the cycle index series.
We'd have
[x^\sigma] Z_{f*g} = \sum_{\tau <= \sigma} [x^\tau] Z_f
[x^{\sigma-\tau}] Z_g
where
* \sigma is a cycle type
* x^\sigma = x1^{\sigma_1} x2^{\sigma_2} ...
* [x^\sigma] Z_f denotes the coefficient in Z_f
* \tau <= \sigma is to be understood componentwise.
I believe that this would imply a significant speedup in
functorialCompose.
Ralf, don't you do something like this internally anyway, in order to
obtain the product of cycle index series?
It depends on how you see it. You probably know how you multiply
univariate power series. Now think of the coefficient as a (weighted)
homogeneous polynomial in the variables x1,...,xn. Multiplication of two
CIS is done exactly that way.

If I do as you suggest, I would have to recompute [x^\sigma] Z_{f*g}
each time I need it. Or perhaps you tell me how you then compute the
n-th coefficient of the isomorphismType series from the CIS.
Post by Martin Rubey
(Well, it doesn't seem so. Maybe that's a point for having
multivariate series...) In this case, it would only be a
matter of refactoring code.
What has that to do with multivariate series. Actually, a CIS is already
a multivariate series. ;-)

Ralf

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-13 10:04:34 UTC
Permalink
Post by Martin Rubey
We'd have
[x^\sigma] Z_{f*g} = \sum_{\tau <= \sigma}
[x^\tau] Z_f [x^{\sigma-\tau}] Z_g
where
* \sigma is a cycle type
* x^\sigma = x1^{\sigma_1} x2^{\sigma_2} ...
* [x^\sigma] Z_f denotes the coefficient in Z_f
* \tau <= \sigma is to be understood componentwise.
I believe that this would imply a significant speedup in functorialCompose.
Ralf, don't you do something like this internally anyway, in order to
obtain the product of cycle index series?
It depends on how you see it. You probably know how you multiply univariate
power series. Now think of the coefficient as a (weighted) homogeneous
polynomial in the variables x1,...,xn. Multiplication of two CIS is done
exactly that way.
Post by Martin Rubey
(Well, it doesn't seem so. Maybe that's a point for having multivariate
series...)
If I do as you suggest, I would have to recompute [x^\sigma] Z_{f*g} each
time I need it.
No, the result should be cached.

Furthermore, I did not suggest to get rid of the cycleIndexSeries as we have it
now. Rather, to provide a second function that computes only a certain
coefficient fast.

I.e., we would have two different versions of coefficient (!): one, which
computes the whole cycleIndexSeries and another that computes only the
coefficient.

Of course, it may make sense to combine the two approaches. Modify the
datastructure of cycleIndexSeries such that it really is a multivariate series:

Currently, the smallest structure in the CIS is a polynomial, but it seems that
it is more efficient to have as smallest structure a monomial...
Or perhaps you tell me how you then compute the n-th coefficient of the
isomorphismType series from the CIS.
Of course, these monomials have to be grouped by total weight. Thus, when you
ask something like

coefficient(series, 28)

all monomials of total degree 28 are computed, but when you ask for

coefficient(series, [0,0,0,1,0,0,0,3])

only one monomial is computed.

In fact, I think this would be the right approach. This would also make
specialising to the exponential generating series efficient, and in fact,
specialising whenever "many" variables are set to zero, which does happen very
often in the symmetric functions world. (One is the so called "principal
specialisation of order n")

It would not affect the type generating series, of course. (which is the
"stable principal specialisation", by the way...)

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-13 10:19:00 UTC
Permalink
Post by Martin Rubey
Furthermore, I did not suggest to get rid of the cycleIndexSeries as we have it
now. Rather, to provide a second function that computes only a certain
coefficient fast.
I.e., we would have two different versions of coefficient (!): one, which
computes the whole cycleIndexSeries and another that computes only the
coefficient.
Ah, that sounds somewhat reasonable.
Post by Martin Rubey
Of course, it may make sense to combine the two approaches.
Of course the other coefficient function should first check whether the
coefficient is already computed and cached.
Post by Martin Rubey
Modify the
Currently, the smallest structure in the CIS is a polynomial, but it seems that
it is more efficient to have as smallest structure a monomial...
Fine. What data structure would you suggest?

Would it be different from (simplyfied things a bit):

Stream(List(Integer,PowerProduct))

(because this is basically what I have now, only that I call

List(Integer,PowerProduct) = Polynomial(x1,...xn,...)
Post by Martin Rubey
Or perhaps you tell me how you then compute the n-th coefficient of the
isomorphismType series from the CIS.
Of course, these monomials have to be grouped by total weight. Thus, when you
ask something like
coefficient(series, 28)
all monomials of total degree 28 are computed, but when you ask for
coefficient(series, [0,0,0,1,0,0,0,3])
only one monomial is computed.
Of course, I see that this does not compute unnessary coefficients. But
you certainly see, that we would have to provide the lightweight
coefficient function for all operations (+, *, compose, functorial
compose, integrate, differentiate, exponentiate) in an efficient way.
Who is going to do it?
Post by Martin Rubey
In fact, I think this would be the right approach. This would also make
specialising to the exponential generating series efficient, and in fact,
specialising whenever "many" variables are set to zero, which does happen very
often in the symmetric functions world. (One is the so called "principal
specialisation of order n")
Be a bit more precise.

Ralf

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-13 10:33:55 UTC
Permalink
Post by Ralf Hemmecke
Modify the datastructure of cycleIndexSeries such that it really is a
multivariate series: Currently, the smallest structure in the CIS is a
polynomial, but it seems that it is more efficient to have as smallest
structure a monomial...
Fine. What data structure would you suggest?
Stream(List(Integer,PowerProduct))
(because this is basically what I have now, only that I call
List(Integer,PowerProduct) = Polynomial(x1,...xn,...)
I am not a datastructure designer. However, what we may need is to distinguish
between a monomial which has not yet been computed and a monomial with zero
coefficient. Well, maybe it wouldn't really matter, one could store the
monomials with zero coefficient just as well.
Post by Ralf Hemmecke
[...] you certainly see, that we would have to provide the lightweight
coefficient function for all operations (+, *, compose, functorial compose,
integrate, differentiate, exponentiate) in an efficient way.
Not quite. Namely, we (well, in fact, you...) could "just" change the
datastructure first (if necessary) and provide the new caching mechanism. Then
the "old" algorithms for +, *, compose, functorial compose etc. should still
work, albeit with the drawback, that they compute many monomials even if only
one monomial is needed.

In a second step, you could modify Plus and Times to actually use the new
datastructure.
Post by Ralf Hemmecke
In fact, I think this would be the right approach. This would also make
specialising to the exponential generating series efficient, and in fact,
specialising whenever "many" variables are set to zero, which does happen very
often in the symmetric functions world. (One is the so called "principal
specialisation of order n")
Be a bit more precise.
More precise about what?

* the right approach:

only those monomials that are actually needed should be computed, whenever
possible.

* symmetric functions:

later in May, not now. I do not know enough about these things yet.

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-13 09:54:02 UTC
Permalink
Post by Martin Rubey
Dear Ralf,
Post by Ralf Hemmecke
I've found the problem with the seemingly slow functorial compose.
In the middle of the computation of functorialCompose(f,g), there is a
need to compute
count(f, t)
for t=x4^1*x8^3
A little more information would have saved me half an hour :-)
f= Subset, g= Combination(2), f\square g = Graph
Z=Z_{f\square g}
n=4
We have to compute, for example, the coefficient of x1*x3 in Z. Thus
sigma=(1,0,1). We first need to compute
(g[sigma])_1, (g[sigma])_2, (g[sigma])_3.
Computational effort for this increases reasonably as n gets larger: it
involves coefficients in Z_g of degree at most n. In this case, the result
turns out to be (0,0,2). Now, however, we have to compute
f[(0,0,2)]
which is slow, since the degree is not bounded by n anymore, but rather by ???
(shouldn't be too difficult to get a bound here, but I'm lazy)
Of course f[(0,0,2)] = [x2^2] f just needs to compute the series of f up
to (weighted) degree 4.

Your example is not illutrative. Look at my documentation for
functorialCompose in AC. We had the discussion before and you came up
with a bound.

In general we have to computed the cycle type of G[sigma].
Suppose sigma \in S_n, then then length of the longest cycle in G[sigma]
is bounded by the minimum of
\card G[n]
and
lcm [k for k in 1..n | sigma_k > 0].

And as it happens for n=8 in the CIS of graphs, that minimum is
something like 28.
Post by Martin Rubey
I see one possible *major* speedup: although we need many (all?) coefficients
of degree n of Z_g, we need only very few coefficients of Z_f, albeit of high
degree. So, possibly it makes sense to compute only these coefficients, rather
than the whole thing here.
That is a *major* rewrite. Since if you compute a series coefficient of
degree n all coefficients for smaller degree are currently computed. If
you don't like this then internally I would have to store whether a
coefficient has already been computed. Currently, I rely on the fact
that if the internal array has length n then all coefficients for 0..n-1
are stored.
Post by Martin Rubey
-- Idea 1 ---------------------------------------------------------------------
A possible approach to do that *might* also yield a brute force approach of
To compute the coefficient of x3^2/aut(0,0,2) in Z_f, we generate a permutation
of cycle type (0,0,2). Any permutation will do, so we take (1 2 3) (4 5 6). Now
we have to find all f-structures on {1,2,3,4,5,6} that are fixed points under
this permutation. In the present case (f = Subset), we obtain
{}, {1 2 3}, {4 5 6}, {1 2 3 4 5 6}
(More thinking is needed to see *how* to obtain these fixed points...)
So the coefficient we were looking for equals 4.
You think the computation of number of fixed points is easier? I don't
see that.

Ralf

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-13 21:06:36 UTC
Permalink
Somehow I overlooked that email. Sorry about the delay.
Post by Ralf Hemmecke
That is a *major* rewrite. Since if you compute a series coefficient of
degree n all coefficients for smaller degree are currently computed. If you
don't like this then internally I would have to store whether a coefficient
has already been computed.
I'm afraid, it's exactly what should be done. Namely, in another mail you wrote
that you currently store the CIS as
Post by Ralf Hemmecke
Stream(List(Integer,PowerProduct))
(because this is basically what I have now, only that I call
List(Integer,PowerProduct) = Polynomial(x1,...xn,...)
At first I thought one could simply "interpret" this datastructure differently:
if a coefficient is absent in the list, it has not yet been computed. If it has
been computed, it gets added to the list, possibly with zero
coefficient. However, doing so one never knows when all coefficients of a
certain degree have been computed, so a flag would be necessary here anyway, I
guess. Unless one checks that all possible monomials are there, but that
doesn't feel like the right thing to do...
Post by Ralf Hemmecke
Post by Martin Rubey
-- Idea 1 ---------------------------------------------------------------------
A possible approach to do that *might* also yield a brute force approach of
To compute the coefficient of x3^2/aut(0,0,2) in Z_f, we generate a permutation
of cycle type (0,0,2). Any permutation will do, so we take (1 2 3) (4 5 6). Now
we have to find all f-structures on {1,2,3,4,5,6} that are fixed points under
this permutation. In the present case (f = Subset), we obtain
{}, {1 2 3}, {4 5 6}, {1 2 3 4 5 6}
(More thinking is needed to see *how* to obtain these fixed points...)
So the coefficient we were looking for equals 4.
You think the computation of number of fixed points is easier? I don't see
that.
Me neither. It was just an idea.

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-13 21:43:21 UTC
Permalink
Post by Martin Rubey
Somehow I overlooked that email. Sorry about the delay.
Post by Ralf Hemmecke
That is a *major* rewrite. Since if you compute a series coefficient of
degree n all coefficients for smaller degree are currently computed. If you
don't like this then internally I would have to store whether a coefficient
has already been computed.
that you currently store the CIS as
Post by Ralf Hemmecke
Stream(List(Integer,PowerProduct))
(because this is basically what I have now, only that I call
List(Integer,PowerProduct) = Polynomial(x1,...xn,...)
if a coefficient is absent in the list, it has not yet been computed. If it has
been computed, it gets added to the list, possibly with zero
coefficient. However, doing so one never knows when all coefficients of a
certain degree have been computed, so a flag would be necessary here anyway, I
guess. Unless one checks that all possible monomials are there, but that
doesn't feel like the right thing to do...
Aaahh, you also see the problem. Today I thought a few minutes about it...

Fixing the datastructure is probably rather easy.

For example instead of Stream(P) where P contains the homogeneous CIS
polynomial of degree n one could use Stream(A) where A would be
something like

Record(p: P, complete?: Boolean, z: P)

with the following meaning:

any cycletype (encoded as a power product x^j) that has been computed
and has a nonzero coefficient is added to p. Those with a zero
coefficient are remembered in z (actually it would be enough if z is a
list of power products). If "complete?" is false then it is not known
whether p contains all the non-zero terms of degree n. So if one asks
for a term and it is not in p or q then one has to start to compute that
coefficient. If "complete?" is true, then p contains all non-zero terms
just as we have it now and z becomes irrelevant.

However, it looks a bit difficult to ensure that *all* cycletypes of
degree n have been considered. So it would probably be better to have

Record(p: P, r: P)

where at creation time r contains a list of *all* cycle types and an
element is removed from r if its coefficient has been computed. If the
coefficient is non-zero, the term is added to p, if it is zero, the
cycletype is thrown away.

Hmmm, I have no idea whether this makes sense.

And I have not thought about, how difficult all the operations +, *,
integrate(?), exponentiate, etc. become with that data structure.

Additionally, assume I ask for the polynomial of degree n and in the
data structure p already has some terms but r is not zero (or not the
empty list), then what is the fastest way to compute the correct p?
Should I start computation for each of the elements in r or would it be
wiser to throw away p and r and compute p in a similar fashion as is
done now, ie always consider the polynomial of degree n as *one* thing?

Ralf

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-13 22:24:26 UTC
Permalink
Post by Ralf Hemmecke
Fixing the datastructure is probably rather easy.
I doubt it :-)
Post by Ralf Hemmecke
Record(p: P, complete?: Boolean, zeros: P)
* advantage: no overhead at creation time
* drawbacks: it might be difficult to check whether everything is there. Well,
maybe not, since we could simply compute the number of partitions
and check whether the number is correct.

it might be difficult to see which terms are missing.

higher memory consumption - is that irrelevant?
Post by Ralf Hemmecke
Record(p: P, rest: P)
* drawbacks: trivial to check whether everything is there
* advantage: some overhead at creation time
Post by Ralf Hemmecke
And I have not thought about, how difficult all the operations +, *,
integrate(?), exponentiate, etc. become with that data structure.
I hope that the design of the datastructure could be done in such a way that
computing all terms of total degree n is just as easy as it is now.
Post by Ralf Hemmecke
Additionally, assume I ask for the polynomial of degree n and in the data
structure p already has some terms but r is not zero (or not the empty list),
then what is the fastest way to compute the correct p? Should I start
computation for each of the elements in r or would it be wiser to throw away
p and r and compute p in a similar fashion as is done now, ie always consider
the polynomial of degree n as *one* thing?
Do you see an example where you really save time when you compute all monomials
at once - as you do it now?

One fact that might favor polynomial-oriented algorithms is that you do not
have to consider all monomials, rather, only those which are actually
there. This is important, for example, for species built only using Plus and
Times and Singletons, since in this case the CIS depends only on x_1.

For example multiplication:

[x^\sigma] Z_{f*g} = \sum_{\tau <= \sigma} [x^\tau] Z_f [x^{\sigma-\tau}] Z_g

vs currently (I believe ?)

Z_{f*g} = \sum_n \sum_k [x^n] Z_f * [x^{n-k}] Z_g

where

* n denotes total degree

* \sigma is a cycle type

* x^\sigma = x1^{\sigma_1} x2^{\sigma_2} ...

* [x^\sigma] Z_f denotes the coefficient in Z_f

* \tau <= \sigma is to be understood componentwise.


I'm too lazy to count operations right now. But I guess that it does make a
difference... For some reason, computing monomials we do not "see" as much of
the argument cycleindexfunctions Z_f and Z_g as if we were computing
polynomials.


Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-13 22:57:01 UTC
Permalink
Post by Martin Rubey
Post by Ralf Hemmecke
Fixing the datastructure is probably rather easy.
I doubt it :-)
Post by Ralf Hemmecke
Record(p: P, complete?: Boolean, zeros: P)
* advantage: no overhead at creation time
* drawbacks: it might be difficult to check whether everything is there. Well,
maybe not, since we could simply compute the number of partitions
and check whether the number is correct.
it might be difficult to see which terms are missing.
higher memory consumption - is that irrelevant?
Post by Ralf Hemmecke
Record(p: P, rest: P)
* drawbacks: trivial to check whether everything is there
* advantage: some overhead at creation time
You probably meant to exchange drawback/advantage.

So let me suggest another representation, that consumes less memory, but
costs a bit more time. Instead of rest: P one could store

uncomputed: BitVector or uncomputed: Integer (which is equivalent)

which is for degree n of length P(n) (number of integer partitions of n).

In order to check whether a given cycle type (which is an integer
partition) is there one has to rank it and check the bit. If the bit
vector is zero, we are complete.
Post by Martin Rubey
Post by Ralf Hemmecke
And I have not thought about, how difficult all the operations +, *,
integrate(?), exponentiate, etc. become with that data structure.
I hope that the design of the datastructure could be done in such a way that
computing all terms of total degree n is just as easy as it is now.
That is what we just discuss. Don't you see that the entry p:P can
always computed as before? Just ignore the bit vector and compute
everything as we have it now. BTW, I have introduced a macro P in
src/gseries.as.nw if that is redefined to some other "Pseudo-Polynomial"
domain that we discuss now, there would probably be no modification of
the current implementation. It then just works over another domain.
Post by Martin Rubey
Post by Ralf Hemmecke
Additionally, assume I ask for the polynomial of degree n and in the data
structure p already has some terms but r is not zero (or not the empty list),
then what is the fastest way to compute the correct p? Should I start
computation for each of the elements in r or would it be wiser to throw away
p and r and compute p in a similar fashion as is done now, ie always consider
the polynomial of degree n as *one* thing?
Do you see an example where you really save time when you compute all monomials
at once - as you do it now?
One fact that might favor polynomial-oriented algorithms is that you do not
have to consider all monomials, rather, only those which are actually
there. This is important, for example, for species built only using Plus and
Times and Singletons, since in this case the CIS depends only on x_1.
You give the example yourself. Unfortunately, I have no experience, but
I would rather guess, that the polynomials of degree n almost never
contain every P(n) power products. But that's a wild guess.
Post by Martin Rubey
[x^\sigma] Z_{f*g} = \sum_{\tau <= \sigma} [x^\tau] Z_f [x^{\sigma-\tau}] Z_g
vs currently (I believe ?)
Z_{f*g} = \sum_n \sum_k [x^n] Z_f * [x^{n-k}] Z_g
where
* n denotes total degree
* \sigma is a cycle type
* x^\sigma = x1^{\sigma_1} x2^{\sigma_2} ...
* [x^\sigma] Z_f denotes the coefficient in Z_f
* \tau <= \sigma is to be understood componentwise.
I'm too lazy to count operations right now. But I guess that it does make a
difference... For some reason, computing monomials we do not "see" as much of
the argument cycleindexfunctions Z_f and Z_g as if we were computing
polynomials.
You see the problem with the first thing term-wise approach is that I
have to loop over all cycle types even those that correspond to zero
coefficients.

BTW, do you really think we (which probably means just me) should invest
more time into making cycle index series from polynomial-wise to
term-wise? Wouldn't it make more sense to just create SimpleGraph as
macro {
CS == CombinatorialSpecies;
E == SetSpecies;
E2 == RestrictedSpecies(E, 2);
WP == Times(E, E);
P2 == Times(E2, E);
}
SimpleGraph(L: LabelType): CS L == FunctorialCompose(WP, P2)(L) add;

and override the generic CIS and isomorphismTypeSeries with more
efficient versions?

Ralf



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-14 08:33:10 UTC
Permalink
Dear Ralf,

Maybe we should think about the efficiency comparison "polynomial" vs
"monomial" first. I am CC'ing this explicitely to Nicolas and Joris, maybe one
of you has some idea of what is a good approach? In fact, I believe that this
is a very interesting question in its own right, it should apply to many
settings, very likely also symmetric functions etc.

Nicolas, Joris, if you do not mind, I will simply forward our discussion to
you, it would be wonderful if you could come up with some ideas! Or maybe you
know somebody who knows... Finally, I'd be also interested whether you know
about other contexts where the same problem appears.

-- introduction ---------------------------------------------------------------

We are discussing possible ways of storing certain formal power series in many
variables. (In fact, currently we are interested mainly in the cycle index
series of combinatorial species, but, I believe, this is nearly irrelevant)

We like to view these series as univariate formal power series, with the
coefficient of x^n being (in a certain sense) homogeneous polynomials of total
degree n.

Now, Ralf has implemented many operations on these power series, like addition,
multiplication, derivative, integration, (a certain plethystic) composition,
so-called functorial composition, Hadamard product, etc.

Now, when we were trying out the operation called "functorial composition", we
experienced an efficiency problem:

Currently, the smallest entity of our series are the polynomials. I.e., our
series are streams of polynomials. To compute the next coefficient of, for
example, the product of two series f and g, we simply have

sum_k=0..n [x^k] f [x^(n-k)] g

Now, for functorial composition, we suddenly do not need to know *all*
coefficients of monomials of a given total degree, but rather only very few,
which are, however, of *very* high degree.

With our current approach, this does not work well, since we always need to
compute *all* monomials of a given total degree.

Thus, we thought about switching to a monomial-based approach, where we would
have (roughly) a stream of lists of monomials. However, we are afraid that this
will slow down all the other operations: often we want to compute *all*
monomials of a certain degree. And in many cases, only very very few monomials
will have non-zero coefficient...

I'm not sure whether I was precise and clear enough. If I wasn't *please* tell
me so...

In the following, CIS is for "cycle index series", i.e., the series which
interest us. These are series in infinitely many variables x1,x2,x3,..., where
the total degree of a monomial

x1^n1 x2^n2 x3^n3 ...

is

n1 + 2 n2 + 3 n3 + ...

We call the (finite!) vector (n1, n2, n3,...) "cycletype".

As I hinted at before, we consider these series as streams of "homogeneous"
polynomials.

For certain reasons, we denote the series with Z_f, Z_g, etc.

--end of introduction----------------------------------------------------------
Post by Martin Rubey
Post by Ralf Hemmecke
Additionally, assume I ask for the polynomial of degree n and in the data
structure p already has some terms but r is not zero (or not the empty
list), then what is the fastest way to compute the correct p? Should I
start computation for each of the elements in r or would it be wiser to
throw away p and r and compute p in a similar fashion as is done now, ie
always consider the polynomial of degree n as *one* thing?
Do you see an example where you really save time when you compute all
monomials at once - as you do it now?
One fact that might favor polynomial-oriented algorithms is that you do not
have to consider all monomials, rather, only those which are actually
there. This is important, for example, for species built only using Plus
and Times and Singletons, since in this case the CIS depends only on x_1.
[x^\sigma] Z_{f*g} =
[x^\sigma] Z_f*Z_g = \sum_{\tau <= \sigma} [x^\tau] Z_f
[x^{\sigma-\tau}] Z_g

which has to be done for all possible \sigma, vs the current implementation

Z_{f*g} = \sum_n \sum_k [x^n] Z_f * [x^{n-k}] Z_g

where

* n denotes total degree
* \sigma is a cycle type
* x^\sigma = x1^{\sigma_1} x2^{\sigma_2} ...
* [x^\sigma] Z_f denotes the coefficient in Z_f
* \tau <= \sigma is to be understood componentwise.
Post by Martin Rubey
I'm too lazy to count operations right now. But I guess that it does make a
difference... For some reason, computing monomials we do not "see" as much
of the argument cycleindexfunctions Z_f and Z_g as if we were computing
polynomials.
You see the problem with the first thing term-wise approach is that I have to
loop over all cycle types even those that correspond to zero coefficients.
Yes. The zero coefficients are the bad ones :-)

However, if the user (or program) knows that she is going to need all
coefficients, she will certainly not ask the system to compute the coefficients
of the monomials termwise.

We are in trouble only if some of the coefficients have been already computed,
and in the next step we need all of them anyway.

So, the problem roughly goes like:

coefficient(f, (0,0,5)); -- compute a monomial of degree 15
coefficient(f, (1,1,4)); -- compute another monomial of degree 15
-- now, several monomials of degree 15 and very likely of lower degree, too
-- have been computed

coefficient(f, 5); -- compute all monomials of degree 5.

What is the last operation to do? Should we have a rule of thumb, depending on
the number of missing monomials and the total number of possible monomials...?
BTW, do you really think we (which probably means just me) should invest more
time into making cycle index series from polynomial-wise to term-wise? Wouldn't
it make more sense to just create SimpleGraph as
macro {
CS == CombinatorialSpecies;
E == SetSpecies;
E2 == RestrictedSpecies(E, 2);
WP == Times(E, E);
P2 == Times(E2, E);
}
SimpleGraph(L: LabelType): CS L == FunctorialCompose(WP, P2)(L) add;
and override the generic CIS and isomorphismTypeSeries with more efficient
versions?
No. This may be interesting for graphs, but the problem is a general one, it is
not even restricted to functorial composition. (Well, in the species world it
is. But I'd be surprised if the problem wouldn't pop up in other contexts, too)
And I think it is an interesting problem. Don't you?



Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-14 08:41:28 UTC
Permalink
I'm collecting proposals...

Record(p: P, complete?: Boolean, zeros: P)
* advantage: no overhead at creation time
* drawbacks: it might be difficult to check whether everything is there. Well,
maybe not, since we could simply compute the number of partitions
and check whether the number is correct.
it might be difficult to see which terms are missing.
higher memory consumption - is that irrelevant?


Record(p: P, rest: P)
* advantage: trivial to check whether everything is there
* drawbacks: some overhead at creation time


Recodf(p:P, uncomputed: BitVector)
* advantage: less memory, no overhead at creation time
* drawbacks: more time to check which monomials with zero coefficient have been
computed already:
In order to check whether a given cycle type (which is an integer
partition) is there one has to rank it and check the bit. If the
bit vector is zero, we are complete.

I think the major concern is time efficiency. But it seems to me that 3) would
be faster than 1), which would be faster than 2). ("faster" is not a very
precise term here, of course)



Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Ralf Hemmecke
2007-03-13 22:21:48 UTC
Permalink
Post by Martin Rubey
Post by Ralf Hemmecke
That is a *major* rewrite. Since if you compute a series coefficient of
degree n all coefficients for smaller degree are currently computed. If you
don't like this then internally I would have to store whether a coefficient
has already been computed.
I'm afraid, it's exactly what should be done.
Cool, you complain rather late. Nicolas, what is MuPAD-combinat doing
here? Can you deal with cycle index series at all?

Ralf


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Martin Rubey
2007-03-13 22:25:58 UTC
Permalink
Post by Ralf Hemmecke
Post by Martin Rubey
Post by Ralf Hemmecke
That is a *major* rewrite. Since if you compute a series coefficient of
degree n all coefficients for smaller degree are currently computed. If you
don't like this then internally I would have to store whether a coefficient
has already been computed.
I'm afraid, it's exactly what should be done.
Cool, you complain rather late.
Hey, sorry! I didn't know at all about this stuff until you came up with
functorial composition.

Martin


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Loading...