On 18:18 Sun 09 Sep , Oleksandr Motsak wrote:
> 2012/9/8 Benjamin Schnitzler <
benjamins...@googlemail.com>:
> > On 20:28 Fri 07 Sep , Oleksandr Motsak wrote:
> >> 2012/9/7 <
han...@mathematik.uni-kl.de>:
> >> > On Fri, Sep 07, 2012 at 07:02:56PM +0200, Benjamin Schnitzler wrote:
> >> >> I talked with viktor about the nc structure/system. The idea is
> >> >> quite good, but I do not want to rewrite the whole
> >> >> multiplications for every ordering and every ring, instead I'd
> >>
> >> that's the whole point - simply reset needed function pointers by your
> >> *generic* multiplication functions!
> >> No need to deal with that old mess.
>
> > I understand what You mean; again: The idea is good, but at the
> > current state of the Singular/Plural code it will not work. The
>
> It will certainly work provided you may also extend Plural while
> obeying to our conventions and rules.
> Whereas if you hack internals too much (e.g. change templates) - you
> risk that your contributions may never be accepted to mainstream.
May be so, but yet I do not know understand, how avoid rewriting
all the multiplications, without adapting the functions at the
right places. If the template system is not meant to be
extendable, or adaptable, then this is a problematic piece of the
singular code, which is one thing, why I agree with You, that it
should be rewritten using proper C++ templates. If Hannes is
sceptic, I can understand that, for sure there was lots of work
put into the template system.
>
>
> > reason is: To implement our algorithm, we made use of the
> > Singular code; we adapted it to our needs (to do it like this was
> > a demand of viktor and it makes sense, because rewriting all the
> > code may have taken a significant bigger amount of time). I will
> > give You a concrete example: The p_Minus_mm_Mult_qq__T (template)
> > function is used (indirectly) by ksCreateSpoly. We do not want to
> > rewrite this function completely, so we can not just change a
> > pointer, to overwrite it (and by the way, this kind of function
> > is not present in the nc/p_procs system), but yet, we want to
> > change *parts* of this function (for example we cannot make use
>
> AFAIK, nobody should directly call p_Procs->p_Minus_mm_Mult_qq (save
> for p_Minus/Plus_mm_Mult_qq),
> so we should fix that and probably also set it directly to something
> like nc_p_Minus_mm_Mult_qq.
> Hans, what do you think on this matter?
As I said, it its called indirectly. To be more exact:
ksCreateSpoly calls LObject::Tail_Minus_mm_Mult_qq, which then
calls r->p_Procs->p_Minus_mm_Mult_qq . Doesn't make a difference
for me.
>
> Moreover p_Minus/Plus_mm_Mult_qq are supposed to call
> nc_p_Minus_mm_Mult_qq (it's a bug otherwise),
> which is a generic function (since there was no need to make it templated).
> Therefore the proper way for you would be to change
> nc_p_Minus_mm_Mult_qq instead.
>
> > of existing p_MemSum__T implementations: we have to replace this!).
>
> Of course one is to use p_ExpVectorSum or p_MemSum_LengthGeneral instead.
>
> > I will now try to adapt the template generation file Hannes
> > mentioned, maybe this leads to right direction.
>
> If you see any reasons against the canonical approach (i.e. extending Plural) -
> please let us know and i hope that we will be able to advise you
> against that hackery and waisting your time.
I did not make a final decision yet. Extending Plural seems to be
a good thing, but I can yet not see, how this will help me in my
current situation, which I did explain above. I am also a bit
confused about what Plural is supposed to be. As far as I
understand it, it is (partially) a wrapper around the other
singular code, which allows to set some generic functions and
settings. However: If one (if I) wants to change only parts of
the existing (template) functions, rather than to rewrite them,
this is not the solution. I have also to talk back to Viktor. If
I really have to rewrite those functions, it might much slow down
the progress of our project. We would really have to write new
functions for every ring and ordering, which would be done by
just looking, what the template system does and copying that to
our own code files, which is something I really think to be
rather inefficient... But I do not yet have an overview over all
those cases I have to consider.
> > And I guess one has to be careful with this statement, as it will prevent compiler
> > optimization?
>
> Sorry, but i don't see how exactly forcing an individual *stub*
> function inlining can prevent optimization?
Yes, I think I just misunderstood You. I thought, You wanted
to use theese inlines also for other functions than these stub
functions.