[GiNaC-list] Question regarding using C-XSC and GiNaC together

Sunayana Ghosh S.Ghosh at cs.rug.nl
Wed Jan 30 16:08:43 CET 2008


Hi,

I am a newbie as far as programming in C++ is concerned. I am trying to 
write a program which uses both packages C-XSC and GiNaC.

I have a function in C-XSC:

GTvector F (const GTvector& x)
{
  GTvector Result(3);
  Result[1] = 
-3.0/4.0*(3.0*sin(2*x[1])+sin(x[1]+x[2])+sin(x[1]+x[3])-sin(x[2]+x[3]));
  Result[2] = 
-3.0/4.0*(3.0*sin(2*x[2])+sin(x[1]+x[2])-sin(x[1]+x[3])+sin(x[2]+x[3]));
  Result[3] = 
-3.0/4.0*(3.0*sin(2*x[3])-sin(x[1]+x[2])+sin(x[1]+x[3])+sin(x[2]+x[3]));
  return Result;
}

My question is :
if I want to generalize this function so that it can be used for any 
three functions f1, f2, f3 belonging to the class "ex" of GiNaC, where
f1 , f2, f3  are functions of  (t1,t2,t3), where t1, t2 and t3 belong to 
class "symbol" in GiNaC.
As in a function where Result[1] = f1(t1,t2,t3) and so on.
Would somebody be able to tell me how to go about this.

With Regards,
Sunayana


More information about the GiNaC-list mailing list