Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to define a smart class using cython?

Hi, I managed to rewrite my problem so I only have to represent numbers in the following way: [(2,3),(3,3),(13,1)] like in list(factor(82713)). Thus [(prime,exponent), (prime,exponent), ...].

With such a representation multiplying is easy, and I can skip to factor numbers (again). What I'm looking for is a fast cython approach with a class where I can define a function for multiplying, but also where I'm able to store and retrieve a large set of numbers efficiently (within the program). I looked for examples in the Cython Tutorial et cetera, but I could not find an approach which helped me. Maybe someone is willing and able to share his/her expertise? Thanks in advance! Roland