Hello, I am trying to define a new algebraic class the easy way. The documentation is a bit confusing in this regard. It mentions typedef structure<sprod_s> sprod; and then proceeds with void sprod::print(const print_context & c, unsigned level) const { ... } How is this possible as structure<> already defines print() member function? Can someone give more specific details? thanks, Krishna. -- View this message in context: http://www.nabble.com/spcializing-print-function-tp19809899p19809899.html Sent from the Ginac - General mailing list archive at Nabble.com.
Hi, On Sat, Oct 04, 2008 at 12:53:21AM -0700, nomad wrote:
I am trying to define a new algebraic class the easy way.
@ developers: I don't think writing a GiNaC class is 'hard'. Anyway, fiddling with GiNaC::structure is not any easier. Hence I believe the documentation is confusing in this regard and needs to be fixed.
typedef structure<sprod_s> sprod;
void sprod::print(const print_context & c, unsigned level) const { ... }
How is this possible as structure<> already defines print() member function?
Oops. This is certainly documentation bug. Thanks for reporting it.
Can someone give more specific details?
Write a normal GiNaC class (see doc/examples/mystring.cpp). It's not as 'hard' as the documentation implies. Best regards, Alexei -- All science is either physics or stamp collecting.
participants (2)
-
Alexei Sheplyakov
-
nomad