Hello, On Sat, Oct 04, 2008 at 07:09:59PM -0400, Krishna Mohan Gundu wrote:
I am adding a light weight support for vector algebra in ginac. I am aware that it can be done through Clifford algebra, but the output is almost incomprehensible to debug.
I don't quite understand what is exactly wrong. Could you elaborate, please?
My problem is this. When a request like inner_product(lhs, rhs) is made, where one of lhs and rhs is not a vector, I would like to replace the inner_product with a regular product. How can I achieve this?
if (typeid(ex_to<basic>(lhs)) != typeid(your_class)) { // do the replacement } else if (typeid(ex_to<basic>(rhs)) != typeid(your_class)) { // same here } else { // do something nontrivial }
I am planning to do it as follows 1) extend a symbol to a vector
I don't think it's a good idea. Symbol is something simple and in a sense "atomic". Also it's quite performance and memory critical. You'd better use the clifford class. Best regards, Alexei -- All science is either physics or stamp collecting.