[GiNaC-list] indexed object

Richard B. Kreckel kreckel at ginac.de
Sat Oct 27 22:00:39 CEST 2007


Gilson Dallabona wrote:
> I'm a new user of Ginac and I have found a problem.
> I need to define an indexed object with six indices or more.
> However, for an indexed object with more than four indices
> the compilation returns an error. A simple example is:
> 
>  symbol Delta("Delta");
>  varidx mu(symbol("mu"),4), nu(symbol("nu"),4), alpha(symbol("alpha"),4),
>        beta(symbol("beta"),4), sigma(symbol("sigma"),4),
> lambda(symbol("lambda"),4);
> 
>  ex e = indexed(Delta,mu,nu,alpha,beta,alpha,beta);
>  cout << e << endl;
> 
> returns a compilation error like this
> 
> "error: no matching function for call to
> 'GiNaC::indexed::indexed(GiNaC::symbol&, GiNaC::varidx&, GiNaC::varidx&,
>  GiNaC::varidx&, GiNaC::varidx&, GiNaC::varidx&, GiNaC::varidx&)"
> 
> Is there a way to define an indexed object with more than four indices
> in Ginac?

Just use this indexed constructor signature:
indexed::indexed(const ex & b, const exvector & iv).
It constructs an indexed object with a specified vector of indices. The 
indices must be of class idx.

   -richy.
-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>


More information about the GiNaC-list mailing list