Having both programmed my share of c++ and studied some beginners group theory some year ago, I got curious about this...

Is there any particularly popular template based (object oriented) design pattern for systematically programming any kind of stuff related to group theory?

  • 3
    $\begingroup$ I think this is too general a question. "Abstract algebraic concepts" is just too unspecified to allow saying anything about representation with templates. $\endgroup$ – Wolfgang Bangerth Nov 27 '17 at 20:05
  • $\begingroup$ Ok I can scratch the abstract algebraic concepts and stick with group theory. But I had enough of trouble to manage to find tags to fit the question already. $\endgroup$ – mathreadler Nov 27 '17 at 20:14
  • $\begingroup$ A comment rather than an answer: translating the math. structure into templates, though natural, is not always beneficial to software design (sometimes it's good, sometimes it makes it more complicated with no benefit) $\endgroup$ – BrunoLevy Nov 28 '17 at 15:55
  • $\begingroup$ @BrunoLevy : Yes I know it is not always beneficial. But I would suspect something with so many rules and structures as algebra would benefit from it. $\endgroup$ – mathreadler Nov 28 '17 at 17:10

Chapters 6 and 7 of Stepanov and Rose's book From Mathematics to generic programming deal precisely with what you asked. The first author is the designer of the C++ Standard Template Library.

  • $\begingroup$ Clever choices, definitely. Almost mindblastingly clever. Almost presidentially clever, even. $\endgroup$ – mathreadler Nov 27 '17 at 21:26

An earlier alternative to Stepanov's treatment of abstract algebra (including groups) is the one given in Barton and Nackman's "Scientific and Engineering C++".

In more modern c++, the boost concept checking library would seem to be a quite natural means of modularising the hierarchy of algebraic types (semigroups, monoids, groups etc).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.