[GiNaC-list] is_a<su3f>(e) return zero!!

mdias at ift.unesp.br mdias at ift.unesp.br
Fri Mar 18 01:03:10 CET 2005


Hi guys,

First of all thanks for the answer. But a diferent question arise: I make a 
struct that look at a ex e=color_f($0,$1,$2) and return zero. But I tried:

is_a<su3f>(e)
is_exactly_a<su3f>(e)
is_a<su3f>(e.op(0))
is_a<color>(e)

but all returns zero? I think my archive is corrupted. Somebody tried it before?

Thanks,


Marco


Citando Christian Bauer <Christian.Bauer at uni-mainz.de>:

> Hi!
> 
> On Tue, Mar 15, 2005 at 06:54:01PM -0300, mdias at ift.unesp.br wrote:
> > I have a simple question. I would like to construct a derived class of
> > indexed type, folowing the final part of tutorial. How can I inherit
> > simplify_indexed()?
> 
> You can't, as there is no member function simplify_indexed().
> 
> What you can override is eval_indexed() (for automatic evaluation) and
> contract_with()/add_indexed()/scalar_mul_indexed() (for manual evaluation,
> AKA simplify_indexed()). However, these are not methods of the 'indexed'
> class but of the base objects that are being indexed.
> 
> You probably don't need to subclass 'indexed' at all. The library is
> designed in a way that allows putting nearly all relevant properties of
> indexed expressions into their base objects. If you still want to do it:
> take a look at GiNaC's 'color' class (color.h/color.cpp) which is pretty
> minimal, except for its eval_ncmul() (the main purpose of the color class
> is to implement the proper noncommutative behavior of indexed color
> objects).
> 
> Bye,
> Christian
> 
> -- 
>   / Physics is an algorithm
> \/ http://www.uni-mainz.de/~bauec002/
> 
> _______________________________________________
> GiNaC-list mailing list
> GiNaC-list at ginac.de
> http://thep.physik.uni-mainz.de/mailman/listinfo/ginac-list
> 




-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/




More information about the GiNaC-list mailing list