[GiNaC-list] GiNaC Match Documentation

Richard B. Kreckel kreckel at ginac.de
Thu Aug 15 09:36:31 CEST 2013


Hi Mark,

On 08/13/2013 11:35 AM, Mark Round wrote:
> I have been encountering problems with the GiNaC function match.
> Basically I can not understand the documentation. I wanted to detail my
> story in the hope that perhaps my problems are solved and in the future
> someone else can avoid my pitfalls.
> 
> The documentation informs me that I need an associative array. I can not
> find how to construct such an array elsewhere in the documentation so I
> assume that I am supposed to use exhashmap. That was a point of
> confusion for me. Then I designed the following code snipet,
> 
> symbol x("x"), y("y");
> ex tmp=x+y;
> exhashmap <ex> array;
> 
> tmp.match(wild(1)+y);
> 
> which apparently works fine. Now I wish to fill 'array' with the
> replacement table. So I modified to,
> 
> tmp.match(wild(1)+y,array);
> 
> which returned the following compiler messages,

Make array an object of type exmap, instead of type exhashmap<ex> and it
compiles. This is documented in section "Matching expressions".

  -richy.


More information about the GiNaC-list mailing list