[GiNaC-devel] Proposal: matrices may no longer be given varidxes.

Jens Vollinga vollinga at physik.uni-wuppertal.de
Fri Aug 18 15:42:07 CEST 2006


Dear Chris,

Chris Dams schrieb:
> On Thu, 17 Aug 2006, Vladimir Kisil wrote:
> 
>>   With the present state I can use M.i.i to denote a generic diagonal
>>   element of M and M.i~i---the sum of all such elements. Certainly other
>>   users may think on other application of such a freedom.
> 
> Well, we have recently seen that doing that kind of misuse is a bit
> dangerous, havn't we? Something like this can break rather easily if new
> functionality is added to the library. Therefore, I think helping the user
> a bit by explicitly forbidding dangerous expressions is beneficial.
> 
> For what you want to do, I would suggest to introduce a symbolic function, 
> say "nosum" and to write M.nosum(i).nosum(i). That should be safe. Well, 
> at least as long as there are no other i's hanging around...
> 
> Vladimirs opinion has been noted. Do other people have other/the same 
> opions available?

I have no advice or strong opinion about this issue, sorry.

The only remarks I can make are probably on a level too basic to be helpful:

Why is class 'indexed' used to attach indices to matrices? tensors for 
example get their indices at creation time. There is a reason for that. 
This is something that still confuses me. If M is my matrix, I would 
expect indexed(M,i) give me a kind of vector (~tensor) of matrices (note 
the plural).

Maybe this inconsistency (at least in my opinion it is one) lies at the 
heart of the 'indexed' problem.

Regards,
Jens


More information about the GiNaC-devel mailing list