These are chat archives for symengine/symengine

19th
Mar 2016
Akash Trehan
@CodeMaxx
Mar 19 2016 05:29
@isuruf Why does numer_denom.cppuse Ptr<RCP<const Basic>> ? Couldn’t the same functionality be achieved by just using RCP<const Basic>& ?
Abhinav Agarwal
@abhinavagarwal07
Mar 19 2016 06:25
If calculus module is needed in symengine, I would like to work on it and can use some help https://groups.google.com/forum/m/#!topic/symengine/BOamOmtPqoQ
Isuru Fernando
@isuruf
Mar 19 2016 08:06
This message was deleted
Akash Trehan
@CodeMaxx
Mar 19 2016 08:17

@isuruf @certik I read up on Polynomiial factoring algorithms and finally have two of them in mind - Berkelamp’s Algorithm and Cantor - zassenhaus algorithm. Sympy has both of these implemented with an option to switch between them but I am initially thinking of implementing only one of them and do the other if time permits. Which one would you prefer being implemented? I’d myself prefer to do Cantor-Zassenhaus first since its faster. But there is always a trade off.

A fundamental difference between the two algorithms is that the Berlekamp algorithm is deterministic. This means that given any polynomial it will provide the unique factorization eventually, regardless of how many steps it takes. The CZ algorithm on the other hand is probabilistic, in that it can effectively fail to factor a polynomial completely. The tradeoff is that probabilistic factoring algorithms tend to utilize tricks that enable them to perform tasks quicker if they do succeed.

Isuru Fernando
@isuruf
Mar 19 2016 08:32
What does SymPy use by default?
Isuru Fernando
@isuruf
Mar 19 2016 08:42
@CodeMaxx, btw, you should ask @Sumith1896, it's his idea
Akash Trehan
@CodeMaxx
Mar 19 2016 08:50
@isuruf Sympy uses Cantor-Zassenhaus by default.
Isuru Fernando
@isuruf
Mar 19 2016 08:50
Okay then, start with Cantor-Zassenhaus
Akash Trehan
@CodeMaxx
Mar 19 2016 09:18
@isuruf btw I took a look at Pynac’s Infinity class as well. Its pretty interesting. I’m thinking of following it rather than sympy for this.
Just wanted to ask if you have any other ideas or views regarding this?
Isuru Fernando
@isuruf
Mar 19 2016 10:11
@abhinavagarwal07, what do you mean by, some of functions are relatively easy to implement (like trig integration) ?
Akash Trehan
@CodeMaxx
Mar 19 2016 10:14

@CodeMaxx actually Sage has two implementations, an InfinityRing and infinity with directions inside Pynac:

@rwst What do you mean by “limited” to three direction? Doesn’t positive = +1, negative = -1 and complex = 0 cover all we need?

Isuru Fernando
@isuruf
Mar 19 2016 10:15
@CodeMaxx, there are other directions, like (1+I)/sqrt(2)
Akash Trehan
@CodeMaxx
Mar 19 2016 10:16
Oh! For complex space…I see. I think even sympy lacks those
Akash Trehan
@CodeMaxx
Mar 19 2016 10:22
@isuruf Do we presently require such an omni-directional infinity in symengine ?
I don’t see (1+I)/sqrt(2) kind of infinity being used very frequently. I might be wrong though.
Isuru Fernando
@isuruf
Mar 19 2016 10:24
For now, the 3 directions are okay, but make sure the design is good enough to handle any direction later
Akash Trehan
@CodeMaxx
Mar 19 2016 10:26
I think following Pynac’s design would be appropriate then.
It has Infinity with direction as an argument as opposed to sympy which has multiple immutable singletons for different infinities.
Akash Trehan
@CodeMaxx
Mar 19 2016 13:29

@isuruf Why does numer_denom.cppuse Ptr<RCP<const Basic>> ? Couldn’t the same functionality be achieved by just using RCP<const Basic>& ?

@isuruf Can you please explain about this?

Isuru Fernando
@isuruf
Mar 19 2016 13:43
Both should be the same in Release mode, but in Debug mode there are some extra checks.
Akash Trehan
@CodeMaxx
Mar 19 2016 13:45
Can you give some example on this? I mean what check would cause RCP<const Basic>& to fail in Debug mode?
I mean in the implementation we are nowhere using the pointer itself we are always dereferencing it to get a RCP.
Isuru Fernando
@isuruf
Mar 19 2016 13:50
Yes, that's in Release mode, which should be as fast. In Debug mode in Teuchos implementation, there are several checks
Akash Trehan
@CodeMaxx
Mar 19 2016 14:16
Oh right. Thanx :smile:
Akash Trehan
@CodeMaxx
Mar 19 2016 21:19
@isuruf Is it preferable to use Number in FiniteSet as well ?